|
Baldur Beginner
Joined: 20 Sep 2002 Posts: 26 Location: Austria
|
Posted: Tue Aug 26, 2003 10:47 am
Trigger with CrLf? |
Hi,
i have a little problem with a trigger to show the state of my equipment. This is the Mud-Output:
Am Koerper getragen: Ein Drachenpanzer (hervorragender Zustand)
The value in the Brackets shows the state and i want to replace the Text with a value in percent.
e.g.:
Am Koerper getragen: Ein Drachenpanzer (100%)
I have tried to solve this with a Trigger like this:
#TRIGGER {~((*) Zustand~)} {#if (%trim( %1)="hervorragender") {#sub {%ansi(bold)"(100%)"}}
This will work fine on this line:
Am Koerper getragen: Ein Drachenpanzer (hervorragender Zustand)
but, of course, it will not work if this situation appears:
Am Koerper getragen: Ein Drachenpanzer (ziemlich schlechter
Zustand)
There are ten possibilities for the state:
- hervorragender Zustand
- sehr guter Zustand
- guter Zustand
- ziemlich schlechter Zustand
and so on
Does anyone has an idea how i can solve this problem?
Nice greetings
Baldur |
|
|
|
Larkin Wizard
Joined: 25 Mar 2003 Posts: 1113 Location: USA
|
Posted: Tue Aug 26, 2003 1:55 pm |
If your trigger line is always split across the two lines, you can use a multi-state trigger to efficiently catch both lines. Try something like this:
#VAR LineState ""
#TRIGGER {~((*)} {LineState = %1}
#COND {(*)~)} {LineState = %concat(@LineState, %1);#sub {%ansi(bold)"(100%)"} {WithinLines|Param=1}
You'll need to actually check the value of LineState to see what percentage you need to substitute, but hopefully this works or at least gives you some ideas. Also note, this works on two-line messages, but will not catch a single line message. |
|
|
|
sp000n Novice
Joined: 04 Jul 2001 Posts: 32
|
Posted: Wed Aug 27, 2003 6:54 am |
There's something wrong with your MUD output. It's like.. in German, or something.
;o) |
|
|
|
|
|