Difference between revisions of "Script:cron"
From Roll20 Wiki
(Created page with "{{script overview |name=cron |author={{user profile|503018|manveti}} |version=0.1 |lastmodified=2015-04-28}} '''Cron''' allows a user to schedule commands to run at some poin...") |
(→Examples) |
||
Line 44: | Line 44: | ||
=== Examples === | === Examples === | ||
− | :!cron -r 10 The bomb's timer reaches zero! It explodes for [[10d10]] damage. | + | :!cron -r 10 The bomb's timer reaches zero! It explodes for <nowiki>[[10d10]]</nowiki> damage. |
::Called on the initiative count in which the bomb's timer is set, it will explode in 10 rounds. | ::Called on the initiative count in which the bomb's timer is set, it will explode in 10 rounds. | ||
:!cron -c 12 -i 1 -f "Hey, eejit!" /w gm Don't forget the spider's turn | :!cron -c 12 -i 1 -f "Hey, eejit!" /w gm Don't forget the spider's turn | ||
::A forgetful GM might use this subtle reminder that the party's mage summoned a spider which acts on the mage's initiative count (12, in this example). | ::A forgetful GM might use this subtle reminder that the party's mage summoned a spider which acts on the mage's initiative count (12, in this example). | ||
− | :!cron -f "Acid Rain" -i 1 The acid burns for [[2d6]] damage. | + | :!cron -f "Acid Rain" -i 1 The acid burns for <nowiki>[[2d6]]</nowiki> damage. |
::Inline roll results are stripped from the command and replaced with the original roll expression. Long story short: the above gives a new damage roll each round. | ::Inline roll results are stripped from the command and replaced with the original roll expression. Long story short: the above gives a new damage roll each round. | ||
:!cron -f Nanny -t 23:00 Bedtime for sleepy-head. Time to wrap things up. | :!cron -f Nanny -t 23:00 Bedtime for sleepy-head. Time to wrap things up. |
Revision as of 02:38, 5 May 2015
Version: 0.1
Last Modified: 2015-04-28
Code: cron
Dependencies: None
Conflicts: None
Cron allows a user to schedule commands to run at some point in the future. Jobs can be scheduled based on the turn tracker or clock time (relative to now or at some specific time in the future), and can optionally recur at a specified interval. Each job is given a unique ID, which can be used to remove it at a later time.
It is recommended that this script be used in conjunction with the CommandShell module, which will improve output formatting and command discovery.
Syntax
!cron [options] <command>
!cron <-l>
!cron <-R> <job ID>
Formally:
S
→ cronoptions
string
S
→ cron -l
S
→ cron -Rjob ids
options
→ -string
options
→ --string
options
→ -string string
options
→ --string string
job ids
→ string
job ids
→job ids
string
Parameter | Values |
---|---|
options | The !cron command accepts the following options:
|
Examples
- !cron -r 10 The bomb's timer reaches zero! It explodes for [[10d10]] damage.
- Called on the initiative count in which the bomb's timer is set, it will explode in 10 rounds.
- !cron -c 12 -i 1 -f "Hey, eejit!" /w gm Don't forget the spider's turn
- A forgetful GM might use this subtle reminder that the party's mage summoned a spider which acts on the mage's initiative count (12, in this example).
- !cron -f "Acid Rain" -i 1 The acid burns for [[2d6]] damage.
- Inline roll results are stripped from the command and replaced with the original roll expression. Long story short: the above gives a new damage roll each round.
- !cron -f Nanny -t 23:00 Bedtime for sleepy-head. Time to wrap things up.
- Be aware that the time zone is based on the API server, not the client who runs the command.
- !cron -a 30 Hey! It's 30 seconds later than when I typed this.
- Probably more useful with larger delay amounts.
- !cron -t 0:00:00 -i 1:00:00 /desc The clock chimes.
- This will fire every hour, on the hour. (Can also just do "-t 0").
Changelog
v0.1 (2015-04-28)
- Initial release