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
balberith
Newbie


Joined: 02 Aug 2002
Posts: 2

PostPosted: Fri Aug 02, 2002 11:20 pm   

Strange patterns and nested IF statements.
 
Im finding a little trouble with If statements and multiple wildcards.

For instance, i wish to pickup on the following pattern:
[51 Human Pri] [ Pirates ] (WANTED) mofoplay'er

so i use the following trigger
~[*~] ~[ ~P~i~r~a~t~e~s ~] ~(~W~A~N~T~E~D~) (%w~'%w)

which operates correctly, and colors thier name fine.

but when i use an if statement with a large OR expression, it does not seem to pick up things correctly.

I am tring to surpass the surname, and highlight only the charactors name, although not all players have surnames.

[51 Human Pri] [ Pirates ] (WANTED) Novitiate Tanoth,

use pattern:
~[*~] ~[ ~P~i~r~a~t~e~s ~] ~(~W~A~N~T~E~D~) (%w) (%w)

with this command:
#if (%1 != 'Novitiate' | 'Deacon' | 'Bishop' | 'Abbott' | 'Monsignor' | 'Cardinal')
#trigger {%1} {#cw 6} pk_names_active
#trigger {%2} {#cw 6} pk_names_active


now i threw #echo's in there and the variables do get picked up right, although the OR expression is always failing.

should i put both expressions in parens? (%1) != ('nov' | 'bish') ect?

Edited by - Troubadour on 08/04/2002 13:50:56
Reply with quote
Darker
GURU


Joined: 24 Sep 2000
Posts: 1237
Location: USA

PostPosted: Sat Aug 03, 2002 12:41 am   
 
This forum is for finished mud scripts only. Please post questions in the General forum. Thanks!



zMUD 6 Online Help: All the power you'll ever need.
Reply with quote
LEit
Novice


Joined: 27 Jul 2002
Posts: 38
Location: USA

PostPosted: Mon Aug 05, 2002 4:07 pm   
 
Try:
#if (!%ismember(%1, 'Novitiate|Deacon|Bishop|Abbott|Monsignor|Cardinal')

or

#if (%1 != 'Novitiate' and %1 != 'Deacon' and %1 != 'Bishop' and %1 != 'Abbott' and %1 != 'Monsignor' and %1 != 'Cardinal')
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Mon Aug 05, 2002 6:55 pm   
 
Didn't we already do this?

Expressions and If statement help

LightBulb
Senior Member
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