Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
lorddevi
Newbie


Joined: 13 Jul 2005
Posts: 6

PostPosted: Fri May 11, 2007 5:22 pm   

Newbie Alias Problem
 
Hello. I've tried a while trying to figure out how to get this to work but haven't had any luck yet. Essentially I just want an alias that runs another random script. The best I can find so far is this:

Code:

#VAR xplist {alias1|alias2|alias3|alias4|alias5|alias6}

%item(~@xplist,%random(1,6))


I have tried things like prepending #EXEC before the %item(-- line but the results are always the same. It just sends 'alias1' to the mud as raw text without parsing it as an alias.. I've found that in the helpfiles if I want to specifically send raw text like this is doing i must usually prepend the command with a tilde (~).. but what about explicitly declaring i want it to BE parsed.. hrm, Anyone have a fix for me? =)
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Fri May 11, 2007 5:34 pm   
 
Code:

#alias alias1 {smile}
#alias alias2 {frown}
#alias alias3 {cartwheel}
#alias alias4 {raspberry}
#alias alias5 {smirk}
#alias alias6 {laugh}
#VAR xplist {alias1|alias2|alias3|alias4|alias5|alias6}
#alias random {%item(@xplist,%random(1,6))}


Works, though you should use this instead for the random alias.

Code:
#alias random {#exec {%item(@xplist,%random(1,6))}}


This makes it cMud compatible if you ever choose to upgrade.
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
lorddevi
Newbie


Joined: 13 Jul 2005
Posts: 6

PostPosted: Fri May 11, 2007 6:20 pm   
 
Thank you very much! That worked perfectly. It's actually funny because i tried that cmud compliant line exactly letter for letter. However my #VAR declaration before it for some reason was preventing it from working. Just put the #VAR declaration in a seperate alias and away it went.

Thanks again
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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