|
GelRoos Beginner
Joined: 12 Jun 2002 Posts: 13 Location: Canada
|
Posted: Mon Dec 01, 2003 8:13 am
Pattern matching help |
Hey All,
I am trying get my armor when it gets hit to be put in another window.
(a Bloody eyepatch gets damaged)
Okay my trigger looks like this
Pattern: (%w gets damaged)
Response: #win EQ %1
Now my problem is it keeps missing word that is right behind ( and the following word after that do not show up in window. all it spits in window is:
eyepatch gets damaged
I tried the response #WIN EQ %w but all it did was spit %w up in window and tried removeing "(" in Pattern all it did was take me to window and do nothing. hoping somebody out there can get me going in the right direction
[8] |
|
|
|
Rose Beginner
Joined: 23 Oct 2003 Posts: 15
|
Posted: Mon Dec 01, 2003 8:28 am |
I think %w matches just 1 word, and you have 3 words there.
Try with pattern
#trigger {(*) gets damaged} {#win EQ %1} |
|
|
|
Toetag Magician
Joined: 10 Oct 2000 Posts: 356 Location: USA
|
Posted: Mon Dec 01, 2003 9:20 pm |
%w matches any number of Alpha characters. So as rose said, use *.
Check the help for: Pattern Matching for all the available wild cards. |
|
|
|
GelRoos Beginner
Joined: 12 Jun 2002 Posts: 13 Location: Canada
|
Posted: Tue Dec 09, 2003 12:45 am |
Okay Well i tried the above suggestion and got a little better but pretty much same results currently i have the following
#trigger{(* gets damaged)}{#winEQ %1}
and it gives me half of name of equipment it seems to grab I tired mucking with placing a space between variable and that only still not to be able to get the full name come up in window This i think is cause the first word of the letter starts behind the bracket (no space).
I still fiddeling with it but could use some more guidance please :)
Heres the results of the current position with the above trigger:
MUD: (a Bloody eyepatch gets damaged)
Window: eyepatch gets damages
GelRoos |
|
|
|
TonDiening GURU
Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Tue Dec 09, 2003 12:49 am |
Try:
#TRIGGER {~((*) gets damaged~)} {#WIN EQ %1}
The pattern (*) will be forced to match everything from the first open bracket to the word gets. As the pattern is sent from the mud with special characters () I put a ~ in front of them to tell zMud to literally expect those brackets.
Edit:
Thought about the amount of spam that window would get and you might want to time stamp things in it.
#TRIGGER {~((*) gets damaged~)} {#WIN EQ %time(hh:nn) %1 gets damaged} |
|
|
|
|
|