MUDL:post command

From SlothMUD Wiki
Jump to: navigation, search

Overview

The MUDL post functions get called after processing a command. This allows builders to react to something that just took place in an easier fashion.


Command Syntax

addproc <room|mobile|object> mudl
setproc <room|mobile|object> ## post_<command>_<arguments>


Global Variables

The following global variables are available:

Name Type Description
 %a Character The character or mobile that initiated the command.
 %c Character The mobile that the MUDL script is attached to. This value is null if the script is attached to a room or object.
 %f Integer Procedure Flags used to track interaction between different procedures.
 %o Object The item that the MUDL script is attached to. This value is null if the script is attached to a room or mobile.
 %room Room The room in the game where the script is being run. This value may be null if the script is attached to an area.
 %area Area The area (zone) in the game where the script is being run.
 %parent Character or Room or Area The in-game element that the MUDL script is attached to. It will be identical to %c or %room or %area.
 %procedure_index Integer The index of the current MUDL procedure on the %parent variable.
 %s String array The arguments following the command that have not been processed by the game. See the particular commands below for details on which arguments have been processed and which ones have been left in this array.
 %x Character The target of the current command.

Return Values

The return value from post functions is ignored. To modify game behavior after the post function, you should manipulate the Procedure Flags using the %f global variable.


Post Commands

The following post commands have been implemented.


post_arrival

Variables

The following local variables are available:

Name Type Description
 %s String Array  %s[1] contains the direction moved during this command.


Triggered Scripts

Special procedures are called on mobiles in the room, on the room, and on the area


Example

addproc <mobile> mudl
setproc <mobile> 0 post_arrival



setproc <mobile> 0 PROC_ENABLED 1
compile


post_cast_i

Variables

The following local variables are available:

Name Type Description
 %1 Integer Numeric id of the spell that was cast. The spell_name function can be used to compare the id against the name of a specific spell you are looking for.
 %s String Array The arguments typed after the spell name. Note that these could be anything to allow the post command to process spells cast at abnormal targets (doors, objects, miscellaneous keywords, etc).


Triggered Scripts

Special procedures are called on mobiles in the room, on the room, and on the area.


Example

addproc <mobile> mudl
setproc <mobile> 0 post_cast_i



setproc <mobile> 0 PROC_ENABLED 1
compile


post_play_ib

Variables

The following local variables are available:

Name Type Description
 %1 Integer Numeric id of the song that was played. The spell_name function can be used to compare the id against the name of a specific song you are looking for.
 %2 Boolean FALSE if this is the original play/sing and TRUE if this is a replay/resing of the song.
 %s String Array The arguments typed after the song name. Note that these could be anything to allow the post command to process songs played at abnormal targets (doors, objects, miscellaneous keywords, etc).


Triggered Scripts

Interrupts are called on all room procedures and mobile procedures for all mobiles in the room. When the script is called you are guaranteed that the player is able to play the song and that a valid song name was entered.


Example

addproc <mobile> mudl
setproc <mobile> 0 post_play_ib

setproc <mobile> 0 PROC_ENABLED 1
compile


post_sing_ib

Variables

The following local variables are available:

Name Type Description
 %1 Integer Numeric id of the song that was sung. The spell_name function can be used to compare the id against the name of a specific song you are looking for.
 %2 Boolean FALSE if this is the original play/sing and TRUE if this is a replay/resing of the song.
 %s String Array The arguments typed after the song name. Note that these could be anything to allow the post command to process songs sung at abnormal targets (doors, objects, miscellaneous keywords, etc).


Triggered Scripts

Interrupts are called on all room procedures and mobile procedures for all mobiles in the room. When the script is called you are guaranteed that the player is able to play the song and that a valid song name was entered.


Example

addproc template mudl
setproc template 0 post_sing_ib

setproc template 0 PROC_ENABLED 1
compile