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

[API] Save the successes

Hi, how about folks? Beforehand I would like to warn you that I am not fluent in English and I am using certain resources to be able to communicate here, so I will try to expose my doubts very simply so that there are no errors. A few days ago I asked if it was possible for Roll20 to "save" the successes of a test and I was told that it uses a PRO users API script. Now that I'm a PRO, I'd like to know where to find it. Thank you!
1515595738
The Aaron
Pro
API Scripter
There may be a slight language barrier issue going on here.  I'll clarify: Saving of successes (the state of a test) is only possible with the API. There may or may not be a script already for what you want to do.  You may need to write one. Looking at your prior question, It sounds like you're playing World of Darkness.  What you'll want to look for or ask about is a script to automate the World of Darkness mechanics.  I've not really played World of Darkness, so I don't know the mechanics.  I do know the API, so if you have questions about it specifically, I can definitely help.  If the mechanic is pretty simple, I might be able to help you write something (life has been pretty busy though, so no promises!). I'll move this to the API forum so the right people are more likely to see it.
If API has a language similar to Macro, I think I'll just need the basics. Thank you!
1515596377
The Aaron
Pro
API Scripter
The API is written in Javascript.&nbsp; It supports pretty modern versions (at least ES6, probably ES2017) so tutorials on that would help.&nbsp; It's really quite powerful compared to Macros.&nbsp; A (very, very) brief rundown: On your Game Details page, click Settings and choose API Scripts . Click the New Script tab. In the Name box, type something like "Test Script". in the space below paste this: on('ready',function(){ log('This is the API Log'); log('The API triggered the "ready" event.'); sendChat('Test API Script','/w gm The API has started up.'); }); 5. Click Save Script. If you join your game in another tab/window, you should see &nbsp;a few messages in the log below the API scripts tabs, and you should get a message whispered to you in the game. The API is Event Driven, and so responds to various things happening.&nbsp; Mostly you deal with chat:message events and change:graphic events.&nbsp; There's a whole wiki with documentation:&nbsp; <a href="https://wiki.roll20.net/API:Introduction" rel="nofollow">https://wiki.roll20.net/API:Introduction</a> And of course, lots of example scripts about and helpful people to talk to.&nbsp; =D
1515612280

Edited 1515612296
Lithl
Pro
Sheet Author
API Scripter
The Aaron said: I've not really played World of Darkness, so I don't know the mechanics.&nbsp; I do know the API, so if you have questions about it specifically, I can definitely help.&nbsp; If the mechanic is pretty simple, I might be able to help you write something (life has been pretty busy though, so no promises!). (attribute + ability)d10, each die that meets or exceeds the target number is a success (old WoD had the target vary wildly roll-by-roll at the GM's discretion, but I think new WoD makes it far less common for the target to change), 10s are generally double successes (unless the target is 10). Depending on the WoD version and kind of roll, 1s either subtract successes, or cause greater failure if no successes were rolled.
Brian said: The Aaron said: I've not really played World of Darkness, so I don't know the mechanics.&nbsp; I do know the API, so if you have questions about it specifically, I can definitely help.&nbsp; If the mechanic is pretty simple, I might be able to help you write something (life has been pretty busy though, so no promises!). (attribute + ability)d10, each die that meets or exceeds the target number is a success (old WoD had the target vary wildly roll-by-roll at the GM's discretion, but I think new WoD makes it far less common for the target to change), 10s are generally double successes (unless the target is 10). Depending on the WoD version and kind of roll, 1s either subtract successes, or cause greater failure if no successes were rolled. Pretty much that. Well, I'd better start studying APIs before I end my vacation!
1515634548

Edited 1515634750
Silvyre
Forum Champion
It's possible to indirectly save the result of a roll to an Attribute , using API Command Buttons with the scripts PowerCards and ChatSetAttr . (After the macro is used, you would press a button to save the roll result to an Attribute.) At its simplest, a PowerCards macro that does so looks like this: !power {{ --Roll|[[ [$Roll] 1d6 ]] --Save|[Set Attribute](!setattr &amp;#45;-sel &amp;#45;-Result|[^Roll]) }} The HTML encoding is necessary due to both PowerCards and ChatSetAttr using "--" as a delimiter. Alternatively, if you're looking to save or add the result of a roll to a Token's Bar, a direct method (which does not require clicking a button) is possible using PowerCards and AlterBars .