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
rui
Beginner


Joined: 15 Aug 2002
Posts: 29
Location: Portugal

PostPosted: Wed Apr 16, 2003 11:30 am   

Problem with #SUB
 
I have the following trigger, which, dependant on the race I choose when connecting, will color and change especific tracks from autotrack:

Pattern:
^There are * of a trolloc leaving (%w).$
Value:
#if (@race=1 OR @race=2) {
#COLOR red
#SUB {bloody} {*BLOODY*}
#SUB {west} {~<~<-WEST-~<~<}
#SUB {east} {~>~>-EAST-~>~>}
#SUB {north} {^^-NORTH-^^}
#SUB {south} {vv-SOUTH-vv}
}

It works very well, making the correct substitutions, BUT it also creates 5 new triggers, 1 for each #SUB, which in turn will mess everything from then on.

What are my options? Is it possible for the #SUB to NOT create the new triggers? Or can I just delete them automatically after this trigger end (sounds stupid)? Or is there another way to replace strings?
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Wed Apr 16, 2003 4:56 pm   
 
You could try using #TEMP instead to create a trigger that will go away when it fires.

I'm not sure what happens if a #TEMP trigger never fires. I would assume that you need to setup parameters, like an alarm or within N lines...
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Wed Apr 16, 2003 5:11 pm   
 
Is it possible for the #SUB to NOT create the new triggers?
Not the way you're using it.
#SUB {pattern} {replacement text}
is the same as
#TR {pattern} {#SUB (replacement text}}

Or can I just delete them automatically after this trigger end (sounds stupid)?
Yes.
#UNTR {bloody}

Or is there another way to replace strings?
I'd just make those triggers permanent, but create a subclass to hold them. Then, I'd have the first trigger enable the class and another trigger (probably a #COND to the first trigger) to disable it when finished.
#T+
#T-


LightBulb
Advanced Member
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Wed Apr 16, 2003 5:31 pm   
 
Kludge it all together?

Trigger
^There are (*) of a trolloc leaving (%w).$
Value:
#if (@race=1 OR @race=2) {
#COLOR red
#VAR TrackDistance %replace( {%1}, "bloody", "*BLOODY*")
#IF (%2 = west) {#SUB {There are @TrackDistance of a trolloc leaving ~<~<-WEST-~<~<}} {#IF (%2 = east) {#SUB {There are @TrackDistance of a trolloc leaving ~>~>-EAST-~>~>}} {#IF (%2 = north) {#SUB {There are @TrackDistance of a trolloc leaving ^^-NORTH-^^}} {#SUB {There are @TrackDistance of a trolloc leaving vv-SOUTH-vv}}}}}

Ton Diening
Reply with quote
gedron
Beginner


Joined: 01 Feb 2003
Posts: 15

PostPosted: Thu Apr 17, 2003 12:15 am   
 
Just as a side note...

Kludge rymes with Scrooge NOT Fudge.

Had a guy I worked with say it the other way once and almost peed my pants.
Reply with quote
rui
Beginner


Joined: 15 Aug 2002
Posts: 29
Location: Portugal

PostPosted: Thu Apr 17, 2003 12:44 am   
 
Thx a lot for the help guys :)
Reply with quote
virtuous
Wanderer


Joined: 08 Jan 2003
Posts: 60

PostPosted: Thu Apr 17, 2003 2:20 pm   
 
Where I live, *everybody* says it so it rhymes with "fudge". :P
Reply with quote
Wrudyn
Novice


Joined: 24 Mar 2003
Posts: 44
Location: USA

PostPosted: Thu Apr 17, 2003 4:09 pm   
 
Well, I'll be damned, according to the dictionary, it *is* pronounced klooj. Now that I think of it, I've never actually heard someone say the word before.
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