Runtime Replacements by Daniel Stelzer


This utility extension allows players to define replacements to alter their own commands. It does not affect the world model or the game itself in any way, only the user interface.

With this extension installed, players have access to four new commands:

def input = output

This defines a new text replacement: all instances of the word "input" in commands will now be replaced with "output".

regex input = output

This similarly adds a new replacement, but this time "input" will be taken as a regular expression rather than a simple piece of text.

undef input

This allows the player to remove a previously-defined replacement. It actually removes *every* replacement which takes the given input, in case there are multiple.

macros

This shows the definitions which have been defined thus far.

Note that text replacements are taken to apply to whole words by default: if you redefine "o" to mean "open", then "o box" will become "open box" rather than "open bopenx". Regular expressions apply anywhere unless you specify otherwise, and thus can get around this if necessary.

Example: * Rezrov

"Rezrov"

Include Runtime Replacements by Daniel Stelzer.

The Antechamber is a room. "You have survived the dangers of the maze and escaped with your magical treasures! Now all that remains between you and victory are some locked doors to the east. Such tedium..."
The player carries a thaumaturgical sensor, a thaumaturgical dooropener, and a broken dooropener.

Instead of unlocking a locked door with the thaumaturgical dooropener:
     say "[The noun] [are] magically unsealed.";
     now the noun is unlocked.

The Red Chamber, the Orange Chamber, the Yellow Chamber, the Green Chamber, the Blue Chamber, the Indigo Chamber, and the Violet Chamber are rooms.
The Red Door is a locked door. It is east of the Antechamber and west of the Red Chamber.
The Orange Door is a locked door. It is east of the Red Chamber and west of the Orange Chamber.
The Yellow Door is a locked door. It is east of the Orange Chamber and west of the Yellow Chamber.
The Green Door is a locked door. It is east of the Yellow Chamber and west of the Green Chamber.
The Blue Door is a locked door. It is east of the Green Chamber and west of the Blue Chamber.
The Indigo Door is a locked door. It is east of the Blue Chamber and west of the Indigo Chamber.
The Violet Door is a locked door. It is east of the Indigo Chamber and west of the Violet Chamber.

After going to the Violet Chamber: end the story finally saying "You have escaped at last!"

Last after reading a command: say "[italic type][bracket]Command: '[player's command]'[close bracket][roman type][line break]"

Test boring with "unlock red door with thaumaturgical dooropener / go east / unlock orange door with thaumaturgical dooropener / go east".
Test text-define with "def t = thaumaturgical dooropener / unlock red with t / go east / unlock orange with t / go east".
Test regex-define with "regex rezrov (.+) = unlock \1 with thaumaturgical dooropener / rezrov red / go east / rezrov orange / go east".