| |
- cmd_routine(ch, cmd, arg)
- Appends a routine onto a character. The second argument needs to be an
evaluable list statement. Put it in parentheses to avoid being cut off
as spaces, since parse treats it as a single word. Example:
> routine man "['say hi', (3, 'say I am a little teapot')]" True
this will say hi after the default delay, and I am a little teapot after
a delay of 3. It will then loop through this process indefinitely.
Alternatively, these commands can be replaced with function calls.
- do_step(ch)
- Performs the current step increments
- register_routine_check(check)
- adds a routine check to the global list. Must be a function taking one
argument, which is the character doing the routine. Return should be
True if the check succeeded (i.e., we should not do a routine)
- routine_event(owner, data, arg)
- this is the event that perpetuates NPC routines. Each NPC that has a
routine running has one of these events tied to him or her. When the
routine time expires, a check is made to see if the routine can go on.
If it can, the routine step is performed and the step number is
incremented
- set_routine(ch, routine, repeat=False, checks=None)
- Sets a routine to a character. Routine steps can constain commands
(character strings), functions (one argument, ch), or tuples
(delay, string | function). If a tuple is not supplied, the default
step time is used
- start_routine(ch)
- starts a character routine event in motion
- try_step(ch)
- Checks to see if we can perform a step in the routine. Returns true or
false if it did or not
|