I am planning to make it easier to do "timed" events in MUSHclient, particularly in triggers. Here is what I have in mind, from the release notes for 3.18. What is described below is implemented already, and works, but I am wondering if there is a slightly better way of doing it? Any comments from users would be appreciated.
Added "send delayed" option for triggers. This lets you do delayed sending with a minimum of fuss. To use this, set up a trigger, and set the trigger to send to "world (delayed)". Then in the "send" text specify each line with a delay in front of it, like this:
(You may find the new "trigger edit" box helpful for entering such a long command. Press Ctrl+Enter to start a new line).
The syntax for this delayed sending is:
The times are not cumulative, the are all measured from the time the trigger fired. The example above shows how to make things happen every second. It is possible to make things happen in reverse order, like this:
In that example, the commands would be sent in the order east, south, north.
My questions are - while there is still time to change it ...
Added "send delayed" option for triggers. This lets you do delayed sending with a minimum of fuss. To use this, set up a trigger, and set the trigger to send to "world (delayed)". Then in the "send" text specify each line with a delay in front of it, like this:
say See you soon
east
;
; go to shop
;
1; west
2; north
3; west
;
; get some food
;
4; buy food
;
; go back
;
5; east
6; south
7; east
(You may find the new "trigger edit" box helpful for entering such a long command. Press Ctrl+Enter to start a new line).
The syntax for this delayed sending is:
- The "send" text is broken into lines
- Blank lines are ignored
- Lines starting with a semicolon are ignored (treated as comments)
- Lines with a number followed by a semicolon are treated as a delayed send - the command after the semicolon is queued to be sent after the nominated number of seconds (using a temporary, unlabelled, one-shot timer)
- Lines which do not start with a number followed by a semicolon are sent immediately (eg. "east")
- Lines with zero seconds are sent immediately (eg. "0; west")
- If you want to send a semicolon at the start of a line, you can do that by something like this:
0; ; sigh <-- immediate send
5; ; sigh <-- delayed send
- The time must be in the range 0 to 86,399 (23 hours, 59 minutes and 59 seconds).
- Leading and trailing spaces are discarded.
- If the command (after the semicolon if any) starts with the speed walk prefix, then the command is queued as a speed walk.
eg. If the speed walk prefix is "#" ...
5; # 5n3e4s
The times are not cumulative, the are all measured from the time the trigger fired. The example above shows how to make things happen every second. It is possible to make things happen in reverse order, like this:
5; north
3; south
1; east
In that example, the commands would be sent in the order east, south, north.
My questions are - while there is still time to change it ...
- Is semicolon the best delimiter? Maybe colon (":") or something else?
- It might be handy to have an option to do a world.note when the time elapses?
- What would be the syntax for that? Maybe this:
5; go west // normal send 6 >N; Spell time is up // >N means "Note" 10 >S; 3e 4s 5w // >S means "speed walk" - Any other suggestions?