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
Dyron
Apprentice


Joined: 08 Apr 2004
Posts: 103
Location: USA

PostPosted: Wed Oct 08, 2008 2:15 am   

Char check
 
[csdb eb]


I need to make a trigger to examine this line..

Example 1:
[cspdb eb] If this..I want it to:

#say Paralysis check!

Example 2:
[csd eb]

#say Deaf Check!

Example 3:
[csb eb]

#say Blindness Check!

[eb]

#say Blindness Check
#say Deaf Check
#say Cloak Check
#say Sileris Check

Basically.. This is as many items that will be in the list [cspdb eb]

This is the normal list:
[csdb eb]

If anything is missing out of that list, I want to make a check for it.

Thanks for any clues you all might have
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Wed Oct 08, 2008 8:05 am   
 
If this is part of your prompt, you'll probably want to add this to the end of your prompt trigger rather than creating a new one. Anyway, here's a regex:

[(c)?(s)?(p)?(d)?(b)? ?(e)?(b)?]

In some MUDs that use that system, the e and b are replaced with dashes rather than removed, in which case you'll want to use:

[(c)?(s)?(p)?(d)?(b)? ?([e\-])([b\-])]

Then you do

#if (%1) {whatever}

to check for c, %2 for s, %3 for d, etc etc. If your MUD uses dashes rather than removing the e and b, you'll need to use

#if (%pos("e",%6)) {whatever}

to check for those.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)

Last edited by Fang Xianfu on Sat Oct 11, 2008 6:18 pm; edited 1 time in total
Reply with quote
Dyron
Apprentice


Joined: 08 Apr 2004
Posts: 103
Location: USA

PostPosted: Sat Oct 11, 2008 5:12 pm   
 
Hrmm.. I can't make this work..

The only time that will shoot is if the p is in there.. If the p isn't there.. I still want to be able to check for the rest of them
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sat Oct 11, 2008 6:19 pm   
 
I'd made a mistake in the pattern. Fixed now.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Dyron
Apprentice


Joined: 08 Apr 2004
Posts: 103
Location: USA

PostPosted: Sun Oct 12, 2008 12:06 am   
 
The problem is if the (p) is not present the trigger no longer shoots.. The p is only there if I"m paralyzed or prone.. which is the only reason I want to check for it.
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sun Oct 12, 2008 8:44 am   
 
Yes, I'd made a mistake in the pattern and missed out the p, so it'd only fire if it wasn't there. It's fixed now:

[(c)?(s)?(p)?(d)?(b)? ?(e)?(b)?]
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
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