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

Autofire API Help

I am new to the whole API thing and I need some help in creating a piece of code, I don't know what to do. What the code is meant to do is: Take an input in the form of "distance to target". Take that input and compare it to a table to obtain a DC which depends on that distance. Make a skill check using a characters modifier. Compare the check to the DC, and for each point above the DC, the character rolls a damage roll (up to a maximum of 5). I have no idea where to begin with this so please help me.
1624742931
timmaugh
Roll20 Production Team
API Scripter
Just so we're on the same page, APIs are a Pro perk... so you either have to be a Pro subscriber or be playing in a game started by a Pro subscriber. Sometimes people talk about APIs but they really mean just basic macros (no API involved at all). I'm going to assume you really mean API scripts, and that you're playing in a game belonging to a Pro subscriber. In that case, the question is... are you wanting to code your own API in javascript, like a learning project? Or are you looking to leverage existing scripts to do what you need to do? You can probably do a lot of this with the meta toolbox or ScriptCards. Let us know which direction you want to go, and you'll get plenty of help, for sure!
1624760976
Oosh
Sheet Author
API Scripter
Minor addition that an API script can happily do step 1 for you automatically, instead of needing an input. In fact it's probably the easiest part of the script :)
I have a friend who has Pro and he has asked me to help him with the API, since I helped him with macro's previously, but I have no idea about this stuff.