Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
ljstern6758
Newbie


Joined: 02 Jan 2020
Posts: 1

PostPosted: Thu Jan 02, 2020 3:49 pm   

Creating a trigger from within an alias
 
Basically I'm trying to make a shortcut to create a trigger to color a name through an alias.

How this is intended to work is to type setnamecolor name color, and the trigger will be created with name as the pattern and color as, well, the color, so that when the name comes up in the mud output it gets colored.

Normally i would just type #trigger {name} {#CW color} to create the trigger, but that is a lot of typing when I have a lot of names to set colors for. But i want to put the trigger statement into an alias so the alias passes the name and color to create the trigger which would effectively be the same as typing #trigger {name} {#CW color}

I got the color part solved. I can't get the name part solved.

What I have so far is this:

#alias setnamecolor {#trigger {%1} {#CW %%2}

The thing is the %1 passes through as a literal string rather than passing the contents of %1 through. I have also tried %%1, &name, @name, (%1), (%%1), (%-1) and (%w) all to the same effect of the pattern created is the literal string of whatever is between the pattern {}.

I hope all this makes sense. Any and all possible solutions are welcome.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Fri Jan 03, 2020 11:24 am   
 
If you have multiple people with the same color, then I would suggest a variable for each color group, I go by guild myself.

#TR {{@warrior}} {#CW saddlebrown}

Then rather then make a whole new trigger, you just need to add a name to a variable.

#ADDITEM Warrior Jimbob

Making an alias for the #ADDITEM is a lot easier, though you almost don't even need an alias now.

As for forcing it to expand, I believe you can do that like so: #EXEC {#TR {%1} {#CW %2}}
_________________
Discord: Shalimarwildcat
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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