luggage Novice
Joined: 20 Jul 2004 Posts: 38 Location: Australia
|
Posted: 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 |
|