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 Tracking and Roll20 Pathfinder Sheet - Repeating Abilities

I am new to Roll20 and API scripts.  I'm leaning as I go, but I'm having a hard time with the Ammo Script and getting it to work with the sheet. I want to be able to track daily uses of things out of the Repeating Abilities section of the sheet.  (Or any section really, I can't get it to work for arrows even). Can someone help guide me on this process so I can set this up? Thanks,
1639611953
Kraynic
Pro
Sheet Author
The first thing is knowing how attributes are constructed in a repeating section: <a href="https://wiki.roll20.net/Macros#Referencing_Repeating_Attributes" rel="nofollow">https://wiki.roll20.net/Macros#Referencing_Repeating_Attributes</a> A thread that talked using ammo on the same sheet:&nbsp; <a href="https://app.roll20.net/forum/post/10478233/pathfinder-by-roll20-character-sheet/?pageforid=10478744#post-10478744" rel="nofollow">https://app.roll20.net/forum/post/10478233/pathfinder-by-roll20-character-sheet/?pageforid=10478744#post-10478744</a>
1639612304

Edited 1639612713
So just to be clear, character_id is the character's name.&nbsp; If it has a space, will that cause an issue.&nbsp; I can get a step further when I use @{selected|token_id} but cannot with character_id.&nbsp;&nbsp; The other issue seems to be the repeating_abilities section.&nbsp; I want to use this for Stunning Fist.&nbsp; But I'm lost at what the line should look like.&nbsp; I have this currently.&nbsp; !ammo @{Grotham_Ironfoot} repeating_abilities_ -MjkLTTQKz8kvMJ7Yk-H_name -1 Stunning Fist I get an error that says bt undefined. But this works when I select the token. !ammo @{selected| token_id } repeating_attacks_-Mk4pjaG7Z8Or3MxbuXh_atkammo -1 Javelin Am I doing something wrong with character_id?
1639615053
Kraynic
Pro
Sheet Author
I'm assuming that the character you are trying to use this on is named Grotham Ironfoot.&nbsp; Go ahead and put @{Grotham_Ironfoot} in chat and hit enter.&nbsp; I am expecting you will get some sort of error, because the name you have put on the character isn't an attribute.&nbsp; The name is stored in an attribute called "character_name".&nbsp; Since @{Grotham_Ironfoot} throws an error, the script has no idea where to look for the attribute: repeating_attacks_-Mk4pjaG7Z8Or3MxbuXh_atkammo On the other hand, if you put in @{selected|token_id} and hit enter, you will get a string of letters and numbers that is the unique ID of that token.&nbsp; The api can then find the sheet represented by that token to find the attribute that ammo is trying to reduce. If you go to the api settings page for your game, there should be a tab for every script you have installed.&nbsp; The examples there are using @{character_id} (it mentions using token ID as well).&nbsp; You can use that if the macro will be rolled from that character sheet without a selected token.&nbsp; If you aren't the creator of the game, you won't be able to see that settings page to see those examples though. It looks like the wiki has pretty much the same set of instructions.&nbsp; <a href="https://wiki.roll20.net/Script:Ammo" rel="nofollow">https://wiki.roll20.net/Script:Ammo</a>
That was a big help!&nbsp;&nbsp; Thank you. Okay, I have the ability to get the token_id now, I never knew how to do that before.&nbsp; Now I'm trying to figure out the name of the attribute to lower when it is used.&nbsp; This is the # day.&nbsp;&nbsp; I've managed to change the name of Stunning Fist to -1, the Per Day to -1, but not the # day.&nbsp; Ahh!&nbsp; I figured it out!&nbsp;&nbsp; It is this command. !ammo -MqSFsly6Ec3Z8in1pmH repeating_abilities_ -MjkLTTQKz8kvMJ7Yk-H_perday -1 Stunning Fist Okay, is there a way to set this up as a Macro, so that it calls the ability, and then also does the API count?
1639737752
Andreas J.
Forum Champion
Sheet Author
Translator
What do you mean with "call the ability", in this context? If you save a macro with that API command as content, the macro will execute the command as written when called.