Can't seem to get the macro() roll option to work
Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice
Can't seem to get the macro() roll option to work
This is probably something incredibly stupid that I'm forgetting, but for some reason I can't get a simple macro calling thing to work right. All I'm trying to do is set up a macro that can edit a HP bar, but to do so I need to use a Library Token because of trusted macros. I've already checked that my Library Token is, in fact, a Library Token, as best as I can (by checking that it runs a getLibProperty function correctly) and I'm not sure what else to do. What I've written so far is:
[h:MACRO("editHPBar@Lib:Handy"):HPPerc]
And as far as I know that should work.
[h:MACRO("editHPBar@Lib:Handy"):HPPerc]
And as far as I know that should work.
Re: Can't seem to get the macro() roll option to work
so whats the error? also make sure that the lib is on the token layer and that its not owned by anyone.
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
Re: Can't seem to get the macro() roll option to work
It's on the token layer and it's not owned by anyone. The error is:
Error in body of roll.
Statement options (if any): h
Statement Body : MACRO("editHPBar@Lib:Handy"):HPPerc
It is definitely that one line causing the error, because the macro works perfectly when I take it out.
Error in body of roll.
Statement options (if any): h
Statement Body : MACRO("editHPBar@Lib:Handy"):HPPerc
It is definitely that one line causing the error, because the macro works perfectly when I take it out.
Re: Can't seem to get the macro() roll option to work
Can you point to a link where this code is, thanks.
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
Re: Can't seem to get the macro() roll option to work
For you the same: pls turn on the macro l logging in the launcher and let us know what the error I the lib is. For more info see the debug link in my Sig.
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
Re: Can't seem to get the macro() roll option to work
@Aliasmask: Sorry, I don't quite understand the question. If you mean 'where did I get the code from' it was from the wiki.
@Wolph42: Er...every time I turn on macro handling as that page explains it deletes the logging.xml file. I also don't understand what "what the error I the lib is" means. Could you explain a little more clearly?
@Wolph42: Er...every time I turn on macro handling as that page explains it deletes the logging.xml file. I also don't understand what "what the error I the lib is" means. Could you explain a little more clearly?
Re: Can't seem to get the macro() roll option to work
I figured it was in the wiki... somewhere. The link you gave does not refer to the same code you're having trouble with.
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
Re: Can't seem to get the macro() roll option to work
"every time I turn on macro handling as that page explains it deletes the logging.xml file"llyarden wrote:@Aliasmask: Sorry, I don't quite understand the question. If you mean 'where did I get the code from' it was from the wiki.
@Wolph42: Er...every time I turn on macro handling as that page explains it deletes the logging.xml file. I also don't understand what "what the error I the lib is" means. Could you explain a little more clearly?
regardless, did you check the log.txt ? and what did it say?
There is a chance that you have the same issue with the logging as I have, in which case you need to fly this in entirely differently, but I'll get there when you tell me what your log tells you
"what the error I the lib is" = "what the error in the lib is" (simply what the error is you fin in the log).
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
Re: Can't seem to get the macro() roll option to work
@Aliasmask: I changed the names of the variables, but beyond that it's exactly the same code. Changing the names of the variables shouldn't have any impact on the macro, should it?
@Wolph: The log.txt is completely empty.
@Wolph: The log.txt is completely empty.
Re: Can't seem to get the macro() roll option to work
Okay, I get it. You're not using the example code to test but are making your own macro and your just showing me the wiki definition of macro.llyarden wrote:@Aliasmask: I changed the names of the variables, but beyond that it's exactly the same code. Changing the names of the variables shouldn't have any impact on the macro, should it?
@Wolph: The log.txt is completely empty.
If you could please post your code, I can then look at it as tell you if I see anything wrong.
Your use of [macro:] isn't inherently incorrect given a single line, but there are many places where a macro may break down. First, is HPPerc defined? Is there a macro named editHPBar? Does that macro have the correct settings for impersonation and permissions?
If you find your log.txt file under .maptool and delete it, then open up the launcher for b91 and go to Advanced Tab. There you can check all the boxes. Now open up b91 and your saved campaign then run the macro. Go to the log.txt file and copy all the text and paste it in to a "Code" block (edit option for posting), then we can see what it doesn't like. You can also post the code that executes the macro (the button you push) and the macro it calls (editHPBar).
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
Re: Can't seem to get the macro() roll option to work
Right. I hope this works. I put them in spoilers because they're kinda long. As to your other questions, yes, there is an HPPerc variable, defined in the previous line, and...I don't know what permissions and impersonations need to be done aside from making the macros not editable by players.
Entirely seperately, I also can't get the setBar function to work on the macro I'm trying to call, even when I try to just give it a fixed number (such as 0.5) to set the bar to. The setBarVisible function works perfectly, though.
Original Macro
Code: Select all
[h:HPMax=getProperty("HitpointsInjured",getSelected())]
[h:HPCurr=getProperty("HitpointsCurrent",getSelected())]
[h:box=input("DamBase|0|Damage Taken",
"Type|Normal,Fighting,Flying,Poison,Ground,Rock,Bug,Ghost,Steel,Fire,Water,Grass,Electric,Psychic,Ice,Dragon,Dark,Fairy|Damage Type|LIST|VALUE=STRING",
"Cat|Physical,Special|Damage Category|LIST|VALUE=STRING",
"DR|0|Damage Reduction",
"Resist|0|Additional Steps of Resistance")]
[h:abort(box)]
[h:PhysDef=getProperty("DefenceFinal",getSelected())]
[h:SpecDef=getProperty("SpDefFinal",getSelected())]
[h,switch(Cat):
case "Physical": Def=PhysDef;
case "Special": Def=SpecDef;
default:Def=0]
[h:DRForm=if(DR==0,""," and by "+DR+" by Damage Reduction")]
[h:TypeProp1=Type+"1"]
[h:TypeProp2=Type+"2"]
[h:TypeProp3=Type+"3"]
[h:Typetest=Type+"test"]
[h:Typeout=Type+"out"]
[h:Type1=getProperty(TypeProp1,getSelected())]
[h:Type2=getProperty(TypeProp2,getSelected())]
[h:Type3=getProperty(TypeProp3,getSelected())]
[h,if(Type1 == "Imm" || Type2 == "Imm" || Type3 == "Imm"), code:
{
[Typetest="Imm"]
};
{
[Typetest=Type1+Type2+Type3-Resist]
}]
[h:Typetest=if(Typetest<-3,-3,Typetest)]
[h,switch(Typetest):
case "3": Flash="<br><b><font color=#ff8d00>It's Super Effective!</font></b>";
case "2": Flash="<br><b><font color=#ff8d00>It's Super Effective!</font></b>";
case "1": Flash="<br><b><font color=#ff8d00>It's Super Effective!</font></b>";
case "-1": Flash="<br><b><font color=#008ace>It's not very effective...</font></b>";
case "-2": Flash="<br><b><font color=#008ace>It's not very effective...</font></b>";
case "-3": Flash="<br><b><font color=#008ace>It's not very effective...</font></b>";
case "Imm": Flash="<br><b><font color=#8e00a9>But nothing happens...</font></b>";
default: Flash=""]
[h,switch(Typetest):
case "3": Typeout=3;
case "2": Typeout=2;
case "1": Typeout=1.5;
case "0": Typeout=1;
case "-1": Typeout=0.5;
case "-2": Typeout=0.25;
case "-3": Typeout=0.125;
case "Imm": Typeout=0;
default: Typeout=1]
[h:DamDef=DamBase-Def-DR]
[h:Dam=floor(DamDef*Typeout)]
[h:Dam=if(DamDef<1,1,Dam)]
[h:DamFixText=if(DamDef<1," and increased to 1 as it's impossible to take no damage","")]
[h:NewHP=HPCurr-Dam]
[h:HPPrint=NewHP+" / "+HPMax]
[h:HPPerc=NewHP/HPMax]
[h:MACRO("editHPBar@Lib:Handy"):HPPerc]
[h:setProperty("HPOUT",HPPrint,getSelected())]
[h:setProperty("HitPointsCurrent",NewHP,getSelected())]
[r:getProperty("Name",getSelected())] takes [r:DamBase] [r:Type] [r:Cat] damage![r:Flash][s:"<br>"+DamBase+" "+Type+" "+Cat+" damage, reduced by "+Def+" by "+Cat+" Defence"+DRForm+" to "+DamDef+", multiplied by "+Typeout+" for type effectiveness"+DamFixText+" for a total of "+Dam+" hitpoints lost, dropping from "+HPCurr+" to "+NewHP+" hitpoints."]
editHPBar
Code: Select all
[h:setBar("Health",macro.args)]
[h:setBarVisible("Health",1)]
Log
Code: Select all
2015-07-20 10:19:27,346 [client.AppState:158] DEBUG - AppState.isSaving is false
2015-07-20 10:19:27,626 [io.PackedFile:590] DEBUG - FileUtil.getContentType() returned application/xml
2015-07-20 10:19:27,636 [io.PackedFile:590] DEBUG - FileUtil.getContentType() returned application/xml
2015-07-20 10:19:28,456 [model.Token:1029] DEBUG - Evaluating property: 'HPOUT' for token Lib:Handy(00000000BC6D63A76403000000000000)----------------------------------------------------------------------------------
2015-07-20 10:19:28,466 [model.Token:1029] DEBUG - Evaluating property: 'HPOUT' for token Lib:Handy(00000000BC6D63A76403000000000000)----------------------------------------------------------------------------------
2015-07-20 10:19:28,466 [model.Token:1029] DEBUG - Evaluating property: 'Injuries' for token Lib:Handy(00000000BC6D63A76403000000000000)----------------------------------------------------------------------------------
2015-07-20 10:19:28,466 [model.Token:1029] DEBUG - Evaluating property: 'Injuries' for token Lib:Handy(00000000BC6D63A76403000000000000)----------------------------------------------------------------------------------
2015-07-20 10:19:28,916 [model.Token:1029] DEBUG - Evaluating property: 'HPOUT' for token Blinded(000000007C7B76A61F00000000000000)----------------------------------------------------------------------------------
2015-07-20 10:19:28,916 [model.Token:1029] DEBUG - Evaluating property: 'HPOUT' for token Blinded(000000007C7B76A61F00000000000000)----------------------------------------------------------------------------------
2015-07-20 10:19:28,916 [model.Token:1029] DEBUG - Evaluating property: 'Injuries' for token Blinded(000000007C7B76A61F00000000000000)----------------------------------------------------------------------------------
2015-07-20 10:19:28,916 [model.Token:1029] DEBUG - Evaluating property: 'Injuries' for token Blinded(000000007C7B76A61F00000000000000)----------------------------------------------------------------------------------
2015-07-20 10:19:29,326 [model.Token:1029] DEBUG - Evaluating property: 'HPOUT' for token Blinded(000000007C7B76A61F00000000000000)----------------------------------------------------------------------------------
2015-07-20 10:19:29,326 [model.Token:1029] DEBUG - Evaluating property: 'HPOUT' for token Blinded(000000007C7B76A61F00000000000000)----------------------------------------------------------------------------------
2015-07-20 10:19:29,326 [model.Token:1029] DEBUG - Evaluating property: 'Injuries' for token Blinded(000000007C7B76A61F00000000000000)----------------------------------------------------------------------------------
2015-07-20 10:19:29,326 [model.Token:1029] DEBUG - Evaluating property: 'Injuries' for token Blinded(000000007C7B76A61F00000000000000)----------------------------------------------------------------------------------
2015-07-20 10:19:30,277 [client.MapToolLineParser:1301] DEBUG - HPMax=getProperty("HitpointsInjured",getSelected())
2015-07-20 10:19:30,447 [model.Token:1029] DEBUG - Evaluating property: 'HitpointsInjured' for token Blinded(000000007C7B76A61F00000000000000)----------------------------------------------------------------------------------
2015-07-20 10:19:30,447 [client.MapToolLineParser:1301] DEBUG - floor(HitpointsMax*(1-0.1*Injuries)))
2015-07-20 10:19:30,457 [model.Token:1029] DEBUG - Evaluating property: 'HitpointsMax' for token Blinded(000000007C7B76A61F00000000000000)----------------------------------------------------------------------------------
2015-07-20 10:19:30,457 [model.Token:1029] DEBUG - Evaluating property: 'Injuries' for token Blinded(000000007C7B76A61F00000000000000)----------------------------------------------------------------------------------
2015-07-20 10:19:30,457 [client.MapToolLineParser:1301] DEBUG - HPCurr=getProperty("HitpointsCurrent",getSelected())
2015-07-20 10:19:30,457 [model.Token:1029] DEBUG - Evaluating property: 'HitpointsCurrent' for token Blinded(000000007C7B76A61F00000000000000)----------------------------------------------------------------------------------
2015-07-20 10:19:30,457 [client.MapToolLineParser:1301] DEBUG - box=input("DamBase|0|Damage Taken",
"Type|Normal,Fighting,Flying,Poison,Ground,Rock,Bug,Ghost,Steel,Fire,Water,Grass,Electric,Psychic,Ice,Dragon,Dark,Fairy|Damage Type|LIST|VALUE=STRING",
"Cat|Physical,Special|Damage Category|LIST|VALUE=STRING",
"DR|0|Damage Reduction",
"Resist|0|Additional Steps of Resistance")
2015-07-20 10:19:31,557 [client.MapToolLineParser:1301] DEBUG - abort(box)
2015-07-20 10:19:31,557 [client.MapToolLineParser:1301] DEBUG - PhysDef=getProperty("DefenceFinal",getSelected())
2015-07-20 10:19:31,567 [model.Token:1029] DEBUG - Evaluating property: 'DefenceFinal' for token Blinded(000000007C7B76A61F00000000000000)----------------------------------------------------------------------------------
2015-07-20 10:19:31,567 [client.MapToolLineParser:1301] DEBUG - SpecDef=getProperty("SpDefFinal",getSelected())
2015-07-20 10:19:31,567 [model.Token:1029] DEBUG - Evaluating property: 'SpDefFinal' for token Blinded(000000007C7B76A61F00000000000000)----------------------------------------------------------------------------------
2015-07-20 10:19:31,567 [client.MapToolLineParser:1301] DEBUG - Cat
2015-07-20 10:19:31,577 [client.MapToolLineParser:1301] DEBUG - Def=PhysDef
2015-07-20 10:19:31,577 [client.MapToolLineParser:1301] DEBUG - DRForm=if(DR==0,""," and by "+DR+" by Damage Reduction")
2015-07-20 10:19:31,587 [client.MapToolLineParser:1301] DEBUG - TypeProp1=Type+"1"
2015-07-20 10:19:31,587 [client.MapToolLineParser:1301] DEBUG - TypeProp2=Type+"2"
2015-07-20 10:19:31,587 [client.MapToolLineParser:1301] DEBUG - TypeProp3=Type+"3"
2015-07-20 10:19:31,587 [client.MapToolLineParser:1301] DEBUG - Typetest=Type+"test"
2015-07-20 10:19:31,587 [client.MapToolLineParser:1301] DEBUG - Typeout=Type+"out"
2015-07-20 10:19:31,597 [client.MapToolLineParser:1301] DEBUG - Type1=getProperty(TypeProp1,getSelected())
2015-07-20 10:19:31,597 [model.Token:1029] DEBUG - Evaluating property: 'Normal1' for token Blinded(000000007C7B76A61F00000000000000)----------------------------------------------------------------------------------
2015-07-20 10:19:31,597 [client.MapToolLineParser:1301] DEBUG - Type2=getProperty(TypeProp2,getSelected())
2015-07-20 10:19:31,597 [model.Token:1029] DEBUG - Evaluating property: 'Normal2' for token Blinded(000000007C7B76A61F00000000000000)----------------------------------------------------------------------------------
2015-07-20 10:19:31,597 [client.MapToolLineParser:1301] DEBUG - Type3=getProperty(TypeProp3,getSelected())
2015-07-20 10:19:31,597 [model.Token:1029] DEBUG - Evaluating property: 'Normal3' for token Blinded(000000007C7B76A61F00000000000000)----------------------------------------------------------------------------------
2015-07-20 10:19:31,597 [client.MapToolLineParser:1301] DEBUG - if(Type1 == "Imm" || Type2 == "Imm" || Type3 == "Imm", 1, 0)
2015-07-20 10:19:31,597 [client.MapToolLineParser:1301] DEBUG - Typetest=Type1+Type2+Type3-Resist
2015-07-20 10:19:31,597 [client.MapToolLineParser:1301] DEBUG - Typetest=if(Typetest<-3,-3,Typetest)
2015-07-20 10:19:31,607 [client.MapToolLineParser:1301] DEBUG - Typetest
2015-07-20 10:19:31,607 [client.MapToolLineParser:1301] DEBUG - Flash="<br><b><font color=#008ace>It's not very effective...</font></b>"
2015-07-20 10:19:31,607 [client.MapToolLineParser:1301] DEBUG - Typetest
2015-07-20 10:19:31,607 [client.MapToolLineParser:1301] DEBUG - Typeout=0.5
2015-07-20 10:19:31,607 [client.MapToolLineParser:1301] DEBUG - DamDef=DamBase-Def-DR
2015-07-20 10:19:31,607 [client.MapToolLineParser:1301] DEBUG - Dam=floor(DamDef*Typeout)
2015-07-20 10:19:31,607 [client.MapToolLineParser:1301] DEBUG - Dam=if(DamDef<1,1,Dam)
2015-07-20 10:19:31,607 [client.MapToolLineParser:1301] DEBUG - DamFixText=if(DamDef<1," and increased to 1 as it's impossible to take no damage","")
2015-07-20 10:19:31,617 [client.MapToolLineParser:1301] DEBUG - NewHP=HPCurr-Dam
2015-07-20 10:19:31,617 [client.MapToolLineParser:1301] DEBUG - HPPrint=NewHP+" / "+HPMax
2015-07-20 10:19:31,617 [client.MapToolLineParser:1301] DEBUG - HPPerc=NewHP/HPMax
2015-07-20 10:19:31,617 [client.MapToolLineParser:1301] DEBUG - MACRO("editHPBar@Lib:Handy"):HPPerc
2015-07-20 10:19:31,657 [client.MapToolLineParser:1316] DEBUG - net.rptools.parser.ParserException: line 1:29: unexpected char: ':'
2015-07-20 10:19:31,657 [client.MapToolLineParser:1264] INFO - [h:HPMax=getProperty("HitpointsInjured",getSelected())]
[h:HPCurr=getProperty("HitpointsCurrent",getSelected())]
[h:box=input("DamBase|0|Damage Taken",
"Type|Normal,Fighting,Flying,Poison,Ground,Rock,Bug,Ghost,Steel,Fire,Water,Grass,Electric,Psychic,Ice,Dragon,Dark,Fairy|Damage Type|LIST|VALUE=STRING",
"Cat|Physical,Special|Damage Category|LIST|VALUE=STRING",
"DR|0|Damage Reduction",
"Resist|0|Additional Steps of Resistance")]
[h:abort(box)]
[h:PhysDef=getProperty("DefenceFinal",getSelected())]
[h:SpecDef=getProperty("SpDefFinal",getSelected())]
[h,switch(Cat):
case "Physical": Def=PhysDef;
case "Special": Def=SpecDef;
default:Def=0]
[h:DRForm=if(DR==0,""," and by "+DR+" by Damage Reduction")]
[h:TypeProp1=Type+"1"]
[h:TypeProp2=Type+"2"]
[h:TypeProp3=Type+"3"]
[h:Typetest=Type+"test"]
[h:Typeout=Type+"out"]
[h:Type1=getProperty(TypeProp1,getSelected())]
[h:Type2=getProperty(TypeProp2,getSelected())]
[h:Type3=getProperty(TypeProp3,getSelected())]
[h,if(Type1 == "Imm" || Type2 == "Imm" || Type3 == "Imm"), code:
{
[Typetest="Imm"]
};
{
[Typetest=Type1+Type2+Type3-Resist]
}]
[h:Typetest=if(Typetest<-3,-3,Typetest)]
[h,switch(Typetest):
case "3": Flash="<br><b><font color=#ff8d00>It's Super Effective!</font></b>";
case "2": Flash="<br><b><font color=#ff8d00>It's Super Effective!</font></b>";
case "1": Flash="<br><b><font color=#ff8d00>It's Super Effective!</font></b>";
case "-1": Flash="<br><b><font color=#008ace>It's not very effective...</font></b>";
case "-2": Flash="<br><b><font color=#008ace>It's not very effective...</font></b>";
case "-3": Flash="<br><b><font color=#008ace>It's not very effective...</font></b>";
case "Imm": Flash="<br><b><font color=#8e00a9>But nothing happens...</font></b>";
default: Flash=""]
[h,switch(Typetest):
case "3": Typeout=3;
case "2": Typeout=2;
case "1": Typeout=1.5;
case "0": Typeout=1;
case "-1": Typeout=0.5;
case "-2": Typeout=0.25;
case "-3": Typeout=0.125;
case "Imm": Typeout=0;
default: Typeout=1]
[h:DamDef=DamBase-Def-DR]
[h:Dam=floor(DamDef*Typeout)]
[h:Dam=if(DamDef<1,1,Dam)]
[h:DamFixText=if(DamDef<1," and increased to 1 as it's impossible to take no damage","")]
[h:NewHP=HPCurr-Dam]
[h:HPPrint=NewHP+" / "+HPMax]
[h:HPPerc=NewHP/HPMax]
[h:MACRO("editHPBar@Lib:Handy"):HPPerc]
[h:setProperty("HPOUT",HPPrint,getSelected())]
[h:setProperty("HitPointsCurrent",NewHP,getSelected())]
[r:getProperty("Name",getSelected())] takes [r:DamBase] [r:Type] [r:Cat] damage![r:Flash][s:"<br>"+DamBase+" "+Type+" "+Cat+" damage, reduced by "+Def+" by "+Cat+" Defence"+DRForm+" to "+DamDef+", multiplied by "+Typeout+" for type effectiveness"+DamFixText+" for a total of "+Dam+" hitpoints lost, dropping from "+HPCurr+" to "+NewHP+" hitpoints."]
net.rptools.parser.ParserException: line 1:29: unexpected char: ':'
at net.rptools.parser.Parser.parseExpression(Parser.java:257)
at net.rptools.common.expression.ExpressionParser.evaluate(ExpressionParser.java:178)
at net.rptools.maptool.client.MapToolLineParser.parseExpression(MapToolLineParser.java:1303)
at net.rptools.maptool.client.MapToolLineParser.parseLine(MapToolLineParser.java:1155)
at net.rptools.maptool.client.MapToolLineParser.parseLine(MapToolLineParser.java:630)
at net.rptools.maptool.client.macro.MacroManager.executeMacro(MacroManager.java:214)
at net.rptools.maptool.client.ui.commandpanel.CommandPanel.commitCommand(CommandPanel.java:495)
at net.rptools.maptool.model.MacroButtonProperties.executeCommand(MacroButtonProperties.java:420)
at net.rptools.maptool.model.MacroButtonProperties.executeMacro(MacroButtonProperties.java:309)
at net.rptools.maptool.client.ui.macrobuttons.buttons.MacroButton.mouseReleased(MacroButton.java:195)
at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at net.rptools.maptool.client.swing.MapToolEventQueue.dispatchEvent(MapToolEventQueue.java:36)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: line 1:29: unexpected char: ':'
at net.rptools.parser.ExpressionLexer.nextToken(ExpressionLexer.java:212)
at antlr.TokenBuffer.fill(TokenBuffer.java:69)
at antlr.TokenBuffer.LA(TokenBuffer.java:80)
at antlr.LLkParser.LA(LLkParser.java:52)
at net.rptools.parser.ExpressionParser.powerExpression(ExpressionParser.java:609)
at net.rptools.parser.ExpressionParser.multiplicitiveExpression(ExpressionParser.java:537)
at net.rptools.parser.ExpressionParser.additiveExpression(ExpressionParser.java:468)
at net.rptools.parser.ExpressionParser.notExpression(ExpressionParser.java:441)
at net.rptools.parser.ExpressionParser.compareExpression(ExpressionParser.java:312)
at net.rptools.parser.ExpressionParser.andExpression(ExpressionParser.java:258)
at net.rptools.parser.ExpressionParser.orExpression(ExpressionParser.java:214)
at net.rptools.parser.ExpressionParser.expr(ExpressionParser.java:150)
at net.rptools.parser.ExpressionParser.expression(ExpressionParser.java:118)
at net.rptools.parser.Parser.parseExpression(Parser.java:249)
... 43 more
Re: Can't seem to get the macro() roll option to work
derp!
But as a side note, you don't need to put [H:] before macro if you have no output in the macro.
Now there could be other errors, but this is the one stopping the show.
Looking at the log.txt file, you can see the lines labeled with DEBUG. Those are the line of code that are run by the parser and you can see the last one is the macro call followed by the error. Although, with the other debugging info it may be hard to see at first.
Code: Select all
[h:MACRO("editHPBar@Lib:Handy"):HPPerc]
Sorry, I should have seen this, but in my defense I almost never use [macro:]. macro is a roll option and all the roll options need to be separated by a comma (,). You used h: before when it should beunexpected char: ':'
Code: Select all
[h,MACRO("editHPBar@Lib:Handy"):HPPerc]
Now there could be other errors, but this is the one stopping the show.
Looking at the log.txt file, you can see the lines labeled with DEBUG. Those are the line of code that are run by the parser and you can see the last one is the macro call followed by the error. Although, with the other debugging info it may be hard to see at first.
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
Re: Can't seem to get the macro() roll option to work
Okay, I fixed that, and now it's complaining about impersonated tokens and initiative functions (even though my code has nothing to do with the initiative). I assume this refers to whatever you were talking about earlier with regards to impersonation, but I haven't found anything in the wiki about impersonated tokens?
If it helps, the new log after fixing that:
If it helps, the new log after fixing that:
Spoiler
Code: Select all
2015-07-20 11:17:51,980 [client.AppState:158] DEBUG - AppState.isSaving is false
2015-07-20 11:17:52,046 [io.PackedFile:590] DEBUG - FileUtil.getContentType() returned application/xml
2015-07-20 11:17:52,050 [io.PackedFile:590] DEBUG - FileUtil.getContentType() returned application/xml
2015-07-20 11:17:53,102 [model.Token:1029] DEBUG - Evaluating property: 'HPOUT' for token Blinded(000000007C7B76A61F00000000000000)----------------------------------------------------------------------------------
2015-07-20 11:17:53,108 [model.Token:1029] DEBUG - Evaluating property: 'HPOUT' for token Blinded(000000007C7B76A61F00000000000000)----------------------------------------------------------------------------------
2015-07-20 11:17:53,111 [model.Token:1029] DEBUG - Evaluating property: 'Injuries' for token Blinded(000000007C7B76A61F00000000000000)----------------------------------------------------------------------------------
2015-07-20 11:17:53,112 [model.Token:1029] DEBUG - Evaluating property: 'Injuries' for token Blinded(000000007C7B76A61F00000000000000)----------------------------------------------------------------------------------
2015-07-20 11:17:54,144 [client.MapToolLineParser:1301] DEBUG - HPMax=getProperty("HitpointsInjured",getSelected())
2015-07-20 11:17:54,305 [model.Token:1029] DEBUG - Evaluating property: 'HitpointsInjured' for token Blinded(000000007C7B76A61F00000000000000)----------------------------------------------------------------------------------
2015-07-20 11:17:54,307 [client.MapToolLineParser:1301] DEBUG - floor(HitpointsMax*(1-0.1*Injuries)))
2015-07-20 11:17:54,313 [model.Token:1029] DEBUG - Evaluating property: 'HitpointsMax' for token Blinded(000000007C7B76A61F00000000000000)----------------------------------------------------------------------------------
2015-07-20 11:17:54,315 [model.Token:1029] DEBUG - Evaluating property: 'Injuries' for token Blinded(000000007C7B76A61F00000000000000)----------------------------------------------------------------------------------
2015-07-20 11:17:54,317 [client.MapToolLineParser:1301] DEBUG - HPCurr=getProperty("HitpointsCurrent",getSelected())
2015-07-20 11:17:54,322 [model.Token:1029] DEBUG - Evaluating property: 'HitpointsCurrent' for token Blinded(000000007C7B76A61F00000000000000)----------------------------------------------------------------------------------
2015-07-20 11:17:54,323 [client.MapToolLineParser:1301] DEBUG - box=input("DamBase|0|Damage Taken",
"Type|Normal,Fighting,Flying,Poison,Ground,Rock,Bug,Ghost,Steel,Fire,Water,Grass,Electric,Psychic,Ice,Dragon,Dark,Fairy|Damage Type|LIST|VALUE=STRING",
"Cat|Physical,Special|Damage Category|LIST|VALUE=STRING",
"DR|0|Damage Reduction",
"Resist|0|Additional Steps of Resistance")
2015-07-20 11:17:55,295 [client.MapToolLineParser:1301] DEBUG - abort(box)
2015-07-20 11:17:55,300 [client.MapToolLineParser:1301] DEBUG - PhysDef=getProperty("DefenceFinal",getSelected())
2015-07-20 11:17:55,303 [model.Token:1029] DEBUG - Evaluating property: 'DefenceFinal' for token Blinded(000000007C7B76A61F00000000000000)----------------------------------------------------------------------------------
2015-07-20 11:17:55,305 [client.MapToolLineParser:1301] DEBUG - SpecDef=getProperty("SpDefFinal",getSelected())
2015-07-20 11:17:55,308 [model.Token:1029] DEBUG - Evaluating property: 'SpDefFinal' for token Blinded(000000007C7B76A61F00000000000000)----------------------------------------------------------------------------------
2015-07-20 11:17:55,311 [client.MapToolLineParser:1301] DEBUG - Cat
2015-07-20 11:17:55,315 [client.MapToolLineParser:1301] DEBUG - Def=PhysDef
2015-07-20 11:17:55,317 [client.MapToolLineParser:1301] DEBUG - DRForm=if(DR==0,""," and by "+DR+" by Damage Reduction")
2015-07-20 11:17:55,320 [client.MapToolLineParser:1301] DEBUG - TypeProp1=Type+"1"
2015-07-20 11:17:55,322 [client.MapToolLineParser:1301] DEBUG - TypeProp2=Type+"2"
2015-07-20 11:17:55,325 [client.MapToolLineParser:1301] DEBUG - TypeProp3=Type+"3"
2015-07-20 11:17:55,327 [client.MapToolLineParser:1301] DEBUG - Typetest=Type+"test"
2015-07-20 11:17:55,360 [client.MapToolLineParser:1301] DEBUG - Typeout=Type+"out"
2015-07-20 11:17:55,362 [client.MapToolLineParser:1301] DEBUG - Type1=getProperty(TypeProp1,getSelected())
2015-07-20 11:17:55,364 [model.Token:1029] DEBUG - Evaluating property: 'Normal1' for token Blinded(000000007C7B76A61F00000000000000)----------------------------------------------------------------------------------
2015-07-20 11:17:55,365 [client.MapToolLineParser:1301] DEBUG - Type2=getProperty(TypeProp2,getSelected())
2015-07-20 11:17:55,366 [model.Token:1029] DEBUG - Evaluating property: 'Normal2' for token Blinded(000000007C7B76A61F00000000000000)----------------------------------------------------------------------------------
2015-07-20 11:17:55,367 [client.MapToolLineParser:1301] DEBUG - Type3=getProperty(TypeProp3,getSelected())
2015-07-20 11:17:55,369 [model.Token:1029] DEBUG - Evaluating property: 'Normal3' for token Blinded(000000007C7B76A61F00000000000000)----------------------------------------------------------------------------------
2015-07-20 11:17:55,370 [client.MapToolLineParser:1301] DEBUG - if(Type1 == "Imm" || Type2 == "Imm" || Type3 == "Imm", 1, 0)
2015-07-20 11:17:55,373 [client.MapToolLineParser:1301] DEBUG - Typetest=Type1+Type2+Type3-Resist
2015-07-20 11:17:55,375 [client.MapToolLineParser:1301] DEBUG - Typetest=if(Typetest<-3,-3,Typetest)
2015-07-20 11:17:55,377 [client.MapToolLineParser:1301] DEBUG - Typetest
2015-07-20 11:17:55,379 [client.MapToolLineParser:1301] DEBUG - Flash="<br><b><font color=#008ace>It's not very effective...</font></b>"
2015-07-20 11:17:55,380 [client.MapToolLineParser:1301] DEBUG - Typetest
2015-07-20 11:17:55,382 [client.MapToolLineParser:1301] DEBUG - Typeout=0.5
2015-07-20 11:17:55,383 [client.MapToolLineParser:1301] DEBUG - DamDef=DamBase-Def-DR
2015-07-20 11:17:55,385 [client.MapToolLineParser:1301] DEBUG - Dam=floor(DamDef*Typeout)
2015-07-20 11:17:55,386 [client.MapToolLineParser:1301] DEBUG - Dam=if(DamDef<1,1,Dam)
2015-07-20 11:17:55,388 [client.MapToolLineParser:1301] DEBUG - DamFixText=if(DamDef<1," and increased to 1 as it's impossible to take no damage","")
2015-07-20 11:17:55,390 [client.MapToolLineParser:1301] DEBUG - NewHP=HPCurr-Dam
2015-07-20 11:17:55,391 [client.MapToolLineParser:1301] DEBUG - HPPrint=NewHP+" / "+HPMax
2015-07-20 11:17:55,393 [client.MapToolLineParser:1301] DEBUG - HPPerc=NewHP/HPMax
2015-07-20 11:17:55,395 [client.MapToolLineParser:1301] DEBUG - "editHPBar@Lib:Handy"
2015-07-20 11:17:55,396 [client.MapToolLineParser:1301] DEBUG - HPPerc
2015-07-20 11:17:55,398 [client.MapToolLineParser:1301] DEBUG - setBar("Health",macro.args)
2015-07-20 11:17:55,399 [client.MapToolLineParser:1316] DEBUG - net.rptools.parser.ParserException: Error executing initiative function: there is no impersonated token.
2015-07-20 11:17:55,400 [client.MapToolLineParser:1264] INFO - [h:setBar("Health",macro.args)]
[h:setBarVisible("Health",1)]
net.rptools.parser.ParserException: Error executing initiative function: there is no impersonated token.
at net.rptools.maptool.client.functions.AbstractTokenAccessorFunction.getTarget(AbstractTokenAccessorFunction.java:87)
at net.rptools.maptool.client.functions.TokenBarFunction.childEvaluate(TokenBarFunction.java:45)
at net.rptools.parser.function.AbstractFunction.evaluate(AbstractFunction.java:50)
at net.rptools.parser.EvaluationTreeParser.evaluate(EvaluationTreeParser.java:115)
at net.rptools.parser.Expression.evaluate(Expression.java:55)
at net.rptools.common.expression.ExpressionParser.evaluate(ExpressionParser.java:181)
at net.rptools.maptool.client.MapToolLineParser.parseExpression(MapToolLineParser.java:1303)
at net.rptools.maptool.client.MapToolLineParser.parseLine(MapToolLineParser.java:1155)
at net.rptools.maptool.client.MapToolLineParser.runMacroBlock(MapToolLineParser.java:1521)
at net.rptools.maptool.client.MapToolLineParser.runMacro(MapToolLineParser.java:1460)
at net.rptools.maptool.client.MapToolLineParser.runMacro(MapToolLineParser.java:1355)
at net.rptools.maptool.client.MapToolLineParser.parseLine(MapToolLineParser.java:1211)
at net.rptools.maptool.client.MapToolLineParser.parseLine(MapToolLineParser.java:630)
at net.rptools.maptool.client.macro.MacroManager.executeMacro(MacroManager.java:214)
at net.rptools.maptool.client.ui.commandpanel.CommandPanel.commitCommand(CommandPanel.java:495)
at net.rptools.maptool.model.MacroButtonProperties.executeCommand(MacroButtonProperties.java:420)
at net.rptools.maptool.model.MacroButtonProperties.executeMacro(MacroButtonProperties.java:309)
at net.rptools.maptool.client.ui.macrobuttons.buttons.MacroButton.mouseReleased(MacroButton.java:195)
at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at net.rptools.maptool.client.swing.MapToolEventQueue.dispatchEvent(MapToolEventQueue.java:36)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
2015-07-20 11:17:55,402 [client.MapToolLineParser:1264] INFO - [h:HPMax=getProperty("HitpointsInjured",getSelected())]
[h:HPCurr=getProperty("HitpointsCurrent",getSelected())]
[h:box=input("DamBase|0|Damage Taken",
"Type|Normal,Fighting,Flying,Poison,Ground,Rock,Bug,Ghost,Steel,Fire,Water,Grass,Electric,Psychic,Ice,Dragon,Dark,Fairy|Damage Type|LIST|VALUE=STRING",
"Cat|Physical,Special|Damage Category|LIST|VALUE=STRING",
"DR|0|Damage Reduction",
"Resist|0|Additional Steps of Resistance")]
[h:abort(box)]
[h:PhysDef=getProperty("DefenceFinal",getSelected())]
[h:SpecDef=getProperty("SpDefFinal",getSelected())]
[h,switch(Cat):
case "Physical": Def=PhysDef;
case "Special": Def=SpecDef;
default:Def=0]
[h:DRForm=if(DR==0,""," and by "+DR+" by Damage Reduction")]
[h:TypeProp1=Type+"1"]
[h:TypeProp2=Type+"2"]
[h:TypeProp3=Type+"3"]
[h:Typetest=Type+"test"]
[h:Typeout=Type+"out"]
[h:Type1=getProperty(TypeProp1,getSelected())]
[h:Type2=getProperty(TypeProp2,getSelected())]
[h:Type3=getProperty(TypeProp3,getSelected())]
[h,if(Type1 == "Imm" || Type2 == "Imm" || Type3 == "Imm"), code:
{
[Typetest="Imm"]
};
{
[Typetest=Type1+Type2+Type3-Resist]
}]
[h:Typetest=if(Typetest<-3,-3,Typetest)]
[h,switch(Typetest):
case "3": Flash="<br><b><font color=#ff8d00>It's Super Effective!</font></b>";
case "2": Flash="<br><b><font color=#ff8d00>It's Super Effective!</font></b>";
case "1": Flash="<br><b><font color=#ff8d00>It's Super Effective!</font></b>";
case "-1": Flash="<br><b><font color=#008ace>It's not very effective...</font></b>";
case "-2": Flash="<br><b><font color=#008ace>It's not very effective...</font></b>";
case "-3": Flash="<br><b><font color=#008ace>It's not very effective...</font></b>";
case "Imm": Flash="<br><b><font color=#8e00a9>But nothing happens...</font></b>";
default: Flash=""]
[h,switch(Typetest):
case "3": Typeout=3;
case "2": Typeout=2;
case "1": Typeout=1.5;
case "0": Typeout=1;
case "-1": Typeout=0.5;
case "-2": Typeout=0.25;
case "-3": Typeout=0.125;
case "Imm": Typeout=0;
default: Typeout=1]
[h:DamDef=DamBase-Def-DR]
[h:Dam=floor(DamDef*Typeout)]
[h:Dam=if(DamDef<1,1,Dam)]
[h:DamFixText=if(DamDef<1," and increased to 1 as it's impossible to take no damage","")]
[h:NewHP=HPCurr-Dam]
[h:HPPrint=NewHP+" / "+HPMax]
[h:HPPerc=NewHP/HPMax]
[MACRO("editHPBar@Lib:Handy"):HPPerc]
[h:setProperty("HPOUT",HPPrint,getSelected())]
[h:setProperty("HitPointsCurrent",NewHP,getSelected())]
[r:getProperty("Name",getSelected())] takes [r:DamBase] [r:Type] [r:Cat] damage![r:Flash][s:"<br>"+DamBase+" "+Type+" "+Cat+" damage, reduced by "+Def+" by "+Cat+" Defence"+DRForm+" to "+DamDef+", multiplied by "+Typeout+" for type effectiveness"+DamFixText+" for a total of "+Dam+" hitpoints lost, dropping from "+HPCurr+" to "+NewHP+" hitpoints."]
net.rptools.parser.ParserException: <br> Error in body of roll.<br> <u>Statement options (if any)</u>: h<br> <u>Statement Body </u>: setBar("Health",macro.args)
at net.rptools.maptool.client.MapToolLineParser.doError(MapToolLineParser.java:1654)
at net.rptools.maptool.client.MapToolLineParser.parseLine(MapToolLineParser.java:1265)
at net.rptools.maptool.client.MapToolLineParser.runMacroBlock(MapToolLineParser.java:1521)
at net.rptools.maptool.client.MapToolLineParser.runMacro(MapToolLineParser.java:1460)
at net.rptools.maptool.client.MapToolLineParser.runMacro(MapToolLineParser.java:1355)
at net.rptools.maptool.client.MapToolLineParser.parseLine(MapToolLineParser.java:1211)
at net.rptools.maptool.client.MapToolLineParser.parseLine(MapToolLineParser.java:630)
at net.rptools.maptool.client.macro.MacroManager.executeMacro(MacroManager.java:214)
at net.rptools.maptool.client.ui.commandpanel.CommandPanel.commitCommand(CommandPanel.java:495)
at net.rptools.maptool.model.MacroButtonProperties.executeCommand(MacroButtonProperties.java:420)
at net.rptools.maptool.model.MacroButtonProperties.executeMacro(MacroButtonProperties.java:309)
at net.rptools.maptool.client.ui.macrobuttons.buttons.MacroButton.mouseReleased(MacroButton.java:195)
at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at net.rptools.maptool.client.swing.MapToolEventQueue.dispatchEvent(MapToolEventQueue.java:36)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Re: Can't seem to get the macro() roll option to work
Make sure the macro button you click on has the Apply to Selected Tokens checked. BTW, where is your calling macro? Do you have it in the campaign window or on a token?
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
Re: Can't seem to get the macro() roll option to work
@ILyarden: in case you've missed this, pls read the 'READ THIS' link in my sig.unexpected char: ':'
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS