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

increment variable

1489610697

Edited 1489664845
is there anyway we can increment variables? For example, lets say i have a sorcerer who can cast 5 level 1 spells per day.  I store the 5 in a variable called "Spell1".   When I use my "Magic Missile" macro, I want to decrement the "Spell1" variable from 5 to 4.    Later on, when the character rests for the day, I want to push the "Rest" macro button and restore the "Spell1" variable back to 5.
1489612085
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
This requires an API script (pro perk). Macros by themselves can only get information from an attribute, they can't change it.
1489618954

Edited 1489618990
you could use the turn tracker for that and then make a non token turn for their actual turn. You can reference a turn trackers value and you can update it. Although this would only work for keeping track of a single value.
1489621161
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Works for a single value, but I'd be very surprised if Gardan's character only has a single level of spells to track.
true, but it could work well for something like a monks Ki points or sorcery points
1489626355
Andrew C
Marketplace Creator
That kind of stuff Gardan wants is basically API-only stuff. Putting in the rounds a spell lasts during combat is an ideal use of the Turn Tracker.
thanks for the replies guys.