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

[D&D5E] Question about !ammo api limitation

Heya. I am noticing that there are some things that the !ammo API is not quite able to do at this time and wonder if it's actually due to a limitation, or if I am just using it wrong. I made an attribute for if something exists, and the mode it is on (ie, @{Test}    1    |    1) If I ran `!ammo @{character_id} Test [[@{Test|max}+1]]`, it reads the max value, adds 1, and applies it to @{Test}. But, if I run `!ammo @{character_id} Test|max [[literally anything]]`, it says "Attribute [Test|max] was not found. Please verify that you have the right name." and doesn't work. It is able to read max values as shown in the first command, but what do I do to get it to modify the attributes max field? Additionally, I notice that the API crashes if you give it a formula that has conflicting equation symbols (ie -[[2-3]], since then it is read as --1, or "Minus negative 1", but leaving it as [[2-3]] works since then it shows as -1, as "minus 1" instead of "negative 1". Bit of an odd quirk and a little bit frustrating when doing. I notice that this api does crash very easily...
1714619421
The Aaron
Roll20 Production Team
API Scripter
I simply didn't write it in a way that it could access the max attribute. In your first example, it isn't the API accessing the max attribute, it is the command parser in the client expanding the inline roll. If you take the ! off the front and run the command, you can see what the API actually sees.
Thank you for your reply. That is good to know. Are you by chance open to ideas, if you are still working on the script? I have an idea that I think would be pretty handy