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


Joined: 25 Nov 2012
Posts: 3

PostPosted: Sun Nov 25, 2012 1:05 pm   

Alias Troubles
 
Okay so I haven't ever used CMUD before, and I'm rather perplexed.

I'm trying to set up just some rather basic aliases, but I can't seem to get it to accept multiple arguments. The helpfiles imply that it should. Here's an example of the problem I'm having.

This alias works:

<alias name="readyarmoire" id="94">
<value>ready armoire
get quiver
wear quiver
get hunting horn
wear horn
get scrip
wear scrip
</value>
</alias>

This alias does not work:

<alias name="ready armoire" id="94">
<value>ready armoire
get quiver
wear quiver
get hunting horn
wear horn
get scrip
wear scrip
</value>
</alias>

The only difference is readyarmoire -> ready armoire

If I click execute script, the commands are sent fine, but when I put 'ready armoire' into the mud, it doesn't seem to go through. Nothing happens.

I prefer the spaces in my aliases, so if someone can help me with this, I would appreciate the assistance.
Reply with quote
mikeC130
Apprentice


Joined: 03 Jul 2006
Posts: 108

PostPosted: Sun Nov 25, 2012 2:40 pm   
 
You can't have an alias with two separate parts to the name. You could use an underscore (_) if readability is your concern, though it will be less convenient to type.

Alternatively, if you have multiple "ready" aliases, you could combine them into a single alias, and use the follow on word as a parameter to determine what code to execute within the alias, using #SWITCH.

Mike
Reply with quote
Rhyandra
Newbie


Joined: 25 Nov 2012
Posts: 3

PostPosted: Sun Nov 25, 2012 2:51 pm   
 
Typability is my concern, rather than readability. I have been using the same set of aliases for about 8 years, and multitudes of them are multi-word aliases. So having to relearn to type them all without spaces is going to be rough since they're so ingrained into me on a reflexive level. I may have to just bite the bullet and do it though.
Reply with quote
Fizgar
Magician


Joined: 07 Feb 2002
Posts: 333
Location: Central Virginia

PostPosted: Sun Nov 25, 2012 4:06 pm   
 
Try trigger type COMMAND INPUT. Then you can use the multi-word aliases. :)
_________________
Windows Vista Home Premium SP2 32-bit
AMD Athlon Dual Core 4400+ 2.31 GHz
3 GB RAM
CMUD 3.34
Reply with quote
Rhyandra
Newbie


Joined: 25 Nov 2012
Posts: 3

PostPosted: Sun Nov 25, 2012 5:49 pm   
 
That worked perfectly. Thank you :)
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Sun Nov 25, 2012 11:54 pm   
 
Additionally, you can create a database of commands with an alias of "ready", then you don't need to make multiple oninput triggers. For instance:

Code:
#ADDKEY readycommands {armoire} {ready armoire|get quiver|wear quiver|get hunting horn|wear horn|get scrip|wear scrip}
#ADDKEY readycommands {somethingelse} {list of other commands|similar to above format}


Then you can do your ready alias as such:
Code:
#ALIAS ready {#FORALL %db(readycommands, %1) {#SENDRAW %i}}


Then all you need to do in the future is: ready armoire --- ready somethingelse --- ready somethingelseagain.

Good luck with future scripting!
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