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

[ChatSetAttr] Is there a way of throwing an error when !modattr goes to a negative integer?

So the issue is that I'm setting up a Spell Copy script, which works fine !modattr --charid -LnNCU7y_Ek8OVhQ1d9X --repeating_equipment_-LnRyvI3OpuZ5d1L1xEu_uses|-[[?{What is the level of the spell being transcribed?}*50]] --silent But it does nothing regarding a negative integer, it simply outputs it as negative. So if the character has 25 gp of transcription materials (inks, paper, etc.) and copies a 1st level spell (which costs 50gp), the result is not an error message, it results in a value of -25.  If I use !modbattr, again it throws no error, just results in value 0. Is there something that could be added, such as --no-negative-value , that would throw an error if the result would be a negative number using !modattr?
1567110941
Jakob
Sheet Author
API Scripter
Not built-in, no. You could hack it in using --evaluate...
1567121682

Edited 1567122274
Ok.  Wish there was but I just converted it to the uses column instead on Shaped's Character Sheet.  Trying to use more than the amount of uses will stop the transcription allows.  I just hate how you can -and have to- see the query string in the Per Use in edit mode: [[?{What is the level of the spell being transcribed?|1|2|3|4|5|6|7|8|9}*50]]
Also, I don't want players using --evaluate, and this is on a player's sheet.