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

Changing advantagetoggle with chatsetattr

1664742088

Edited 1664766026
Tara
Pro
So I'm trying to create a macro to put in the token bar that will work with this API to toggle advantage (and whisper once I get to that). I've done a google search and found this topic  that was helpful in getting me started. I used @{selected|advantagetoggle} to find the value of the attribute on normal for the 5e Roll20 Sheet is {query=1}} {{normal=1}} {{r2=[[0d20 I tried changing the advantgae toggle to disadvantage, then copying and pasting the answer in the topic post linked above and it threw an error, so I read through the documentation on the API and finally landed on this: !setattr --sel --advantagetoggle|'{{query=1}} {{normal=1}} {{r2=\lbrak\lbrak0d20' When I run that, it doesn't do anything. It doesn't throw an error, nor does actually change the attribute. Am I doing something wrong? For the record, I did also try !setattr --sel --advantagetoggle|'{{query=1}} {{normal=1}} {{r2=\lbrak\lbrak0d20' and !setattr --sel --advantagetoggle|'{{query=1}} {{normal=1}} {{r2=[[0d20' with the same result. EDIT:  it looks like this is just not working at all. I tried the command !setattr --sel --hp|20 and that didn't work either. I tried removing and re-adding the script, and that didn't help. I've tried it  on multiple tokens and verified the tokens are tied to a character sheet...is this just broken currently?
I think you simply need to add the --replace option to your macro, so it would be this (I haven't confirmed/tested): !setattr --sel --replace --advantagetoggle|'{{query=1}} {{normal=1}} {{r2=\lbrak\lbrak0d20'
Sadly, that did not work, neither did !setattr --sel --replace --advantagetoggle|{{query=1}} {{normal=1}} {{r2=<<0d20' or !setattr --sel --replace --advantagetoggle|{{query=1}} {{normal=1}} {{r2=<<0d20'
update on this: it looks like this is just not working at all. I tried the command !setattr --sel --hp|20 and that didn't work either. I tried removing and re-adding the script, and that didn't help. I've tried it  on multiple tokens and verified the tokens are tied to a character sheet...is this just broken currently?
Sanity check: is your API sandbox disabled? Do you have it open in another window, and confirm that it’s running and not throwing any errors?
Jarren said: Sanity check: is your API sandbox disabled? Do you have it open in another window, and confirm that it’s running and not throwing any errors? Yup, sandbox is running: Spinning up new sandbox... "-=> CreateMacroMule script enabled v2.0 <=- Macro Mule Name is: MM" "Loading character sheet data..." "Starting webworker script..." "Loading 922 translation strings to worker..." "Starting webworker script..." "Loading 922 translation strings to worker..." "Roll20 Environment: Web" I did discover that whatever the problem is, it's limited to that game. I tried it on another game and it's working fine. Not a big loss, the broken one is a clone of a test game.