You can do a fair amount with the Roll20 macros but if you only have the free account sometimes you want a little more. I wanted to make a macro that handles Mirror Image for me. I would click on the macro provide a attack values and it would determine how many images I have, roll to determine if the attack was against a image or the caster based on the number of images left and automatically remove an image if the attack was against and image and it hit. With regular macros I was having an difficult time doing the whole sequence. But I found this hack. Macros allow you to reference images from 3rd party servers. The way that Roll20 determines a valid image URL is to check the ending of the URL for a valid image extension. This can be exploited. What I did was create a little PHP script that I run on my web server. The PHP script does all of the processing of Mirror Image (with instructions sent via query parameters) and then creates an image with the results. The server then returns the image. When a roll20 macro tries to get the image from my server, it is actually going to a MirrorImage.php URL but because I tack on a query parameter that ends in ".png", Roll20 is happy with it. My server returns an image so Roll20 is happy with it and displays the image. So, unknowingly, the roll20 macro tripped the script on my server which generated the Mirror Image functionality and returned it as an image. This does not pose any security risk form roll20 since you can only send a image back as a result but it allows you to perform all kinds of processing outside roll20 and then show the results in roll20. The only other trick is getting by the caching. Normally roll20 caches images so if you ran the macro twice the second time you would normally get the exact same results since it would just show the results of the cached image. To get around this I added a roll (random number) into the query parameter. I happened to have used two rolls of 1D100 meaning roughly 10000 possibilities. The difference in this random number causes roll20 to consider the URL as a different URL and forces it to read the image from the original server (and thus pick up the updated images with the new results). The follow is an example of the output of my Mirror Image and what appears in roll20... When calling the macro I pass the attack value into the macro and it does the rest.