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
This post has been closed. You can still view previous posts, but you can't post any new replies.

[Scrip Request] Fix !cron to allow calling macros or commands

1449612231

Edited 1449612279
The !cron tool is quite nice, but it would be so much mightier if it would be able to handle macros. !cron can be found here:&nbsp; <a href="https://github.com/Roll20/roll20-api-scripts/blob/" rel="nofollow">https://github.com/Roll20/roll20-api-scripts/blob/</a>... The documentation here:&nbsp; <a href="https://wiki.roll20.net/Script:cron" rel="nofollow">https://wiki.roll20.net/Script:cron</a> I would like to use !cron together with !tttime ( <a href="https://app.roll20.net/forum/post/1386741/script-t" rel="nofollow">https://app.roll20.net/forum/post/1386741/script-t</a>... Such that I could use !cron -i 00:00:01 #timemacro Where #timemacro is !ttaddsec 1 !tttime Which would let me use whatever time scale I want (instead of 1 for 1:1) and let the ingame clock run in situations where the player are under analysis paralysis. The first comand would add 1 second to the time, while the second command would print it to the chat. Currently the !cron command above leads to a API sandbox crash.
API scripts that send text to chat cannot trigger macros abilities or additional api commands. It's a safeguard against infinite loops.
But it is somehow possible to expand them isn't it? The randomizer script which rolls on tables and subtables if their name is part of the rolled item allows infinite loops and expansion by introducing circular dependencies.
Now that I think about it... there would be a way, but I don't think it should be done because it goes against the anti-infinite loops checks put in by Riley.
1449678819
The Aaron
Pro
API Scripter
The major problem with expanding macros is context. &nbsp;I have code that basically does this for expanding attributes as part of GroupInitiative (many attributes contain formulas like @{dex}, where I need @{CharName|dex}), but it would take quite a bit of effort to do this for full on macros. &nbsp;With Attributes you can be reasonably sure you're just going to end up with data (which I use for building the initiative of each token), but macros have an expectation for execution and as HB points out might call other API scripts (and in fact the same api script, causing an infinite loop). &nbsp; The practical upshot is, yes it can be done, but would be extremely difficult to do well and safely.
It is not worth it if it is any effort. I just thought it would be possible as a quick fix. I do not have any cool use cases beside the clock at the moment at all. Thank you for the infos! Always good to know how roll20 works under the hood. Topic can be closed.