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
jackwest
Novice


Joined: 01 Jan 2009
Posts: 35

PostPosted: Mon Jan 12, 2009 4:48 am   

simple variable expansion issues
 
this one is probably really simple but i cant figure it out.

Code:
#button @character_name @character_name {@character_name+login}


the button name and id expand properly but the command comes out as @character_name+login not player+login.

it's also occuring when i'm trying to create an alias...

Code:
#alias @character_name+login {#class @character_name 0}


neither variables expand either.

i've used %concat and %expand to expand the #alias name successfully but they dont work inside the {}... i'm missing something fundamental here.

jack
Reply with quote
shalimar
GURU


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

PostPosted: Mon Jan 12, 2009 5:36 am   
 
Buttons are best made in the gui for this very reason.
_________________
Discord: Shalimarwildcat
Reply with quote
Scirkhan
Apprentice


Joined: 14 Sep 2007
Posts: 167
Location: aztx

PostPosted: Mon Jan 12, 2009 10:35 am   
 
Would this help?

#alias @character_name+login {#var Exec_charname "~#class ~@character_name 0";#exec @Exec_charname}
Reply with quote
shalimar
GURU


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

PostPosted: Mon Jan 12, 2009 10:44 am   
 
for the alias

#ALIAS %concat(@charecter_name, "+logiin") {dostuff}
_________________
Discord: Shalimarwildcat
Reply with quote
jackwest
Novice


Joined: 01 Jan 2009
Posts: 35

PostPosted: Mon Jan 12, 2009 10:21 pm   
 
nods shalimar, that was my work around, but it's the variables inside the {dostuff} string that are giving me problems.

scirkhan, i see what you're aiming at but i cant get it to work yet, the {dostuff} still comes out #class @character_name 0 instead of #class player 0. i'll keep plugging.
Reply with quote
jackwest
Novice


Joined: 01 Jan 2009
Posts: 35

PostPosted: Mon Jan 12, 2009 10:31 pm   
 
sweet got it working

Code:
#alias %concat( @character_name, "+login") {
#var Exec_charname {#class @character_name 0;character_name = @character_name}
#exec @Exec_charname
}


thanks guys
Reply with quote
shalimar
GURU


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

PostPosted: Mon Jan 12, 2009 11:12 pm   
 
%expand maybe?
_________________
Discord: Shalimarwildcat
Reply with quote
jackwest
Novice


Joined: 01 Jan 2009
Posts: 35

PostPosted: Tue Jan 13, 2009 12:31 am   
 
nods i tried that, it carried the %expand over into the alias.
Reply with quote
shalimar
GURU


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

PostPosted: Tue Jan 13, 2009 1:20 am   
 
Try using a #FUNC instead of a #VAR?
_________________
Discord: Shalimarwildcat
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