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
Bobo the Bee
Newbie


Joined: 14 Jan 2008
Posts: 1
Location: Appa State U

PostPosted: Wed Feb 13, 2008 8:58 pm   

alias question
 
Is there a way to take a variable and send it as one of my aliases?

Like #EXECUTE but check to see if it's an alias first, and if so, send that?
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4690
Location: Pensacola, FL, USA

PostPosted: Wed Feb 13, 2008 9:15 pm   
 
#alias blah {#SAY hi}
test=blah
#EXEC {@test}

prints out the expected 'hi'
_________________
Discord: Shalimarwildcat
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Wed Feb 13, 2008 10:16 pm   
 
#alias blah {#SAY hi}
test=blah
#if (%trigger(@test)==1) {#exec {@test}}

The only trouble being that if you have any other setting named blah then it will attempt. So it is not an exact science if you will. Embarassed
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Wed Feb 13, 2008 11:03 pm   
 
Should you use %alias to test if something is an alias?
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Wed Feb 13, 2008 11:50 pm   
 
Nope, %alias expands an alias. It was one of the commands created to make Zmud functions work more like real functions.

%class and %trigger both do the same thing. But obviously I wasn't trying to see if the variable contained the name of a class...
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4690
Location: Pensacola, FL, USA

PostPosted: Thu Feb 14, 2008 12:46 am   
 
#EXEC {%alias(@test)}

does work
_________________
Discord: Shalimarwildcat
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Thu Feb 14, 2008 1:14 am   
 
Ok, so now I feel stupid. I was wrong.

#if (%alias(@test)) {#show yes} {#show no}

Does work... Hrm Cool but Embarassed
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
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