Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

What am i doing wrong?

This one is not working: !me &{template:default}{{name=Traps }}{{[Bear Trap](#trapbear) }} and then this one is exactly the same thing but it works! !me &{template:default}{{name=Conditions }}{{ Dungeon Master = [Advantage](#Condition-Advantage ) [Disadvantage](#Condition-Disadvantage ) [Inspired](#Condition-Inspired ) }}
1645126056
GiGs
Pro
Sheet Author
API Scripter
You are calling macros, and the problem is, a roll20 macro importas the entire text of each macro mentioned before running. There are a bunch of things that break queries, like having a comma or } inside them, so if any of your linked macros contain such characetrs the query will break and not run. So look at the text of your trapbear macro - it contains something that is breaking your macro.
1645126153

Edited 1645126297
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
NVM, see next post. Try this: !me &{template:default}{{name=Conditions }}{{ Dungeon Master = [Advantage](#Condition-Advantage) [Disadvantage](#Condition-Disadvantage) [Inspired](#Condition-Inspired) }} You had spaces after your macro names. Also, if it still doesn't work, it might be necessaryt o see the macros. You might be dealing with HTML replacement issues in the called macros..
1645126260
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Ah, I read more carefully. The first one has the problem of there being no label: !me &{template:default}{{name=Traps }}{{Bear Trap=[Bear Trap](#trapbear) }} Or even  !me &{template:default}{{name=Traps }}{{=[Bear Trap](#trapbear)}}
1645126816
GiGs
Pro
Sheet Author
API Scripter
I didnt notice they were api buttons. Well spotted, Keith. Now the !me at the start has me confused - is that a well-known script?
i use it in this case instead of /w GiGs said: I didnt notice they were api buttons. Well spotted, Keith. Now the !me at the start has me confused - is that a well-known script? Thank you all, I'll give it a try. you are absolut legends, helping out people! 
Still got the same isseu! /w gm &{template:default} {{name= Bear Trap}} {{Effect = [[1d20+8]] to hit}} {{ Hit:=[[1d10]] piercing damage.}} {{=This attack can't gain advantage or disadvantage. A creature hit by the trap has its speed reduced to 0. It can't move until it breaks free of the trap, which requires a successful **DC15 Strength** check by the creature or another creature adjacent to the trap.}} The macro should have called works fine but doesn't call keithcurtis said: Ah, I read more carefully. The first one has the problem of there being no label: !me &{template:default}{{name=Traps }}{{Bear Trap=[Bear Trap](#trapbear) }} Or even  !me &{template:default}{{name=Traps }}{{=[Bear Trap](#trapbear)}}
1645128177

Edited 1645128236
Kraynic
Pro
Sheet Author
Dario M. said: Still got the same isseu! /w gm &{template:default} {{name= Bear Trap}} {{Effect = [[1d20+8]] to hit}} {{ Hit:=[[1d10]] piercing damage.}} {{=This attack can't gain advantage or disadvantage. A creature hit by the trap has its speed reduced to 0. It can't move until it breaks free of the trap, which requires a successful **DC15 Strength** check by the creature or another creature adjacent to the trap.}} In the screenshot, your macro with the button doesn't have the = before the button that keithcurtis suggested.  Are you sure you tried that to move the button from the label side (which has bold applied by the roll template and may interfere with the button) to the result/roll side that doesn't have built in format? Edit: To be clear, I am talking about the one labeled traps in the screenshot.
this complicated thing i wrote is working fine! !me &{template:default}{{name=Conditions }}{{ Dungeon Master = [Advantage](#Condition-Advantage ) [Disadvantage](#Condition-Disadvantage ) [Inspired](#Condition-Inspired ) }}{{ Activated = [Raging](#Condition-Raging ) [Reaction Used](#Condition-ReactionUsed ) [Stabilized](#Condition-Stabilized ) [Baned](#Condition-Baned ) [Flying](#Condition-Flying ) [Blessed](#Condition-Blessed ) [Blink](#Condition-Blink ) [Blur](#Condition-Blur ) [Hasted](#Condition-Hasted ) [Hex](#Condition-Hex ) [Hexblade](#Condition-HexbladesCurse ) [Invisible](#Condition-Invisible ) [Mage Armor](#Condition-MageArmor ) [Mark](#Condition-Mark ) }}{{ Passive = [Concentrating](#Condition-Concentration ) [Holding Action](#Condition-HoldingAction ) [Bleeding](#Condition-Bleeding ) [Blinded](#Condition-Blinded ) [Charmed](#Condition-Charmed ) [Confused](#Condition-Confused ) [Deafened](#Condition-Deafened ) [Exhausted](#Condition-Exhausted ) [Frightened](#Condition-Frightened ) [Incapacitated](#Condition-Incapacitated ) [Grappled](#Condition-Grappled ) [On Fire](#Condition-OnFire ) [Paralyzed](#Condition-Paralyzed ) [Petrified](#Condition-Petrified ) [Poisoned](#Condition-Poisoned ) [Possessed](#Condition-Possessed ) [Prone](#Condition-Prone ) [Restrained](#Condition-Restrained ) [Stunned](#Condition-Stunned ) [Unconscious](#Condition-Unconscious ) }} But this simple thing just doesn't work! &{template:default}{{name=Traps}}{{[Bear Trap](#trap-bear)}} and now, the scrip that Mr  keithcurtis  wrote is doing this: I have been cursed! I need a priest, not tech advice! 
1645131320

Edited 1645131454
I can see the biggest culprit is if that bear trap is meant to be an apichat button it needs to have a bunch of html escapes.&nbsp; When calling a macro you need to have an escape in for the line break and the hashtag.&nbsp; And everything in beartrap needs to follow the rules for apichat html replacements in the APICHAT wiki link.&nbsp;&nbsp; <a href="https://wiki.roll20.net/API:Chat" rel="nofollow">https://wiki.roll20.net/API:Chat</a> Scroll all the way down on the links page. I misspoke, the hashtag doesn't need to be replaced but everything within "trapbear" needs to be replaced that follows apichat buttons protocols.&nbsp;&nbsp;
1645131504
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Not sure why you are using the old code on that. Delete TokenActionMaker.js and install from the One Click. From the screen shot I can't even tell what version that is. The One Click version should run without error, so long as you are using either the&nbsp;D&amp;D 5th Edition by Roll20 Sheet or the Pathfinder 2 sheet.
1645132439

Edited 1645132479
oooh I see, it was working just fine until a moment ago when i turned off every script just to see if it was something there. thank you so much, this script is a life saver!&nbsp; keithcurtis said: Not sure why you are using the old code on that. Delete TokenActionMaker.js and install from the One Click. From the screen shot I can't even tell what version that is. The One Click version should run without error, so long as you are using either the&nbsp;D&amp;D 5th Edition by Roll20 Sheet or the Pathfinder 2 sheet.
1645132832

Edited 1645132997
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
As for your macro. Sorry, I still wasn't looking carefully enough. This works (just tested): /w gm &amp;{template:default}{{name=Traps }}{{test=[Bear Trap](!&amp;#13;#trapbear)}} From the&nbsp; Chat Menu &nbsp;entry in the wiki: Global Macro If your macro is a loose, global&nbsp; Macro &nbsp;saved in the&nbsp; l &nbsp; Collections -tab , the code is a little more arcane, since you need to use&nbsp; HTML replacements . Normally calling the macro would be&nbsp; #macro-name , but this is the button: [command name](!&amp;#13;#macro-name) Button syntax to reference a Macro in the collections tab. Try to use only in Abilities, not Macros, since Macros will revert the&nbsp; HTML replacement &nbsp;if you need to edit. The reason for this is that type of button is actually called an API Command Button. You do not need the API to use an API command button, but the macro syntax expects it. When you send&nbsp; [Bear Trap](!&amp;#13;#trapbear) &nbsp;the macro syntax says "what the heck is this? It doesn't start with an exclamation point! I'm going to ignore it!" So you fool it. You use an exclamation point to make the parser think an API command is coming. It will therefore send the rest to chat. but&nbsp; !#trapbear &nbsp;doesn't mean anything to Roll20, so you insert the HTML for a return (&amp;#13;) in between the ! and the macro code. So what the parser sees is two lines: ! //gets passed without an argument and disappears into infinity #trapbear //is seen by the parser as if you had typed it In other words, the exclamation point makes the button work, and the return code puts the rest on its own line. If #trapbear is a simple die roll, then you are done. This is not a drop down query, so anything you call should not need html replacements in this case. However... If you reopen this after closing it: [command name](!&amp;#13;#macro-name) You will see it has changed to this: [command name](! #macro-name) This is because the trick you used to get the button to run is parsed when you save the macro. It will work until you re-open it, which is why you should keep pristine copies of this sort of macro in a text file somewhere if it is very complex. You can sidestep this entire issue of HTM replacements by not using macros, but instead write them as Abilities on a&nbsp; Macro Character Sheet . The syntax is much simpler, it requires no HTML replacements, and is portable with the Transmogrifier or Character Vault from game to game. Here are the two links I referenced, again. If you read through them, it should give you a much better understanding of how to accomplish your goals: Chat Menu Macro Character Sheet
Thank you everyone for your help! Decided just in a simpler method, wasting to much time in this instead of the actual game prep! /w GM &amp;{template:default} {{name=Traps}} {{?{Traps|1-4, Tier 1-4 trap DC8=[[1d20+5]] to hit-[[1d10]] damage| 5-10, Tier 5-10 trap DC10=[[1d20+8]] to hit-[[2d10]] damage| 11-16, Tier 11-16 trap DC12=[[1d20+11]] to hit-[[4d10]] damage| 17-20, Tier 17-20 trap DC14=[[1d20+14]] to hit-[[10d10]] damage}}}
1645133057
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I know you got it working (Huzzah!) But when you do have time, that post just above will explain a lot about the syntax and how to make things easier on yourself.
it's working! thank you a lot! keithcurtis said: I know you got it working (Huzzah!) But when you do have time, that post just above will explain a lot about the syntax and how to make things easier on yourself.
1645133806
Kraynic
Pro
Sheet Author
I would encourage you to consider keith's mention of the macro character sheet.&nbsp; If you go that route, the buttons look a little different: [Button Display Text](~character sheet name|ability macro name) The great thing about saving macros on a sheet and making buttons that way is that you don't need html substitutions at all.
you are right! working on that actually! Kraynic said: I would encourage you to consider keith's mention of the macro character sheet.&nbsp; If you go that route, the buttons look a little different: [Button Display Text](~character sheet name|ability macro name) The great thing about saving macros on a sheet and making buttons that way is that you don't need html substitutions at all.
Working perfectly now! keithcurtis said: Not sure why you are using the old code on that. Delete TokenActionMaker.js and install from the One Click. From the screen shot I can't even tell what version that is. The One Click version should run without error, so long as you are using either the&nbsp;D&amp;D 5th Edition by Roll20 Sheet or the Pathfinder 2 sheet.
1645138062
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Kraynic said: I would encourage you to consider keith's mention of the macro character sheet.&nbsp; If you go that route, the buttons look a little different: [Button Display Text](~character sheet name|ability macro name) The great thing about saving macros on a sheet and making buttons that way is that you don't need html substitutions at all. It gets even simpler if the calling macro and the called macro are abilities on the same sheet: [Button Display Text](~ability macro name)
I find Its a trap to be great for storing and displaying trap data.&nbsp; I don 't even use it for its literal purpose half the time and just use it to bank a hundred trap tokens on my Dm storage page and then they are saved forever to be yoinked over to each session with transmog on the DM storage page.&nbsp;&nbsp;