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

can you change roll queries/whisper rolls/auto roll damage from API?

1591651837
Angelo
API Scripter
I am trying to change these fields for both PCs and NPCs from the API but i can't find anything in the documentation, if anyone has any links to a doc with names/values i would appreciate it! - Roll Queries - Whisper Rolls to GM - Auto Damage Roll
1591668106

Edited 1591668137
The Aaron
Roll20 Production Team
API Scripter
They will be attributes associated with the character. You can right click them on the character sheet and find the name. Will say something like attr_autoroll. If you strip the attr_ from the front, you have the attribute name to search for. 
1591676879
Angelo
API Scripter
The Aaron said: They will be attributes associated with the character. You can right click them on the character sheet and find the name. Will say something like attr_autoroll. If you strip the attr_ from the front, you have the attribute name to search for.  sorry aaron i am not sure i follow, do you mean using the inspect on chrome?
1591680010

Edited 1591680255
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Set to Whisper !setattr --sel --silent --wtype|'/w gm ' Never Whisper !setattr --sel --silent --wtype|'' Setting the whisper query is harder, because it uses a lot of control characters. I fiddled with it for a bit but couldn't get it to go through. Note that because of the way that the D&D 5th Edition by Roll20 Sheet is constructed, you are changing the value of the field that the drop down selector on the sheet changes, but not the drop down itself. So you can change from never whisper to always whisper and the character will whisper, but the selector on the sheet will still say always whisper.  EDIT: This behavior seems to have been fixed by recent upgrades, or my memory may be playing tricks on me. You decide. :)
1591680201
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Auto Roll Damage !setattr --sel --silent --dtype|full Don't Auto Roll Damage !setattr --sel --silent --dtype|pick
1591753990

Edited 1591811790
Angelo
API Scripter
thank you keith, the following code does it on the API side in case anyone else needs it  Weirdly enough the Don't Auto Roll Damage (dtype) doesn't seem to work, i see the value getting modified on the sheet but even if i modify it manually in the editor the NPCs are always rolling damage for me.             let targetAttr = findObjs({_type: "attribute", name: "rtype", _characterid: shiftData.targetCharacterId})[0];             if (targetAttr)             {                 targetAttr.set('current', "@{advantagetoggle}");                   targetAttr = findObjs({_type: "attribute", name: "advantagetoggle", _characterid: shiftData.targetCharacterId})[0];                 if (targetAttr)                     targetAttr.set('current', "{{query=1}} {{normal=1}} {{r2=[[0d20");             }             targetAttr = findObjs({_type: "attribute", name: "wtype", _characterid: shiftData.targetCharacterId})[0];             if (targetAttr)                  targetAttr.set('current', "");             targetAttr = findObjs({_type: "attribute", name: "dtype", _characterid: shiftData.targetCharacterId})[0];             if (targetAttr)                 targetAttr.set('current', "pick");
1591811909
Angelo
API Scripter
about the auto roll damage i found out that it works on a new creature, and then in the moment i try to set it from the API it breaks... i can see the value changing in the option but now it always rolls damage, even i change the option in the sheet it doesn't work anymore
1591975900

Edited 1591981105
Angelo
API Scripter
Angelo said: about the auto roll damage i found out that it works on a new creature, and then in the moment i try to set it from the API it breaks... i can see the value changing in the option but now it always rolls damage, even i change the option in the sheet it doesn't work anymore yesterday i had a similar problem in the game with rtype attribute, the API changed the value but that broke the sheet somehow. After the API sets rtype i could see the value changing in the sheet options but nothing was happening (i.e. the toggle wasn't showing up), i tried to change it manually and then the toggle actually showed up but then i couldn't hide it on that creature anymore, even changing the setting manually wasn't doing anything, the advantagetoggle was always shown at the top of the sheet. (the creature was a Tiger from the Monster Manual as a reference) I wonder if there is a flag related those settings i need to set as well? but then i tried the same thing into a different game on the same creature and it worked just fine...