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
Gren
Beginner


Joined: 03 May 2002
Posts: 14
Location: USA

PostPosted: Fri May 03, 2002 6:31 pm   

newbie script question
 

Hey there.. I'm really new to scripting.. I have a question.. I'll try and be as descriptive as possible.

On the particular mud I play, there's a skill called 'Aura Heal' and a device called a 'Force Cube' it's not really important what they do.. I need to put a delay between when I use them..

old style:

ah
ah
ah
uc
ah
ah
st
uc
ah
ah
st
uc
ah
ah
st
uc
ah
ah
st
uc

(every command is executed right after the other..)

ah = aura heal
st = store cube
uc = use cube

I want to put a delay between when I heal.
I tried using the ALARM command.. and maybe I was just doing it incorrectly. The following script doesn't work because all the commands with the short delay are executed first.. and then come the others.

I wanted to executed the first command 'ah' and then WAIT... then execute the second command. and then WAIT.. and then bam-bam, 2 commands in a row. And then continue with the script the same way..

The length of delay isn't important.. but we'll say a full second. (I know.. I have it set to a 10th of a second)

this doesn't work:

#ALARM +0.1 ah
#ALARM +0.5 ah
#ALARM +0.5 ah
#ALARM +0.1 st
#ALARM +0.1 uc
#ALARM +0.5 ah
#ALARM +0.5 ah
#ALARM +0.1 st
#ALARM +0.1 uc
#ALARM +0.5 ah
#ALARM +0.5 ah
#ALARM +0.1 st
#ALARM +0.1 uc
#ALARM +0.5 ah
#ALARM +0.5 ah
#ALARM +0.1 st
#ALARM +0.1 uc
#ALARM +0.5 ah
#ALARM +0.5 ah
#ALARM +0.1 st
#ALARM +0.1 uc



Sorry for the long post.. and I know this is a fairly simple thing to do.. I'm just not familiar with scripting enough to figure it out..

any help is hugely appreciated..

Thanks much!
Reply with quote
Gandorf
Novice


Joined: 28 Oct 2000
Posts: 38
Location: Sweden

PostPosted: Fri May 03, 2002 8:55 pm   
 
If you are using #alarm and setting it all off at the same time you need to increase the number of seconds to wait on every line.
Ex

#ALARM +0.1 ah
#ALARM +0.6 ah
#ALARM +1.1 ah
#ALARM +1.2 st


I hope this works


Gandorf
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Fri May 03, 2002 8:55 pm   
 
If I have this correct, you would like to do an Aura Heal, wait, Aura Heal, wait, Store Cube, Use Cube, and repeat. This can be managed with an alias. To avoid recursion problems, it would probably be best to use a trigger for the repeats. This can easily be modified to include a counter if you want to run it for a set number of repetitions. By putting these into a separate class (such as cube) they can be easily turned off either manually or by script once you've healed enough.

#AL HealCube {ah;#ALA +1 {ah};#ALA +2 {sc;uc}} cube
#TR {force cube activation text} {healcube} cube

LightBulb
Vague questions get vague answers
Reply with quote
Sildaren
Wanderer


Joined: 19 Jul 2001
Posts: 59
Location: Germany

PostPosted: Fri May 03, 2002 8:58 pm   
 
Either you use nested #ALARMS:
ah; #ALARM +0.5 {ah; #ALARM +0.5 {ah; st; uc; #ALARM +0.5 {ah; #ALARM +0.5 {ah; st; uc; #ALARM +0.5 {ah; #ALARM +0.5 {ah; st; uc; #ALARM +0.5 {ah; #ALARM +0.5 {ah; #ALARM +0.1 {st; #ALARM +0.1 {uc; #ALARM +0.5 {ah; #ALARM +0.5 {ah; #ALARM +0.1 {st; #ALARM +0.1 uc}}}}}}}}}}}}}

or use #WAIT commands
#ALI ahstuc {ah; #WAIT 500;ah; #WAIT 500;ah; st; uc; #WAIT 500;ah; #WAIT 500;ah; st; uc; #WAIT 500;ah; #WAIT 500;ah; st; uc; #WAIT 500;ah; #WAIT 500;ah; #WAIT 100;st; #WAIT 100;uc; #WAIT 500;ah; #WAIT 500;ah; #WAIT 100;st; #WAIT 100; uc}

Note that using #WAIT in an alias is usually fine, while using it in a trigger is usually asking for trouble.
(See http://www.zuggsoft.com/zmud/timers.htm for details)
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