|
ralgith Sorcerer
Joined: 13 Jan 2006 Posts: 715
|
Posted: Fri Oct 31, 2008 8:30 pm
When using a list as a trigger pattern, is it possible to determine... |
When using a list as a trigger pattern, is it possible to determine which list member fired the trigger and then use it in a manner similar to %1-%99?
For an example:
I have a list of George|Henry|Frank
I have a trigger %q{@List}%q
I receive the line
Lucy spanks Henry with a paddle!
So the trigger fires, and I want to be able to use Henry inside the script as I would if I had done
#TRIGGER {%w spanks (%w) with a paddle!}
In which case I could use %1 to refer to Henry.
Is this possible? If so how?
I tried doing ({@List}) to see if that would work, it did not. |
|
_________________ CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Fri Oct 31, 2008 9:46 pm |
({@List}) is the way to do it, it should be working. I haven't tested zMUD, only CMUD, but I can't imagine something like this remained bugged in zMUD.
|
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Fri Oct 31, 2008 9:48 pm |
({@List}) would be the correct syntax and should work. Your final pattern for your example line "^%w spanks ({@List}) with a paddle!$". This should have no problem capturing the matched List item to %1.
|
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
ralgith Sorcerer
Joined: 13 Jan 2006 Posts: 715
|
Posted: Fri Oct 31, 2008 10:49 pm |
Well, thats weird. Unless maybe its assigning it to a %n equal to the position in the list... I'll test that... though it SHOULDN'T be.
|
|
_________________ CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate |
|
|
|
ralgith Sorcerer
Joined: 13 Jan 2006 Posts: 715
|
Posted: Fri Oct 31, 2008 11:00 pm |
Ok, yeah, if I put it as ({@List}) it stops matching.
Tested by just having a trigger:
#TRIGGER {%q({@List)}%q} {#ECHO Fired}
Using the same list as before and in a blank session sending Henry to the window
If I remove the parens, it fires. |
|
_________________ CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Fri Oct 31, 2008 11:49 pm |
Your ) is inside the }, it should be outside. So }), not )}.
|
|
|
|
ralgith Sorcerer
Joined: 13 Jan 2006 Posts: 715
|
Posted: Sat Nov 01, 2008 3:04 am |
Yes, thats how I actually had it, i just manually typed whats here and mistyped.
|
|
_________________ CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate |
|
|
|
Rappy Wanderer
Joined: 15 Jul 2005 Posts: 96
|
Posted: Sun Nov 02, 2008 8:02 pm |
I use a list to grab people from my clan roster to change their color scheme, and my trigger is set up as %q({@clanmembers})%q and it fires correctly.
Works like that or (%q{@list}%q) as well, and it will capture to %1.
Check to see you don't have more than one trigger for it if it's still not working.
-Rappy |
|
_________________ Windows 11 Pro,
cMUD 3.34 |
|
|
|
|
|