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


Joined: 07 Oct 2008
Posts: 5

PostPosted: Thu Jun 17, 2010 2:38 am   

Help With Alias
 
So I just got Cmud and am having an issue with a difference between Zmud and Cmud. In Zmud I could create an alias such as bs which would execute backstab, and then I could use it in the following way. I would type bs orc and it would backstab orc, but in Cmud when I do the same alias bs for backstab and try to do bs orc it just executes backstab and not backstab orc. Help please.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Thu Jun 17, 2010 2:54 am   
 
you have options.

1)aliases in cmud can now have named parameters. These are temporary variables (ie, $target) that you can then immediately use in your alias code:

#alias bs($target) {backstab $target}

2)use the %1...%99 variables. In the case of aliases, each word attached to the alias command counts as one %1...%99 variable, like so:

bs the big ugly orc
alias = bs
%1 = the
%2 = big
%3 = ugly
%4 = orc

You can also refer to "phrases" consisting the argument position () and every word after that:

%-1 = the big ugly orc
%-2 = big ugly orc
%-3 = ugly orc
%-4 = orc

Using these in the alias works the same as the temporary variables shown in #1, except that you don't need to define them in the #ALIAS command syntax. This works in ZMud, too.

3)In the Package Editor, when looking at the More Info panel for the alias you should see two checkboxes on the right edge of the panel. One says Auto Append, the other says Parse Arguments. To do what you were doing in ZMud, I believe you need at least the Auto Append one checked if not both of them.
_________________
EDIT: I didn't like my old signature
Reply with quote
GeneralStonewall
Magician


Joined: 02 Feb 2004
Posts: 364
Location: USA

PostPosted: Thu Jun 17, 2010 4:15 am   
 
Yeah, auto-append is the one that was added for zmud-like functionality.
Reply with quote
Masa
Newbie


Joined: 07 Oct 2008
Posts: 5

PostPosted: Thu Jun 17, 2010 4:55 am   
 
Thank you guys very much, this is a great help.
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