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


Joined: 30 Aug 2005
Posts: 6
Location: Eureka, CA, USA

PostPosted: Mon Mar 26, 2007 9:58 am   

Variable / %zonename
 
Hi guys.

Is it possible to set a variable to a zonename via an alias?

What I'm looking for is something to set a button caption to my recall room's zone name.

So if I'm set to recall in X city, my @recall is X (And such my caption is X).
If I set recall to Y city, my @recall is Y (And so is my button).

I'm thinking of the following. You'll see the ? where I get lost.

Quote:
#ALIAS DoRecall {@recall = (%zonename(???))}


Thank you!
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Mon Mar 26, 2007 10:41 am   
 
Well, if your zone name is just the city name, you can simply do

#alias DoRecall {recall=%1}

to set the variable with the name of the city if you DoRecall cityname. The %zonename function works on the number of the zone, which is useful for some things but not really if you're starting from the name of the city. If the name of the city isn't the name of the zone, but each city does have its own zone name then you can just run a series of #if checks to find which it is:

#alias DoRecall {#if (%1=Antioch) {recall=Anti};#if (%1=Stavenn) {recall=Stav}}

etc etc.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Danlo
Magician


Joined: 28 Nov 2003
Posts: 313
Location: Australia

PostPosted: Mon Mar 26, 2007 10:53 am   
 
I don't see where you're getting lost, hehe.
If you just give your button the name of the variable, or somesuch, ie "Recall Room in Zone @Recall".
Then your alias DoRecall, which is practically already correct: #alias DoRecall {Recall = %zonename()}
Reply with quote
jkoster
Newbie


Joined: 30 Aug 2005
Posts: 6
Location: Eureka, CA, USA

PostPosted: Mon Mar 26, 2007 11:19 am   
 
Hm.

Here I was trying to complicate things.

Silly me.

Thanks!
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