EVENT
Syntax: #EV event_name {commands}
Related: #TRIGGER, #RAISEEVENT
An Event is similar to a trigger, but instead of firing when text from the MUD is received, it is fired internally by CMUD, or using the #RAISEEVENT command.
The pre-defined event names are:
- OnConnect
- fires when connecting to a session
- parameters of WindowName HostName and ReconnectFlag are supplied
- OnDisconnect
- fires when disconnecting from a session
- OnExit
- fires when closing a session window
- OnLoad
- fires when a module/window is first loaded (added to v2.12)
- OnRoomEnter
- fires when entering a room
- OnWalkEnd
- fires at the end of a speedwalk
- OnRoomWalk
- fires when speedwalking through a room
- OnRoomCreate
- fires when a new room is created on the map
- OnTickWarning
- fires when a tick is about to happen
- OnTick
- fires when a tick happens
You can create your own events by just specifying your own unique EventName. The #RAISE command can pass arguments to your event, which are accessed via the %1..%99 variables just like with triggers. Named arguments can be used, the same as with Aliases.
RAISE example
#EVENT MyEvent {#SHOW MyEvent: %1}
#RAISE MyEvent "test" Causes the MyEvent event to fire, which displays "MyEvent: test" to the screen.