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

Clickable Macro isn't..

I wanted players to have on call to the chat bar a wrapper macro with several clickable macros inside.    Yes, that pink box would be an example of one such clickable macro.  This is the script,  [D100] ( !&#13 #; d100 ) .  I thought to have about four of these in the default template wrapper, for players to click through, one at a time.  The challenge being I can't get the script to work.  I get the cute pink box-  click it, and nothing happens!
Macro 1:       Name: D100     Macro:  &{template:default} {{name=D100 Roll}} {{Results=[[1d100]]}} Chat Macro: [D100](`#D100)
It's possible the macro got "un-assigned". Re-assign the macro in the dialog, exit design mode and click the button - it should "just work".
1670853872

Edited 1670878544
timmaugh
Forum Champion
API Scripter
Hey, Mike, you just have a couple of keystrokes out of order. The component parts you need are: !       ==> bang 
    ==> html line return #d100    ==> command to execute Then you put it all together: [d100](!
#d100) Kilter... The tick usage is for buttons in handouts. That construction won't work from chat.
timmaugh said: Kilter... The tick usage is for buttons in handouts. That construction won't work from chat. Point of clarification. The backtick usage does work in chat as a clickable link; however it frequently doesn't get styled so it looks as if it's not doing anything.
1670878195
timmaugh
Forum Champion
API Scripter
Oh? I thought I tested that  before I posted... *goes to test* Look at that. Learn something new all the time. Thanks Rainbow!
Thanks everyone!  Tim I literally cut and paste your code line starting [D100] into a blank Macro and tested it.  I got back a response in the chat bar, notably  TypeError: Cannot read properties of undefined (reading 'models')
1671108339

Edited 1671108482
I'm having the same problem. Yesterday when I went to play my own system using macros I found that all my macros that use API buttons stopped working. An macro example: &{template:default} {{name= Revolver}} {{ATTACK= [[@{AGI}d20kh1+@{Aim}]]}} {{DAMAGE= [Ballistic](!
#DMG)}} the #DMG macro is: &{template:default} {{name= Revolver Damage}} {{DAMAGE= [[2d6]] Ballistic}} but whenever I try to use the API button, I get the error: TypeError: Cannot read properties of undefined (reading 'models') And when I check the last command sent in CHAT (by pressing the up arrow to review the texts sent ) instead of appearing the #DMG macro, it shows as if I had typed: ! &{template:default} {{name=Revolver Damage}} {{DMG = Rolling 2d6 = (5+6)'>11 Ballistic}} (That is, the Button API is trying to type the "!" in the chat before the #DMG macro, and this is causing the error). I've been using these macros for months and they always worked, I didn't change anything in them and they just stopped working.
1671109748
timmaugh
Forum Champion
API Scripter
Mike D & Vinicius... that is an error on the backside of Roll20, and maybe just a temporary one because the line I gave to Mike worked for me again when I got back to my game to test. Try it again... there might have been just some fluke problem going on. Also, Vinicius - that is how macro chat buttons work. When you put the "!
" at the start of your macro, you are basically telling the chat to send a bangsy message through (starting with the '!'), then give you a new line (
) and the rest of your command. This separates your macro from being sent to the script moderator, but it allows your message to hit the chat panel.
timmaugh said: Mike D & Vinicius... that is an error on the backside of Roll20, and maybe just a temporary one because the line I gave to Mike worked for me again when I got back to my game to test. Try it again... there might have been just some fluke problem going on. Also, Vinicius - that is how macro chat buttons work. When you put the "!
" at the start of your macro, you are basically telling the chat to send a bangsy message through (starting with the '!'), then give you a new line (
) and the rest of your command. This separates your macro from being sent to the script moderator, but it allows your message to hit the chat panel. Maybe the problem is because the command "!" it is a PRO command. I know the API buttons don't have user requirements but when i use the command it is not read, I can only imagine that it's because I'm not a PRO user. It's probably a bug that will be fixed later on, all we can do is wait...
1671121120
Kraynic
Pro
Sheet Author
Something you might try is to not put any of your "sub macros" in the macros collection.&nbsp; Make a macro mule sheet (or multiples for categorized macro storage) and run them from there.&nbsp; If you set up that way, then no html replacements are needed.&nbsp; Example:&nbsp; Let's say you make a "character" named Combat Macros, and you create your DMG macro on the Attributes &amp; Abilities tab as an ability.&nbsp; Your api button would then change to this: [Ballistic](~Combat Macros|DMG) No html replacements necessary, no !, just plain macro text.&nbsp; I'm not sure how many macros and buttons you would have to change, but it might be worth the effort if it avoids the problem you are currently having. The only thing you need to be sure to do is allow all players to have edit permissions to any macro mule characters you make.&nbsp; They don't need to be able to view them (which keeps players from being able to edit any of the stored ability macros), but they have to have edit permissions for the button macro call to work. For more info on that style of setup, check out the wiki article and forum posts on it: <a href="https://wiki.roll20.net/Chat_Menu#Roll_Button.2FCharacter_Ability" rel="nofollow">https://wiki.roll20.net/Chat_Menu#Roll_Button.2FCharacter_Ability</a> <a href="https://app.roll20.net/forum/post/5899495/roll20-tips-and-tricks-innovative-solutions-to-common-problems/?pageforid=7605679#post-7605679" rel="nofollow">https://app.roll20.net/forum/post/5899495/roll20-tips-and-tricks-innovative-solutions-to-common-problems/?pageforid=7605679#post-7605679</a> <a href="https://app.roll20.net/forum/post/5899495/roll20-tips-and-tricks-innovative-solutions-to-common-problems/?pageforid=6138238#post-6138238" rel="nofollow">https://app.roll20.net/forum/post/5899495/roll20-tips-and-tricks-innovative-solutions-to-common-problems/?pageforid=6138238#post-6138238</a>
1671136594

Edited 1671204727
Bodo
Pro
Sheet Author
I've a similar error while custom roll parsing. When I execute the query&nbsp; !{{query1=[[ 0[?{Bonus dice|0}] ]]}} I get the following javascript error. VM101:41135 Uncaught TypeError: Cannot read properties of undefined (reading 'models') at d20.engine.selectedWindows (&lt;anonymous&gt;:41135:4062) at ni (&lt;anonymous&gt;:41230:392) at wi (&lt;anonymous&gt;:41230:1079) at Ie (&lt;anonymous&gt;:41228:57070) at wi (&lt;anonymous&gt;:41228:59074) at &lt;anonymous&gt;:41228:57780 at &lt;anonymous&gt;:41228:58979 at &lt;anonymous&gt;:41228:28386 d20.engine.selectedWindows @ VM101:41135 ni @ VM101:41230 wi @ VM101:41230 Ie @ VM101:41228 wi @ VM101:41228 (anonymous) @ VM101:41228 (anonymous) @ VM101:41228 (anonymous) @ VM101:41228 setTimeout (async) (anonymous) @ VM101:41228 TaskCompletionCallback.taskComplete @ VM101:41228 (anonymous) @ VM101:41228 initiateRolls @ VM101:41228 process @ VM101:41228 Tt @ VM101:41228 Wt @ VM101:41228 pt @ VM101:41228 lt @ VM101:41228 (anonymous) @ VM101:41230 I.each.I.forEach @ VM101:24147 tt @ VM101:41229 Xe @ VM101:41230 Submit @ VM101:41230 props.click @ VM98:8648 dispatch @ VM94:3076 elemData.handle @ VM94:2752 In a new sheet everything works fine. In my sandbox everything works fine. In a certain game (for all sheets in the game) I get this error.&nbsp;
1671137941
Kraynic
Pro
Sheet Author
If you make a copy of that game (or character sheet), does it work in the copy?&nbsp; Since you say it works in a new sheet, then it may be that the particular character sheet has been corrupted somehow.&nbsp;
1671138434

Edited 1671138628
Bodo
Pro
Sheet Author
I tried making a copy of the game it already and sadly it doesn't work. But good idea! Here is the code producing the error, but it can also be reproduced by simply putting the macro into chat &nbsp; &nbsp; // Helper function to grab player input &nbsp; &nbsp; const getQuery = async ( queryText ) =&gt; { &nbsp; &nbsp; &nbsp; &nbsp; const rxGrab = / ^ 0 \[ ( . * ) \] \s * $ / ; &nbsp; &nbsp; &nbsp; &nbsp; let rollBase = `! {{query1=[[ 0[ ${ queryText } ] ]]}}` , // just a [[0]] roll with an inline tag &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; queryRoll = await startRoll ( rollBase ), &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; queryResponse = ( queryRoll . results . query1 . expression . match ( rxGrab ) || [])[ 1 ]; &nbsp; &nbsp; &nbsp; &nbsp; finishRoll ( queryRoll . rollId ); // you can just let this time out if you want - we're done with it &nbsp; &nbsp; &nbsp; &nbsp; return queryResponse ; &nbsp; &nbsp; };
1671200006
timmaugh
Forum Champion
API Scripter
Cross-posting this bug report... seems something is wrong with the implementation of windows: <a href="https://app.roll20.net/forum/permalink/11234524/" rel="nofollow">https://app.roll20.net/forum/permalink/11234524/</a>
Hey folks - this issue should be resolved now, we posted a fix about 30 minutes ago. Sorry for the interruption to your games, and thank you for the reports!
1671224633
timmaugh
Forum Champion
API Scripter
Thanks, Jeff!
Many thx!
1671232698
Bodo
Pro
Sheet Author
Thx Jeff!&nbsp;
Thank you everyone for your replies and involvement!&nbsp; Timmaugh many thanks for helping me nail down the syntax.&nbsp; Jeff L I just tried it in my original test game and&nbsp; [d100](!&amp;#13;#d100) worked like a charm.&nbsp; Resolved it is!&nbsp; Ahh.. should I then mark it that way?&nbsp; How?
1671506350
timmaugh
Forum Champion
API Scripter
These forums don't have a "resolved" designation... just people saying, like you did, what worked for them. After that they'll linger on until they go 2 months without new update before, in an ättestupa-like ceremony, they lock themselves from further new posts.