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
luggage
Novice


Joined: 20 Jul 2004
Posts: 38
Location: Australia

PostPosted: Mon Jul 04, 2005 12:31 pm   

Confused with REGEX trigger
 
I am trying to work out REGEX triggers as I can see that they are much better. However I can across this problem when trying to add inventory control to my scripting.
Basically I do an 'inventory' command and trigger on the items carried.

This works fine:

inventory
*TK Combat Helmet - Enhanced (worn)
..etc

with expression of:

#REGEX {^ \*TK Combat Helmet (- Enhanced| ) (\(worn\)|$)}
{#IF ('- Enhanced' = %1) {#VAR tkhexist 2 0 tkset} {#VAR tkhexist 1 0 tkset};
#IF ('~(worn~)' = %2) {#VAR hworn {tk_helmet} none inv}
}

But.. if I try a similar story with a different item, it doesn't work the same.

inventory
*Sandtrooper all-terrain boots (worn)
..etc

#REGEX {^ \*Sandtrooper all-terrain boots( \(worn\)|$)}
{#VAR ssbexist 2 0 sandset;
#IF ('~(worn~)' = %1) {#VAR bworn {all-terrain boots} none inv
}

Regardless if I am wearing or not wearing the boots, it still triggers that they are worn. Any help would be very much appreciated.

Luggage
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