Saturday, January 9, 2021

Mozart Mud and cmud mapping

 

If you play Mozart MUD and use cmud client, the following will capture room descriptions to the map.  It's not elegant code wise in that it requires a special color combination for room descriptions to enable the scripts to only see the room lines, build up the description and then update on the description termination Terrain.

Both Mozart and cmud have configurations so your results may vary and require tweaking, 

Variables

flag to turn description capture on/off
#var roomdesc 1

holds the captured text of a description
#var description_store ""

a placeholder to capture result of function so as not to display on mud
#var result

Aliases

<alias name="roomson" id="136">
 <value>#var roomdesc 1;#show you have turned on update room desc.</value>
</alias>

<alias name="roomsoff" id="137">
  <value>#var roomdesc 0;#show you have turned off update room desc.</value>
</alias>

Triggers

Creates a trigger that matches any text that matches a foreground/background color.  The description color has to be a unique combo. each line is captured and adds it to the description_store variable and then when the 2nd trigger "Terrain:" hits, it updates the map room description

<trigger priority="1310" regex="true" linecolor="112" id="131">
 <pattern>(.*)</pattern>
<value>#var description_store %concat(@description_store,%1)</value>
</trigger>

<trigger priority="1330" id="133">
<pattern>Terrain:</pattern>
 <value>
#if (@roomdesc == 1) {
#var foo %roomdesc(%roomvnum,@description_store);
}
#var description_store "";
</value>
</trigger>

No comments:

Post a Comment