|
rui Beginner
Joined: 15 Aug 2002 Posts: 29 Location: Portugal
|
Posted: 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? |
|
|
|
Larkin Wizard
Joined: 25 Mar 2003 Posts: 1113 Location: USA
|
Posted: 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... |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: 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 |
|
|
|
TonDiening GURU
Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: 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 |
|
|
|
gedron Beginner
Joined: 01 Feb 2003 Posts: 15
|
Posted: 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. |
|
|
|
rui Beginner
Joined: 15 Aug 2002 Posts: 29 Location: Portugal
|
Posted: Thu Apr 17, 2003 12:44 am |
Thx a lot for the help guys :)
|
|
|
|
virtuous Wanderer
Joined: 08 Jan 2003 Posts: 60
|
Posted: Thu Apr 17, 2003 2:20 pm |
Where I live, *everybody* says it so it rhymes with "fudge". :P
|
|
|
|
Wrudyn Novice
Joined: 24 Mar 2003 Posts: 44 Location: USA
|
Posted: 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.
|
|
|
|
|
|