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
doomfyre
Apprentice


Joined: 03 Jan 2002
Posts: 152
Location: USA

PostPosted: Fri Jul 05, 2002 8:07 pm   

How to ignore certain text, and capture other
 
The mud is Realms of Despair, using v6.26.

Heres the output:

You are using:
<used as light> the source of magie noire
<worn on finger> the shade ring
<worn on finger> the shade ring
<worn around neck> the captain's cloak
<worn around neck> the captain's cloak
<worn on body> the Spoils of Thievery
<worn on head> the shade helm
<worn on legs> godskull shinguards
<worn on feet> (Humming) chains of imprisonment
<worn on hands> (Glowing) Blessed gauntlets of the Templar
<worn on arms> (Glowing) the Ice Arm Guards
<worn about body> (Glowing) the Cloak of Royalty
<worn about waist> a girth of mangled hide
<worn around wrist> a lion-crested bracer
<worn around wrist> a lion-crested bracer
<wielded> (Humming) Lord Kahl's "ThievesBlade"
<dual wielded> (Humming) Lord Kahl's "ThievesBlade"
<worn on ears> a crystalline teardrop
<worn on eyes> the shades
(type 'garb' for a list of all wear locations)

What i've done is made a trigger to capure the long name of itmes i'm wearing to variables for each piece of eq. What i don't want to capture, is the (Glowing) and the {Humming}. Or in some cases, both of those, or even three such things could preceed a piece of eq. For example:

<wielded> (Glowing) (Humming) (Red Aura) The Blade of Evil

My trigger works well enough for items without anything before the item, it's just:

#TR {~<used as light~> (*)} {#var light "%1"}

etc, with one of those for each piece.

I know i could just put those items in the trigger, then capture whats after it, but i want the script im making to be useable by anyone, and everyone has different eq.

Let me know if this is enough info. Thanks for any help.
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Fri Jul 05, 2002 9:13 pm   
 
Your trigger will capture the (humming) etc
into %1. What you need to do is strip
those state messages out.

A simple way is like:

#TR {~<used as light~> (*)} {#var light %replace(%replace(%replace("%1","(Humming) ",""),"(Glowing) ",""),"(Red Aura) ","")}



Ton Diening
Providing untested answers that tend to be
more complicated than others.
Reply with quote
doomfyre
Apprentice


Joined: 03 Jan 2002
Posts: 152
Location: USA

PostPosted: Fri Jul 05, 2002 10:51 pm   
 
Works perfectly, thanks very much for your time

*edit*

One thing i forgot to mention. As you see, there are a few instances where there are 2 of the same wear location. There's a chance that these items may not be the same. I have variables for 2 different neck items, @neck and @2neck, but with the way your eq is listed, i anticipate that the way i have the triggers set up, the variable is going to be filled with whatever is in the second instance.

<worn on neck> an obsidian cloak
<worn on neck> a captains cloak

any ideas how to get around that?
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Fri Jul 05, 2002 11:47 pm   
 
What I tend to use for that kind of concept
is:

Erase what you had:
#TRIGGER {^You are using:} {#FORALL @V_Eq_Type {#VAR %i ""}

#VAR V_Eq_Type "finger|finger2|neck|neck2|body|head|legs|feet|hands|arms|waist|wrist|wrist2|wielded|wielded2|ears|ears2|eyes"

Then something like:
#TRIGGER {^~<* (%w)~>%s(%*)} {#IF (%null( @%1)) {#var %1 %replace( %replace( %replace( "%2", "(Humming) ", ""), "(Glowing) ", ""), "(Red Aura) ", "")} {#var [%1]2 %replace( %replace( %replace( "%2", "(Humming) ", ""), "(Glowing) ", ""), "(Red Aura) ", "")}}


Ton Diening
Providing untested answers that tend to be
more complicated than others.
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