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


Joined: 20 Sep 2002
Posts: 26
Location: Austria

PostPosted: 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
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: 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.
Reply with quote
sp000n
Novice


Joined: 04 Jul 2001
Posts: 32

PostPosted: Wed Aug 27, 2003 6:54 am   
 
There's something wrong with your MUD output. It's like.. in German, or something.


;o)
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