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


Joined: 09 Aug 2002
Posts: 12
Location: Norway

PostPosted: Fri Aug 09, 2002 12:43 pm   

%pos(a,b)
 
I'm trying to recognize "something" in the last recieved line. The problem is that sometimes I recieve "something else" from the mud, which will also match my expression, which is

%pos(something,%line)

I've tried to put in pattern matching like

%pos((something*(^else)),%line)

in different variations, but can't seem to get it to work :( Doesn't the patternmatching work with functions? Please help!










Also, I've been having problems with triggers using complex patterns. I've been trying to get this trigger to work properly, but can't :(

#trigger {{^@npcs}*{tells|says|informs}*you} {#capture comwindow}

It's supposed to match tells etc. from anyone not listed in the @npcs-variable.

Your help would be greatly appreciated!
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Fri Aug 09, 2002 2:09 pm   
 
Why can't you recognize the "something" using a trigger like you would normally recognize anything sent in the last line?

No, functions cannot use patterns. Patterns are only used in triggers and with the pattern matching operator.

And for your last problem, the {^text} pattern expression does not work that way, it uses plain text only. If you need to match only those which are not in the variable then you an change it to this:
#TRIGGER {(%w)*{tells|says|informs}*you} {#IF (!%ismember(%1, @npcs)) {#CAPTURE comwindow}}

Kjata
Reply with quote
fossie
Beginner


Joined: 09 Aug 2002
Posts: 12
Location: Norway

PostPosted: Mon Aug 12, 2002 8:46 am   
 
Thanks for replying :)

What I'm trying to do is not to use *'s in my triggers to avoid the horrible slowdown effect. Instead I trigger just the plain text, capture the text in a variable using the %line function, and work with the captured line from there. I've had some success with this, very much thanks to all of you on this board :)

Is there a way of checking wether the captured line contains one or more of the words in a variable list?

#var @pc1 {Fred};
#var @pc2 {Wilma};
#var @pc3 {Kjata};
#var @pcs {@pc1|@pc2|@pc3}

I've tried using a trigger

Pattern:
{tells you|asks|informs you}
Commands:
#math test {%numwords(%line,@pcs) - 1};
#if @test>0 {#capture comwindow}

This should check if any person found in the @pcs variable is found in the captured line. Unfortunately it doesn't work :( I found that it works if I use a variable containing a single name, e.g @pc1 instead of @pcs, but I want to check for any of the names I've listed in my variable...

Can this be done?

Thanks!
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Mon Aug 12, 2002 12:10 pm   
 
Sorry, zMUD just wasn't desgined for this. The best way is to put the @pcs variable in the trigger pattern. Since you are already sending the trigger to the slower wildcard parser (since you are matching {tells you|asks|informs you}), it wouldn't slow it down so much to add {@pcs} to the pattern.

Kjata
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