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


Joined: 10 Mar 2015
Posts: 2

PostPosted: Mon Apr 27, 2015 9:12 am   

#alias combine variable with text no longer working. Help?
 
Previously in Zmud I had some aliases that were

#alias 1.string {say "Hello."}
#alias 2.string {say "Hi."}
#alias 3.string {say "Greetings."}

and I could call it with

#alias sayhello {#var stringnum;@stringnum".string"}

and could execute with sayhello.

Not it just prints out 1.string.

Is there any way to fix this?

Tia.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Mon Apr 27, 2015 10:12 am   
 
You could fix it by encapsulating the @stringnum".string" with an #EXECUTE, but I would recommend a cleaner solution.
Code:
#ALIAS sayhello {#SEND {say %case(%random(1,3),"Hello.","Hi.","Greetings.")}}
This will allow you to get rid of the other aliases. If you don't want to use the %random then there are many other methods that could be used.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
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