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
ralgith
Sorcerer


Joined: 13 Jan 2006
Posts: 715

PostPosted: 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
Reply with quote
Fang Xianfu
GURU


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

PostPosted: 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.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: 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
Reply with quote
ralgith
Sorcerer


Joined: 13 Jan 2006
Posts: 715

PostPosted: 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
Reply with quote
ralgith
Sorcerer


Joined: 13 Jan 2006
Posts: 715

PostPosted: 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
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Fri Oct 31, 2008 11:49 pm   
 
Your ) is inside the }, it should be outside. So }), not )}.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
ralgith
Sorcerer


Joined: 13 Jan 2006
Posts: 715

PostPosted: 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
Reply with quote
Rappy
Wanderer


Joined: 15 Jul 2005
Posts: 96

PostPosted: 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
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