Usage:
/REPEAT [-w[world]
[-time] count command
Repeats command, count times. Command may be any legal macro body. This works through a process i.e. it runs concurrently with normal input and output.
If time is specified in the format "hh:mm:ss", "hh:mm", or "ss", it is used as the delay between each line. If time is given as the letter "S", the repeat will run synchronously (see "processes"). Otherwise, the delay between each line is determined by the variable %{ptime}.
Socket commands generated by /repeat will be sent to the foreground world by default. If -wworld is given, commands will be sent to that world instead. If -w is given, commands will be sent to the world that was current when the /repeat was started.
The body of the /repeat command undergoes macro body substitution when it is executed.
An asynchronous /repeat returns the pid of the new process, or 0 if an error occurred. A synchronous /repeat returns the return value of the last command.
Since the first run is not done until after the first interval (for an asynchrounous /repeat), a useful trick is to use "/repeat -time 1 command" to delay the execution of a single command.
Example: Here's a technique to execute an infinite 30-minute repeat:
/def doodle_forever = /doodle%; /repeat -0:30 1 /doodle_forever