Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Full Throttle
Wanderer


Joined: 07 Dec 2004
Posts: 65

PostPosted: Wed Dec 08, 2004 12:02 am   

Multiline Ansi Trigger
 
Each trigger works fine separately, but the 2nd trigger doesn't store the current room when the 3rd trigger is enabled.

1st trigger (used to store current room name when brief mode is off):

note: brief mode is a mud command that toggles room descriptions on or off

Code:
#trigger {^%e[36m(*)$^%e[37m%s%w} {#var current_room "%1"} "" {color}


2nd trigger (used to store current room name when brief mode is on):

Code:
#trigger {^%e[36m(*)$^%e[36mExits} {#var current_room "%1"} "" {color}


3rd trigger (used to store room exits in a list):

Code:
#trigger {^Exits: (*)} {#var exit_target %null
#if !(%word(%1,1) = %null) {#additem exit_target %word(%1,1)}
#if !(%word(%1,2) = %null) {#additem exit_target %word(%1,2)}
#if !(%word(%1,3) = %null) {#additem exit_target %word(%1,3)}
#if !(%word(%1,4) = %null) {#additem exit_target %word(%1,4)}
#if !(%word(%1,5) = %null) {#additem exit_target %word(%1,5)}
#if !(%word(%1,6) = %null) {#additem exit_target %word(%1,6)}
#if (@exit_target = %null) {#var exit_target None}}


Mud text without emulation, with brief mode off:

Code:
<27>[36mTown Hall<27>[37;40m<27>[36m<27>[37;40m
<27>[37m   This cramped room barely has room enough for the large desk which
sits in the middle of the room.  On every wall, paperwork of every
color and description can be seen hanging.  The floor is heavily
scuffed and the room has very little ventilation due to the complete lack
of windows.  Hanging from the ceiling is a small lamp which barely puts
out enough light to see by.<27>[37;40m
<27>[36mExits: <27>[37;40m<27>[36mNorth  West   <27>[37;40m


Mud text without emulation, with brief mode on:

Code:
<27>[36mTown Hall<27>[37;40m<27>[36m<27>[37;40m
<27>[36mExits: <27>[37;40m<27>[36mNorth  West   <27>[37;40m


I want the variable current_room to store "Town Hall" and the variable exit_target to store the list {North|West} when brief is on or off.

Also, I had a trigger the colored the text "Exits:" in purple with the #cw command, but this conflicts with the 2nd trigger as well.

Thanks, F.T.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Wed Dec 08, 2004 10:12 am   
 
The multiline pattern in your trigger is likely causing the problem. Replace this
Code:
#trigger {^%e[36m(*)$^%e[36mExits} {#var current_room "%1"} "" {color}
with a multistate trigger.
Code:
#trigger {^%e[36m(*)} {} "" {color}
#COND {^%e[36mExits} {#var current_room "%t1"} "" {color|within|param=1}
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net