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


Joined: 05 Apr 2005
Posts: 8

PostPosted: Mon Jul 21, 2008 3:58 am   

Zmud to Cmud variable issue
 
I used to use the following alias in zmud which does not work in cmud.

#alias {g} {get all %1.corpse}

In zmud if I typed g 5, it would spit out: get all 5.corpse.

In cmud if I type g 5 it spits out: get all

Any ideas?

Thanks.
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Mon Jul 21, 2008 4:26 am   
 
Change it to:

#alias g {get all %{1}.corpse}

and it should work.

Charneus
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Mon Jul 21, 2008 5:43 pm   
 
Charneus is correct.

In CMUD, the syntax a.b is used to fetch the "b" element of the "a" array. So, doing %1.corpse is asking for the "corpse" element of the %1 array (string list or database variable).

The syntax that Charneus gave will work, but the more strict and correct way to do this would be:

#alias {g} {#SEND %concat("get all ",%1,".corpse")}

It's possible that I'll be able to improve this to work better in the future so that CMUD can detect if the %1 is a valid array or not.
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