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


Joined: 07 Feb 2008
Posts: 3

PostPosted: Sat Oct 04, 2008 5:15 am   

Alias for trigger.. local var is not expanding
 
Hi all,

My alias is this:

#alias white($name) {#trigger {$name} {#cw white}}

but when I run white abc, $name is the trigger and not abc.

Also, I used to have a hotkey in zmud. It was a macro with a variable as the output. I would assign aliases to the variable and they would expland in zmud, but they don't in cmud. Any ideas there? Thanks.
Reply with quote
shalimar
GURU


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

PostPosted: Sat Oct 04, 2008 7:54 am   
 
did you try forcing it with %expand($name)

i tend to use the following:

#ALIAS white {#ADDITEM white {%params}}
#TR {{@white}} {#CW white}

for the macroes try:

#EXEC {aliasname}
_________________
Discord: Shalimarwildcat
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Sat Oct 04, 2008 8:00 am   
 
Your first seems to be a bug, but I think it'd be much simpler if you used a variable to contain your list of names and used a single trigger, like so:

#alias white($name) {#additem WhiteList $name}
#trigger {{@WhiteList}} {#cw white}

This way you have fewer triggers trying to match at once, fewer triggers clogging up your view in the package editor and best of all, it's trivial to remove someone again - just use #delitem.

Your second seems to be working just find in CMUD 2.36, is that your version?

#key {CTRL-8} {@test}
test=boo

press ctrl and 8 at the top of the keyboard, and presto.

EDIT: One thing that might be causing it, thinking about it, is if you created the macro using the package editor. You need to put your cursor in the Key box, press enter and THEN press the key. Just pressing it will put the actual character in there and not the internal name of the key - you'll see what I mean if you use it to set macros for the numpad.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
shalimar
GURU


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

PostPosted: Sat Oct 04, 2008 8:13 am   
 
heh, copycat, and welcome back Fang.
_________________
Discord: Shalimarwildcat
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Sat Oct 04, 2008 12:40 pm   
 
Actually, another easy way to do this is the following:

#ALIAS white($name) {#EXEC {%concat("#TRIGGER {",$name,"} {#CW white}")}

*shrug* But Fang is correct - it's much easier to do it like he's got it because it'll create far less triggers and you can easily remove a name without having to search through possibly hundreds of triggers for a name in your list.

Charneus
Reply with quote
tolan182
Newbie


Joined: 07 Feb 2008
Posts: 3

PostPosted: Sun Oct 05, 2008 8:42 pm   
 
Thanks a lot! I used Fang's solution for the first one and it works great and then adding #exec fixed the other one, Shalimar.
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