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

API Help

Hello all. I am running my first campaign on Roll20, I am a mentor because I have played on roll20 for quite a while. The API seems awesome and I would love to utilize as much of roll20 as possible, but I have no idea about the API. I know it is some type of scripting, but I'm unsure what specific language. I'm looking to find any info or pointers to where I would need to start learning the basics to use the API, I have the time and the will, just need the direction. lol I know I won't be doing any APIscripting soon, but I would love to learn or at least be able to use others. Any place to start would be awesome. Thank you in advance. Oh yeah I like to read so books are not out of the question.
1379373783
Pat S.
Forum Champion
Sheet Author
I believe it is javascripting
Ok thank you very much Metro, and question for you? You Still running that Basic fantasy game stuff?
1379376270
Pat S.
Forum Champion
Sheet Author
Yes but it is only a pbp game right now due to college sucking up all my spare time. I have 3 or 4 players still and they are knocking down skeletons at the moment.
1379376314
Pat S.
Forum Champion
Sheet Author
Pm me or skype me if you want to talk BFRPG.
I second your request Bent, I am experienced and use dynamic lighting, sound effects and all the extra fluff mentor gives you but i am a total noob when it comes to scripts and would absolutely love if someone would take a little bit of time to teach me how to use them.  Maybe i can offer your some form of payment for your expertise.  I really would love to know how to use auto initiative scripts etc.  If you are interested in helping a veteran DM put a new tool in his took box please hit me up.   Much thanks!
1379389594
Pat S.
Forum Champion
Sheet Author
I know that most of the scripts listen for a command line such as the end of turn script. It listens for the chat command of " !eot ". The " ! " is what tells the board to listen to the command. I like to think of it as a shout at the board script then the text part is the actual command. There are others that operate automatically such as the movement caller / logger /  something of that nature. It calls out that a token has moved and says how far. It is done automatically. I had help and it now whispers this to me so it doesn't clutter up the chat area for the players.
1379460993
Lithl
Pro
Sheet Author
API Scripter
The API is, indeed, event-driven. The on function is the core of the API, setting up events with various triggers: when the sandbox is ready, when a message is sent to the chat, when an object changes, and so forth. Many useful API scripts use the "chat:message" event, and check whether the message has the type "api". An API message is one which began with an exclamation point. While looking for API messages is common, it's not the only thing a script can do with the chat.