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 a change on character sheet change trigger an API?

I have done a little digging...it seems like it can but not sure since I have not had any luck. So I am trying to determine in the on('change event gets trigger from a character sheet? I am working with the Pathfinder Second Edition sheet and I cannot seem to get this right. I would like to trigger an API script is changes are made. But I am still pretty new at this. I have a very simple script just to see...I have tried strength, STR and few others but it never triggers? on('change:strength_score', function(obj, prev) {     console.log(obj);     console.log(prev); }); in the end I would like to get to the  repeating_conditions  section to look for changes. I am not sure I can do this?
1631031104
GiGs
Pro
Sheet Author
API Scripter
Your code looks like it is using a mix of character sheet sheet worker code and API scripyt code. There are differences between them. In the API, you need to do something more like on('change:attribute', function(obj, prev) {     console.log(obj);     console.log(prev); }); You then need to find out which attribute changed, on which character.
Great this works! Thank you...