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


Joined: 12 Jun 2002
Posts: 13
Location: Canada

PostPosted: 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]
Reply with quote
Rose
Beginner


Joined: 23 Oct 2003
Posts: 15

PostPosted: 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}
Reply with quote
Toetag
Magician


Joined: 10 Oct 2000
Posts: 356
Location: USA

PostPosted: 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.
Reply with quote
GelRoos
Beginner


Joined: 12 Jun 2002
Posts: 13
Location: Canada

PostPosted: 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
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: 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}
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