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
Twigg
Wanderer


Joined: 22 May 2003
Posts: 60
Location: USA

PostPosted: Sat Jun 19, 2004 6:45 pm   

Alarm..what went wronG?
 
Yesterday I wrote a little alias for getting on my horse. And yesterday it worked perfectly! Today the #Alarm does not work! I cannot figure out what I did wrong! This is the alias I wrote.

Unhitch mare;#ALARM +2;mount mare;#ALARM +2;tap mare

Why did it work yesterday and now not today? Please help!
When I try to embed the #Alarm I get a syntax error message.
For instance I type an { in the box and I get a syntax error...Iver tried copying what I have observed in the forum and it still doe not work!

{unhitch mare;mount mare}#ALARM +2{tap mare}}
This evoks a syntax error message!

please help me understand what i am doing wrong?
Thank-you for this help...sure to get this someday....
Reply with quote
Mercator
Newbie


Joined: 05 May 2004
Posts: 7
Location: United Kingdom

PostPosted: Sat Jun 19, 2004 8:27 pm   
 
hiya

I think you mean something like this..

#ALIAS uh {unhitch %1;#ALARM +2 {mount %1;#ALARM +2 {tap %1}}}


The usage is uh mare or whatever you else you may ride.

Mercator
Reply with quote
Twigg
Wanderer


Joined: 22 May 2003
Posts: 60
Location: USA

PostPosted: Sat Jun 19, 2004 9:35 pm   
 
Yes,yes,yes! That works! And the three brackets ar the end are they for each action written in the script?
Thank-you so very much! One more thing...the %1 turned in to mare in the actual ALIAS information...how would I write it to keep the %1 a %1 so I could ride a mare or a pony or a camel? So I could designate what to ride on the command line useing this ALIAS?
Reply with quote
geniusclown
Magician


Joined: 23 Apr 2003
Posts: 358
Location: USA

PostPosted: Sun Jun 20, 2004 12:04 am   
 
The way the alias is written, it will unhitch your steed, then set an alarm to go off in 2 seconds, to mount the steed and set another alarm to go off 2 seconds later to tap the steed.

The %1 is whatever the first value you put in after the alias on the command line. i.e. if you used the alias exactly as Mercator posted, to mount a horse, you'd type in "uh horse". If you want to mount a pony, you'd type in "uh pony".
Reply with quote
Twigg
Wanderer


Joined: 22 May 2003
Posts: 60
Location: USA

PostPosted: Sun Jun 20, 2004 2:56 am   
 
the problem is that it does not do that...I typed in mare the first time I ran it and now mare is the only thing it will do. I am sure i could chamge it by rwriting it and replacing mare with the %1 agin but the first thing I enter is the way it stays...what is wrong?
Also I want to be able to write any simple alias and I still can not figure out how to do it on my own.
I want to write a casting Alias like this:

#ALIAS cast{Stance offensive;cast @spell %1;#ALARM +10{stance defensive}}

I understand that I am supposed to embed the #ALARM...it just does not seem to work...typically I cannot figure out why!
Please more help.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Jun 20, 2004 3:09 pm   
 
What is wrong is that you put the entire command in the Value section in the Settings Editor, so when you ran the alias it included an #ALIAS command to overwrite itself.

Paste the entire command to the command-line.

Or, paste only the part which begins with "unhitch" to the Value section, leaving out one set of braces.
Reply with quote
geniusclown
Magician


Joined: 23 Apr 2003
Posts: 358
Location: USA

PostPosted: Sun Jun 20, 2004 3:11 pm   
 
The problem you're having with %1 is just plain weird. I use %1 in so many of my triggers, I couldn't even begin to count how many times it's in my scripts, and I've never encounted a problem like you describe. Without another clue, I can't help with that. Sorry.

As for your alias not working... if you put it into the command line exactly as you pasted, then your problem is probably as simple as missing spaces. Try it like this:
quote:

#ALIAS cast {Stance offensive;cast @spell %1;#ALA +10 {stance defensive}}

Reply with quote
Twigg
Wanderer


Joined: 22 May 2003
Posts: 60
Location: USA

PostPosted: Sun Jun 20, 2004 3:34 pm   
 
Ohhhh...I did not even suspect that most scripts are to be entered on the command line. I keep picking away and it is starting to make sense. Who know that an erstwhile computer illiterate would find this stuff so fascinating! Thank-you all for your patience and real help!
Reply with quote
Twigg
Wanderer


Joined: 22 May 2003
Posts: 60
Location: USA

PostPosted: Sun Jun 20, 2004 3:50 pm   
 
Alright, now when I enter my alias from the command line I get a message that I have created an infinite loop in command parsing...the message says

Infinite loop in comman parsing
Stance offensive;cast @spell @spell%1;#ALARM +10{stance defensive} @spell

Feeling closer but no success yet
Reply with quote
Mercator
Newbie


Joined: 05 May 2004
Posts: 7
Location: United Kingdom

PostPosted: Sun Jun 20, 2004 4:01 pm   
 
Hiya

You need to put a tilde before cast to stop zmud parsing it

#ALIAS cast {Stance offensive;~cast @spell %1;#ALARM +10 {stance defensive}}

This alias will set stance to offensive, cast the desired spell and then 10 seconds later set stance back to defensive.

mercator
Reply with quote
Twigg
Wanderer


Joined: 22 May 2003
Posts: 60
Location: USA

PostPosted: Sun Jun 20, 2004 4:31 pm   
 
Thank-you Mercator,
That did work. My question is why put a tild there...is it because of the actual word "cast" or the placement of the command in the context of the script. I am sure I need to understand this if I want to write my own scripts...again thank-you so much!
Reply with quote
Mercator
Newbie


Joined: 05 May 2004
Posts: 7
Location: United Kingdom

PostPosted: Sun Jun 20, 2004 5:48 pm   
 
It is because of the word 'cast'. If you don't have it zmud will parse the word cast as an alias and create the infinite loop.
Reply with quote
geniusclown
Magician


Joined: 23 Apr 2003
Posts: 358
Location: USA

PostPosted: Sun Jun 20, 2004 5:48 pm   
 
I totally missed that infinate loop thing. You need the ~ because "cast" is now an alias, so without the ~, zMUD will think you want to run that alias, rather than send the word "cast" to the MUD.
Reply with quote
Twigg
Wanderer


Joined: 22 May 2003
Posts: 60
Location: USA

PostPosted: Sun Jun 20, 2004 6:20 pm   
 
You mean that if a word is used as the shortcut for an ALIAS then you need an ~ to inform Zmud that it is not a repetition of the ALIAS shortcut? If that is true do you need the ~ only if the command begins with the word? Right! Of course because ALIAS' only apply at command beginnings...So If I were to change my ALIAS shortcut word to "cat" then I would not need the ~? I used to hope that I could start to understand Zmud by looking at the entered stuff...but so much of that disappears after it is in place...
Yippee! I understand! I see how that works!
Thank-you again all!
Reply with quote
Twigg
Wanderer


Joined: 22 May 2003
Posts: 60
Location: USA

PostPosted: Sun Jun 20, 2004 6:34 pm   
 
So, I have my little cast script. Now how do I make it so my magic use can inset any one of several spells into the @spell variable? Perhaps I am pushing you generosity but it would help a lot to just "see" how it works.
Reply with quote
geniusclown
Magician


Joined: 23 Apr 2003
Posts: 358
Location: USA

PostPosted: Sun Jun 20, 2004 6:53 pm   
 
The most direct way is to type into the command line "#VAR Spell {spell name}", or alternatively, "Spell = {spell name}".

If you're going to cast spells for particular equations, you can probably set up triggers to change the spell: #TR {You're badly hurt.} {Spell = {Major Healing}}

Hope this helps!
Reply with quote
Twigg
Wanderer


Joined: 22 May 2003
Posts: 60
Location: USA

PostPosted: Sun Jun 20, 2004 7:09 pm   
 
Yes, now I understand!
Thank-you!
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