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

Ammo! Script with Pathfinder Community Sheet for a Spell Points System

1628693275
Hello all What I am doing , I am using the Community Pathfinder Sheet and Spheres of Power for a pathfinder game necessitating characters splitting a pool of points into different magic spheres.  I thought maybe I could use an ammo script to keep track of these points.  The pathfinder companion script is currently not working with the community sheet due to recent updates so I went with The Aaron's Ammo script.  The problem is, the macro I am using won't assign a value to the 'ammo' of one sphere before executing the next line of code.  Because I have a maximum number of points to distribute, I may be left with running separate macros for each sphere when resting.  That does not seem like an elegant solution.  I am sure I am missing a better way to do this.   Any input at all is welcome.   Currently: //Zero Out Destruction !ammo @{character_id} repeating_item_-mglipmsit2lcdstaz31_qty -@{selected|repeating_item_-mglipmsit2lcdstaz31_qty} Points in Destruction //Zero Out Protection !ammo @{character_id} repeating_item_-mgpewkwvon1tu5tbwqq_qty -@{selected|repeating_item_-mgpewkwvon1tu5tbwqq_qty} Points in Protection //Query for Destruction Spell Points !ammo @{character_id} repeating_item_-mglipmsit2lcdstaz31_qty ?{Enter Points Being Added To Destruction Sphere. Note: Destruction + Protection = 7|1,1|2,2|3,3|4,4|5,5|6,6|7,7} Points in Destruction //Adding Protection Points which is Max Destruct-Current Destruct !ammo @{character_id} repeating_item_-mgpewkwvon1tu5tbwqq_qty [[@{selected|repeating_item_-mglipmsit2lcdstaz31_qty|max}-@{selected|repeating_item_-mglipmsit2lcdstaz31_qty}]] Points in Protection
1628774899
Am I on the right track?  I continue messing with the script but I am not sure.
1628790987
The Aaron
Forum Champion
API Scripter
The problem is that all attribute references in a single macro are expanded before anything is sent to the API.  that means that  @{selected|repeating_item_-mgpewkwvon1tu5tbwqq_qty}  will have been changed to whatever value it has right now before the !ammo that would have changed it.  There isn't a good way around that, other than to manually adjust whatever the current value is by the same amount you're adjusting it by in previous commands.
1628796334
I appreciate the response Aaron.   I will just have to run something for each sphere individually.  I will figure it out.  I am tinkering with TokenMod to get numbered status markers up for spell points in each sphere.  
1628799469
vÍnce
Pro
Sheet Author
Here's something that might work. (wrapped the ammo commands using the !delay script and instead of doing the math for Points of Protection using Current Destruction, use the query) !delay 1 --!ammo @{selected|character_id} repeating_item_-mglipmsit2lcdstaz31_qty -@{selected|repeating_item_-mglipmsit2lcdstaz31_qty} Points in Destruction !delay 1 --!ammo @{selected|character_id} repeating_item_-mgpewkwvon1tu5tbwqq_qty -@{selected|repeating_item_-mgpewkwvon1tu5tbwqq_qty} Points in Protection !delay 4 --!ammo @{selected|character_id} repeating_item_-mglipmsit2lcdstaz31_qty ?{Enter Points Being Added To Destruction Sphere. Note: Destruction + Protection = 7|1|2|3|4|5|6|7} Points in Destruction !delay 10 --!ammo @{selected|character_id} repeating_item_-mgpewkwvon1tu5tbwqq_qty [[@{selected|repeating_item_-mglipmsit2lcdstaz31_qty|max}-?{Enter Points Being Added To Destruction Sphere. Note: Destruction + Protection = 7|1|2|3|4|5|6|7}]] Points in Protection
1628819125
Wow hey thanks!  I would not have thought of that.  Trying that now.