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

run a script after you roll on the character sheet

1500173909
Marco M.
KS Backer
Sheet Author
API Scripter
Compendium Curator
Is there a command similar to on("change:<attribute_name>)  that works with <roll_name>. I'm trying to find a way to project on sanity. The idea is that I could reduce my sanity loss projecting on one bound (reducing it's value by 1d4). To do so I need to have a temporary value for the sanity (done) and modified it with the value of my roll. However, whatever I try I cannot save the roll value as a variable to be used in modifying other attributes when a dice is rolled.  Note: I'm trying to do it using only the character sheet script 
1500211767
Marco M.
KS Backer
Sheet Author
API Scripter
Compendium Curator
Maybe a better question would be: How can I save the result of a button roll in my character sheet into an hidden attribute? (so I can use on("change:hidden_attr"). I might be really stupid but I cannot figure it out by myself (I was thinking to go and parse the the msg screen but I need to be sure it's the roll I'm looking for)
1500215658
Jakob
Sheet Author
API Scripter
You can't do that using sheet workers, that's API territory.
1500217453
Marco M.
KS Backer
Sheet Author
API Scripter
Compendium Curator
Damn... I wanted to put everything I could in the character sheet so every user can do it. I guess I'll let them do it manually :/
1500232691
Lithl
Pro
Sheet Author
API Scripter
on('chat:message') will pick up the roll (as well as every other message sent to chat). You can then parse the message to find out if a roll was made.