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 .
×

Math countdown macro and sum macro question.

Two parts to my question, Is there a macro I could give my players with wands so that every time they clicked their wand macro it would also show the charges and count down/tick down by 1 each time its clicked? On the opposite end is there a macro where I could put in a number say their current xp and then each fight click it input the xp value and show the players what their current xp should be at? Ideally the sum stored would change with each click same as the wand macro.
1592971526
GiGs
Pro
Sheet Author
API Scripter
Unfortunately, macros cannot change attribute values, they can only read them. If you want to be able to change attributes, you need the API, a Pro subscriber perk.
1592975610

Edited 1592975646
Oosh
Sheet Author
API Scripter
While you still have to change the value manually, a simple XP macro can be handy: /w bob &{template:default}{{name=Experience gain}}{{+?{How much XP?|0} XP gained=**New total:** [[?{How much XP?}+@{ bob |experience}]]}} change bob to player name. If you're using group leveling, only one person needs to run it, and take out the whisper.
1593016449
GiGs
Pro
Sheet Author
API Scripter
Its a good idea to always put quotes around the player name part /w " bob" &{template:default}{{name=Experience gain}}{{+?{How much XP?|0} XP gained=**New total:** [[?{How much XP?}+@{ bob |experience}]]}} It's not needed here, but names with spaces in them, and some other characters,  wont work properly without quotes around them, so its good to get in the habit.
1593021382
Oosh
Sheet Author
API Scripter
Very true! It's mostly bad habits that hold me together though.
Ah so that macro if they are using their character sheet would show them the new sum that they should change to each time? So I take it there is no way to have a self contained value count down for the wand charges that is a shame.