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
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Fri Sep 16, 2011 3:04 am   

Alias "Stacking"
 
I got a message from someone in my game. Apparently I'm the resident CMUD guru, even if I don't always feel like one. Anyways, here's the message:

Quote:

Hey Shanked,

Heard from Dronnie you are the CMUD pro.

I've just purchased a CMUD, so I am pretty new to this.

Do you have any idea why I can't stack alias with physically typed in commands, or stack 2 alias at one go?

For eg.

alias oar = order all rescue
alias D = Drondon

oar D doesnt work, because the command entered comes out as order all rescue.

Is there a setting that I should modify to make this work?

I know it used to work on Zmud.

Let me know if you can help out. Thanks.


I could devise an Alias for them that would work like they wanted AND take up less namespaces, so that's the route I want to go. But I'm curious if this is something that is NOT a carry over from zMUD so I'm not lying if I say it's working as intended.
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
janibeg
Newbie


Joined: 11 May 2011
Posts: 3

PostPosted: Fri Sep 16, 2011 7:39 am   
 
use
#alias oar {order all rescue %0}
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Fri Sep 16, 2011 3:05 pm   
 
Well, first of all, the command is coming out as order all rescue because parameters aren't automatically tacked on to the end of an alias anymore. There's no setting for that, you just need to change the oar alias to order all rescue %-1. Secondly, if that worked in zmud, it was probably a bug, aliases should only fire at the start of the line so the D wouldn't expand. I'd normally say use a command input triggers if you wanted to have the equivalent of an alias that would fire if you type it anywhere on the line, but obviously you wouldn't want d to be replaced with drondon every time you type it. The only way I can think of to do this is with a database variable.
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Fri Sep 16, 2011 3:52 pm   
 
Yeah, apparently I just read it wrong and she assumed the parameters would get stacked on at the end of the alias. A much easier question to answer (that I DO happen to know the answer to). Razz

See, this was my interpretation:
Code:

<class name="alias name" id="1168">
  <alias name="oar" id="1169">
    <value>#SWITCH (%iskey( nameList, %params)) {#SEND {%concat( "order all rescue ", %db( nameList, %params))}}
  {#SEND {%concat( "order all rescue ", %params)}}</value>
  </alias>
  <alias name="name" id="1170">
    <value><![CDATA[#SWITCH (%begins( %1, "add")) {
  #ADDKEY nameList %2 %-3
  #PRINT %concat( %ansi( 10), %2, " alias name set to: ", %ansi( 14), %-3, %ansi( reset))
  }
  (%begins( %1, "delete")) {
  #IF (%iskey( nameList, %1)) {#DELKEY nameList %1}
  #PRINT %concat( %ansi( 12), "Deleted the alias name: ", %ansi( 14), %1)
  }
  {#PRINT %concat( %ansi(reset), "To add an alias name, use: name add <alias> <name>")
  #PRINT %concat( %ansi(reset), "To remove an alias name, use: name delete <alias>")}]]></value>
  </alias>
  <var name="nameList" type="Record" id="1171">
    <value>D=Drondon</value>
    <json>{"D":"Drondon"}</json>
  </var>
</class>
_________________
Listen to my Guitar - If you like it, listen to more
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