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

Syntax for macros and api's

Hi all,  I've looked all over and can't find a proper syntax guide of any sort. The info must exist otherwise the code wouldn't work (at least a list of syntax elements) Does anyone know where I can find this info? I'd love to write macros etc. But without the basic definitions I can't even make it up. I can surmise what things do by looking at other macros but that's just a huge and pointless waste of time when any normal programing language has at least a basic reference  Any help would be gratefully received  Thanks
1605360102
GiGs
Pro
Sheet Author
API Scripter
The information is out there, check out the roll20 wiki. For API, you are probably better off looking for scripts others have written - but if you want to learn how to write them, you'll need to learn some basic javascript, which isnt limited to roll20. You can find help sites for that everywhere. If there's a specific task you want to do, describe it, we'll show you how to do it with a macro, and that will help you get started, Bear in mind, macros are just ways to store bits of text, or rolls, that you can write in chat. A macro just saves it for later reuse.
1605364229

Edited 1605364311
Andreas J.
Forum Champion
Sheet Author
Translator
The Complete Guide to Macros & Rolls on the wiki is the most comprehensive page on the topic. It links to all other major pages with various macro/API syntax things, along with listing a number of more obscure macro tricks people have come up with over the years. The breakdown on the main pages on the subject is Complete Guide to Macros & Rolls ‎ q Text Chat - where the roll results appear, & info on the common chat commands Dice Reference - Comprehensive list of how the Roll20 dice-rolling syntax works, and list the features available Macros - How to create macros, and other info on how the Roll20 q Text Chat works, like referencing stats on character sheets, roll queries, nesting macros & initiative Reusing Rolls Roll Templates - a method of formatting roll results in the chat, with some extra functions API (Pro Only) - API commands can be used in the q Text Chat I think it would be a good idea if you delete the duplicate thread you made.