MUDL:Timer

From SlothMUD Wiki
Revision as of 18:10, 11 March 2016 by Teker (Talk | contribs)

Jump to: navigation, search

Overview

This MUDL function gets called each time the room or mobile timer goes off. This is guaranteed to be at a regular interval - currently every 10 seconds.


Command Syntax

addproc <room|mobile> mudl
setproc <room|mobile> ## timer_#

Note that the # sign after the timer indicates how frequently the function is called. A value of 1 indicates the function should be called every time the timer fires. A value of N indicates the function should be called every Nth time the timer fires.


Global Variables

The following global variables are available:

Name Type Description
 %c Character The mobile that the MUDL script is attached to. If the script is attached to a room, this value is NULL.
 %r Room The room that the MUDL script is attached to. If the script is attached to a mobile, this value is NULL.


Return Values

The return value from this function is ignored.


Triggered Scripts

Only mobile scripts are triggered by this event. They are triggered at a regular interval regardless if the mobile is idle, fighting, or otherwise engaged.


Example

addproc <mobile> mudl
setproc <mobile> 0 timer_1

cmd(%c, 'say The timer is firing now!'),
return(true)
@


setproc <mobile> 0 PROC_ENABLED 1
compile