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


Joined: 29 Jun 2004
Posts: 3
Location: Australia

PostPosted: Tue Jun 29, 2004 4:16 pm   

Waiting for mud output inside a loop
 
Hi all,

I'm trying to write an alias for casting spellup spells that will also automatically recast any missed ones.

I've put the spells inside a database and the script accesses each record of the database in ascending order. I've got that working but I'm stuck on how to make the script wait until the MUD output from the last cast command has been returned and depending on the success status, continue or recast.

This is what I have so far:

#T+ Spellup
#VAR count 0
#DBLOAD sp
#DBFIRST
#while (!%null( %rec)) {
#SEND %rec.Name
<- NEED TO ADD WAIT FOR RETURN OUTPUT HERE
#ADD count 1
#DBNEXT
}
#DBCLOSE sp 1
#T- Spellup

I've read about the issue with the WAIT command, so I haven't used it. I've also tried using triggers to catch the output but the script runs out before waiting for the output from the MUD and since the class has already been turned off, the trigger won't fire.

Is there a way of stalling the script to wait for the MUD output at the indicated point? I'm using zMUD 6.16 (I know it's old, but it runs smoother on my PC than 7.0.5)

TIA,
Alf
Reply with quote
geniusclown
Magician


Joined: 23 Apr 2003
Posts: 358
Location: USA

PostPosted: Tue Jun 29, 2004 6:41 pm   
 
My suggestion (assuming you'll gesture, then get a success or failure message within 1 line):
quote:

#TEMP {} {#SEND <%rec.Name>}
#COND {^You gesture.} {}
#COND {spell success message} {} {within|Param=1}


If the spell fails, then the last condition will not fire, resetting the trigger, which will recast the spell (assuming that %rec.Name is the command to cast the spell), but if it sees the success message, then it will not reset itself, but instead delete itself, being a temp trigger.

Unfortunately, this parameter for #COND was introduced in version 6.20.
Reply with quote
Alf
Newbie


Joined: 29 Jun 2004
Posts: 3
Location: Australia

PostPosted: Tue Jun 29, 2004 7:34 pm   
 
Thanks for your input geniusclown :)

If I cannot get it working in this version of zMUD, I might have to give 7.0.5 another try again, else just use a normal alias and manually type in any spells that missed :(
Reply with quote
Alf
Newbie


Joined: 29 Jun 2004
Posts: 3
Location: Australia

PostPosted: Thu Jul 01, 2004 5:48 pm   
 
I'm running zMUD 7.0.5 now, appears to be ok for the moment (hope it holds).

So, what would be the best way of making sure that the spell that missed will be recast? Should I just use a normal trigger that catches all missed spells or the conditions geniusclown suggested?

I'm playing on Aardwolf where the spellup spells waiting time are variable, so doing a wait there would negate the effect of the shorter wait time for some spells.

TIA for any advice.
Reply with quote
darmir
Sorcerer


Joined: 10 Oct 2000
Posts: 706
Location: USA

PostPosted: Thu Jul 01, 2004 7:45 pm   
 
If you search the forums for Spellup scripts you should get quite a few that may already have the recast missed spells.
This is in the finished scripts for Aardwolf MUD:
http://www.zuggsoft.com/forum/topic.asp?TOPIC_ID=15627
For Medievia - could be revamped:
http://www.zuggsoft.com/forum/topic.asp?TOPIC_ID=14145
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