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


Joined: 27 Sep 2005
Posts: 1

PostPosted: Tue Sep 27, 2005 1:05 am   

Help with a loop script
 
ok..I am new to this..and usually try to figure things out on my own, I have searched the forums and have picked up on a lot of stuff. I originally made an alias to loop this process by using #wait commands etc..but after reading through some other scripts, I see that it can be done MUCH more efficiently. Heres a little info on what I need/want...and thanks in advance.

I want my character to...

Lore <object>
if movement is less than 100 I want to sleep until movement is at least 300
Wake
repeat

and obviously a way to stop the loop.

I figured if soeone could show me how to do this first one, then I could disect the code and learn how to move on to bigger things. Thanks.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Tue Sep 27, 2005 1:31 am   
 
Use an alarm and your prompt trigger:

#alarm tSleepAlarm *30 {#cr} //this will force another prompt, adjust time as needed (I didn't want to make it too spammy)

#trigger {(%d)/(%d)hp (%d)/(%d)mp (%d)/(%d)mv~>} {#if (%3 >= 300) {#T- tSleepAlarm;wake;lore object} {sleep;#T+ tSleepAlarm}}
_________________
EDIT: I didn't like my old signature
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