|
kdberg Beginner
Joined: 06 Jan 2003 Posts: 18 Location: USA
|
Posted: Mon Jan 13, 2003 6:50 pm
On using triggers and substitute |
How can I change MUD output so that all occurences of SOUTH are replaced by S, and all occureneces of SOUTHWEST are replaced by SW? Thought I had it, but what I end up with is S for South and SW for SOUTHWEST, BUT southwestern (should not be changed at all) is replaced by SERN.
|
|
|
|
megamog75 Enchanter
Joined: 20 Nov 2002 Posts: 627 Location: USA
|
Posted: Mon Jan 13, 2003 7:05 pm |
Just add triggers for those as well?
That should solve your problem.
megamog75 |
|
|
|
Talahaski Enchanter
Joined: 10 Oct 2000 Posts: 656 Location: USA
|
Posted: Mon Jan 13, 2003 7:14 pm |
Add a space or comma in your trigger so when it sees SOUTHWESTERN is does not try to change the SOUTH in SOUTHWESTERN.
Example.
#TR {SOUTH } {#SUB "S "}
#TR {SOUTHEASTERN } {#SUB "SE "}
Don't forget to add the space back into the #SUB command.
Talahaski
Processor PIII 1000
Memory 265MB
Video NVIDIA 64MB
Windows XP
Zmud Version 6.40
Zmapper Version 1.14 |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Mon Jan 13, 2003 7:24 pm |
There's an %isnumber function but I couldn't find an %isletter one. This should do the same thing though.
#TR {South(?)} {#IF (((%ascii(%1) > 64) AND (%ascii(%1) < 91)) OR ((%ascii(%1) > 96) AND (%ascii(%1) < 123))) {} {#SUB S%1}}
You might need a second trigger for those instances when SOUTH is the final word on the line.
LightBulb
Senior Member |
|
|
|
kdberg Beginner
Joined: 06 Jan 2003 Posts: 18 Location: USA
|
Posted: Tue Jan 14, 2003 11:00 am |
LightBulb, Thanks, worked like a charm.
|
|
|
|
|
|