Room Scripts

Room scripts allow you to assign commands to a room that are executed when you enter the room. Any settings defined in a room script are added to a temporary Class and are removed when you exit the room. This allows you to define aliases, triggers, buttons, etc that are only active in a particular room.

To create a room script, open the Properties for a room. Below the Room Name and Description fields is an area for the Room Script. Enter any normal zMUD scripting commands. Newlines are replaced with the current command separator (;) character when you save.

For example, a room script of:

list
#button 0 {Buy Bread} {buy bread}
#button 0 {Buy Potion} {buy potion}

will define two buttons, one for buying bread, and another for buying a potion. When you enter the room, the 'list' command is automatically sent to the MUD. This might be useful in a store where you want to see what is for sale and then buy stuff by just hitting a button. The buttons will be removed when you exit this room.

The combination of room scripts and offline mapper usage allow you to turn zMUD into a powerful Dungeon Master tool or for developing offline D&D scenarios.

Note that the room script is only executed when you move into a room. It is not executed if you manually select the current room on the map. To execute a room script for a given room, right-click on the room and select Execute Room Script from the popup menu.



Contents Overriding the Mapper