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


Joined: 04 May 2002
Posts: 9
Location: Denmark

PostPosted: Fri May 07, 2004 3:43 pm   

Variable problem
 
Hi guys and gals,

im trying to set up an alias that will enable me to set a variable, sounds simpel enough but i've hit a snag.

my alias is:

Name: spell
value: #var spell


now here is the problem, when I write: spell fire bolt
the variable is only changed to: fire
and not fire bolt like I want it too, what am I doing wrong?
Reply with quote
mr_kent
Enchanter


Joined: 10 Oct 2000
Posts: 698

PostPosted: Fri May 07, 2004 4:54 pm   
 
#ALIAS spell {#VARIABLE spell %-1}

Copy and paste to command line.
Reply with quote
Jagged
Newbie


Joined: 04 May 2002
Posts: 9
Location: Denmark

PostPosted: Fri May 07, 2004 5:17 pm   
 
Didn't do the trick, when I type: spell fire bolt the variable is still only set to fire and not fire bolt
Reply with quote
avalloch
Newbie


Joined: 26 Oct 2000
Posts: 3
Location: United Kingdom

PostPosted: Fri May 07, 2004 6:07 pm   
 
#var spell {%1}
#var spell {fire bolt}

If you don't encapsulate the txt to go in the variable with {} it will only capture the first word.
Reply with quote
Jagged
Newbie


Joined: 04 May 2002
Posts: 9
Location: Denmark

PostPosted: Fri May 07, 2004 6:28 pm   
 
Okay, I see im in over my head here. Could you please explain how to do it from the beginning?

I tried doing what you said avalloch but then the variable was set to {fire bolt} which didn't help me..
Reply with quote
LungFai
Beginner


Joined: 07 May 2004
Posts: 14
Location: Australia

PostPosted: Fri May 07, 2004 6:46 pm   
 
Newb here, Giving this one a shot cos i think i know what A guy was trying to say

Alias
Name : Spell
Value : #var spell {%1}

[8D]
Reply with quote
Jagged
Newbie


Joined: 04 May 2002
Posts: 9
Location: Denmark

PostPosted: Fri May 07, 2004 6:52 pm   
 
Heh, that didn't do it. Same problem - the variable is set to fire and the bolt ends up as being the default value...
Reply with quote
LungFai
Beginner


Joined: 07 May 2004
Posts: 14
Location: Australia

PostPosted: Fri May 07, 2004 6:58 pm   
 
Wierd, if i am not mistaken (which i could be because i just started using mud clients Very Happy ) the parenthises(sp) should capture whatever text you input after you fire the spell trigger. Having the variable %1 within the parenthises(sp) should signify that you are capturing any input placed after the alias spell.

Let me have a read and i will get back to you about it [8D]

Edit :

Did some reading and am not sure if Zmud assigns multiple words to 1 % variable. Thus you might have to put in %1 %2 into your value

eg

Value #Var spell %1 %2

Might be wrong though...am still reading heh
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Fri May 07, 2004 7:17 pm   
 
Make sure to delete the orignial ALIAS

#UNALIAS spell

#ALIAS spell {#VARIABLE spell {%-1}}
Copy and paste to command line.


PLEASE PLEASE PLEASE PLEASE
Read these help files FULLY from top to bottom Why make a wrong guess when you can give the right answer.
#HELP ALIAS
#HELP VARIABLE

BOTH of which explain and one in a nice pink color
Using correct brackets, %1 %-1 %-2

EDIT: added in please stuff
Reply with quote
LungFai
Beginner


Joined: 07 May 2004
Posts: 14
Location: Australia

PostPosted: Fri May 07, 2004 7:30 pm   
 
Pooey I just finished reading the help files and was just about to post when i saw Nex's reply and went ahh Bugger the problem is solved for sure Very Happy

*Heads back to going though the rest of the 255 post to find a solution to his own problems*
Reply with quote
Jagged
Newbie


Joined: 04 May 2002
Posts: 9
Location: Denmark

PostPosted: Sat May 08, 2004 10:19 am   
 
Thanks guys your the best :)
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