|
Dyron Apprentice
Joined: 08 Apr 2004 Posts: 103 Location: USA
|
Posted: 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 |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: 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. |
|
|
|
Dyron Apprentice
Joined: 08 Apr 2004 Posts: 103 Location: USA
|
Posted: 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 |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Sat Oct 11, 2008 6:19 pm |
I'd made a mistake in the pattern. Fixed now.
|
|
|
|
Dyron Apprentice
Joined: 08 Apr 2004 Posts: 103 Location: USA
|
Posted: 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.
|
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: 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)?] |
|
|
|
|
|