Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Still some functions missing from Macro Editor help #403

Open
Phergus opened this issue Mar 28, 2019 · 9 comments
Open

Still some functions missing from Macro Editor help #403

Phergus opened this issue Mar 28, 2019 · 9 comments
Assignees
Labels
bug documentation needed Missing, out-of-date or bad documentation

Comments

@Phergus
Copy link
Contributor

Phergus commented Mar 28, 2019

Describe the bug
The following functions are not supported by the code completion in the Macro Editor.

[r: abs(-1)]
[r: absolutevalue(-1)]
[r: add(3,2)]
[r: average(1,2,3,4,5,6,7,8,9,10)]
[r: avg(1,2,3,4,5,6,7,8,9,10)]
[r: band(4,6)]
[r: bitwiseand(3,1)]
[r: bitwisenot(14)]
[r: bnot(14)]
[r: bitwiseor(3,5)]
[r: bor(3,5)]
[r: bitwisexor(4,8)]
[r: bxor(4,8)]
[r: ceil(1.2)]
[r: ceiling(1.2)]
[r: concat("con","cat")]</br>
[r: countsuccess(5,10,7)] <!-- missing from help, possibly showing as 'count' -->
[r: dice(3,6)]
[r: d(3,6)]
[r: divide(25,5)]
[r: drop(4,6,1)]
[r: floor(3.9)]
[r: fudge(5)]
[r: hero(10,6)]
[r: herobody(10,6)]
[r: herostun(10,6)]
[r: hex(65535)]
[r: hypotenuse(3,4)]
[r: hypot(3,4)]
[r: keep(4,6,3)]
[r: ln(10)]
[r: log(10)]
[r: log10(10)]
[r: max(1,2)]
[r: mean(1,2,3,3)]
[r: median(1,2,3,3)]
[r: min(1,2)]
[r: multiply(5,5)]
[r: openTest(10,10)]
[r: power(2,8)]
[r: pow(2,8)]
[r: roll(3,6)]
[r: round(math.pi(),4)]
[r: sqr(2)]
[r: square(2)]
[r: sqrt(4)]
[r: squareroot(4)]
[r: sr4(5,1)]
[r: sr4e(5,1)]
[r: subtract(2,1)]
[r: success(5,20,10)]
[r: sum(1,2,3,4,5,6,7)]
[r: ubiquity(5)]
[r: u(5)]

The following functions have highlighting and show up in code completion but have other issues.

<!-- count() in autocomplete but no such function -->
[r: exposeAllOwnedArea("Grasslands")] <!-- no help text -->
[r: getLastPath()] <!-- Shows up 7 times in autocomplete -->
[r: getMoveCount()] <!-- Shows up 7 times in autocomplete -->
[r: getTokenName()] <!-- no help text -->
[r: getTokenNativeHeight()] <!-- no help text -->
[r: getTokenNativeWidth()] <!-- no help text -->
[r: movedOverPoints("","")] <!-- shows up 10 times in autocomplete, wiki entry needs fixing -->
<!-- switch() shows in help but doesn't exist -->

To Reproduce
Steps to reproduce the behavior:

  1. Start MapTool
  2. Add Macro to Campaign Panel
  3. Edit Macro
  4. Enter functions above and noticed lack of highlighting and that they are missing from the code completion.

Expected behavior
Expect highlighting and to show up in suggestions when using code completion (Ctrl-Space).

Campaign
Example campaign with all missing functions in a macro.
MacroFunctionsTest.cmpgn.zip

MapTool Info

  • Version: 1.5.0+
  • Install: Any

Desktop (please complete the following information):

  • OS: Windows
  • Version: 10
@Phergus Phergus changed the title Still some funcitons missing from Macro Editor help Still some functions missing from Macro Editor help Mar 28, 2019
@Phergus Phergus added bug documentation needed Missing, out-of-date or bad documentation labels Mar 28, 2019
@Azhrei Azhrei self-assigned this Mar 28, 2019
@Azhrei
Copy link
Member

Azhrei commented Mar 28, 2019

Thanks, @Phergus.

I knew that math.* functions wouldn't be there, but the thought the ones without the prefix would've been.

I think count is the builtin variable that the for loop creates. It might've been picked up as a function when it's a variable.

I'll check the rest of these and regenerate the help docs. Thanks for the list!

@Phergus
Copy link
Contributor Author

Phergus commented Mar 28, 2019

re count - Ah. That's right. Other variables show up the same way.

@Phergus
Copy link
Contributor Author

Phergus commented Mar 29, 2019

I cleaned up the wiki entry for movedOverPoints(). Hopefully it is moderately understandable now and includes documentation for the second parameter option.

@Azhrei
Copy link
Member

Azhrei commented Mar 29, 2019

But the rest have wiki entries, they just weren’t caught by my automated script? There must be something different about those entries. My approach will likely be to figure out what the difference is and correct it, then re-run the extraction.

@Phergus
Copy link
Contributor Author

Phergus commented Mar 29, 2019

I noticed that they are also not listed out by the -macros command line switch for MT. Something different about the way they get registered as functions.

@Phergus
Copy link
Contributor Author

Phergus commented Apr 25, 2019

@JamzTheMan Any insight as to why these don't show up in the command line generated list?

@JamzTheMan
Copy link
Member

They are not defined in the MapToolLineParser. There are handfuls of functions and variables declared in various places. :/

@Phergus
Copy link
Contributor Author

Phergus commented Apr 25, 2019

Ugh.

@Phergus
Copy link
Contributor Author

Phergus commented Apr 25, 2019

@Azhrei Looking at add() aka sum() aka concat(). I notice it didn't have the version or trusted tags. Or parameters. Might that be messing with the script?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug documentation needed Missing, out-of-date or bad documentation
Projects
None yet
Development

No branches or pull requests

3 participants