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


Joined: 16 Apr 2009
Posts: 1

PostPosted: Thu Apr 16, 2009 10:35 pm   

Alias Setting Triggers with Variables - Possible?
 
Hi Everyone

This is my doubt on zMUD:

I want to be able to set an Alias (lets say it's called DIE) that, followed by a certain parameter (name), sets up a trigger for coloring that name every time it appears.

I thought this could work:

The Alias Die would do this:

#CLASS Die
#VAR die %1
#TRIGGER {{@die}} {#CW "#FF0000"}


But it seems the Trigger doesn't recognise (when it's being set) the variable or any wildcard, right? How can I go around this?



Thank you
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Fri Apr 17, 2009 4:02 pm   
 
This worked for me. Are you saying you want to store a wild card, e.g. '?', '*' in the die variable?

If I run the test with just cow it works fine.

My zMud memory is getting rusty, but I'm fairly sure that you can't use wildcards in variable list expansions like you are doing with the trigger. If I've completely missed what you mean can you explain in more detail exactly what is not working.
_________________
Asati di tempari!
Reply with quote
ralgith
Sorcerer


Joined: 13 Jan 2006
Posts: 715

PostPosted: Fri Apr 17, 2009 7:59 pm   
 
Isn't there an option you can turn on to allow that?
_________________
CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Fri Apr 17, 2009 11:55 pm   
 
There's an option on I believe the General Preferences page called "Use wildcards in stringlists" or something similar. Barring that, you could try for the [] pattern, which inherently allows you to use wildcards in them (ie, [%w] is the same as [A-z]).
_________________
EDIT: I didn't like my old signature
Reply with quote
ralgith
Sorcerer


Joined: 13 Jan 2006
Posts: 715

PostPosted: Sat Apr 18, 2009 2:42 pm   
 
Ok, now that I'm revisiting this, I can see where he's gone wrong anyways. He'll want a stringlist for die, not a straight up var.

So your script should be:
Code:
#CLASS {Die Highlight}
#ALIAS die {#CLASS {Die Highlight};#ADDITEM die_list "%1$";#CLASS 0}
#VAR die_list {}
#TRIGGER {{@die_list}} {#CW "#FF0000"}
#CLASS 0


And if you want to be able to add a wildcard such as:
die George*
to the stringlist and have it work for matching then you need to turn on the option Matt mentions above. The one I couldn't remember if it existed or not.

Good Luck
_________________
CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate
Reply with quote
xiangwei
Beginner


Joined: 17 Apr 2004
Posts: 18

PostPosted: Mon May 11, 2009 10:11 am   
 
looking of you
thank you
good luck
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