I have a basic working knowledge of Javascript and would like to use the API for some conditionals, however I'm stuck on a few basic points- Namely: 1. How to properly set up a function in the API so that it can be called later (can you just go straight in with function myFunction() {do stuff} ? Or are there some other requirements I'm missing?) 2. How to call said function either in game or via a macro (I understand that a macro cannot call a function directly, but by doing something with chat it is possible.) If I knew these two things I could probably figure out the rest. Alternatively, is the way to do this described somewhere in the Roll20 manuals? Ive been looking around in there but there's just so much information. If someone could point me in the right direction I'd be grateful.