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


Joined: 24 Nov 2003
Posts: 6
Location: USA

PostPosted: Mon Nov 24, 2003 5:46 am   

Sleeping Cycles
 
I've looked around all over and I can't figure how to make this trigger work right.
What I want to do is to basically set up a trigger so that if my HP are above a certain value, cast a spell, otherwise sleep.

The problem is that I want it just to send the sleep command once. I'm reading off the prompt and any input from the user causes the prompt to pop up again. So when the trigger is executed and I sleep, the sleep command keeps getting sent to the mud over and over and over until I heal HP past that value I set.

How do I have it execute the sleep command, and then just wait until I wake up before sending it again?
Reply with quote
iljhar
GURU


Joined: 10 Oct 2000
Posts: 1116
Location: USA

PostPosted: Mon Nov 24, 2003 7:03 am   
 
#alias wa {wake;stand;#var sleep 0}
#alias sl {sleep;save;#var sleep 1}
#trigger {~<(%d)hp~>} {#if (%1>10) {#if (@sleep=1) {wa};#if (@cast=0) {cast 'strength';#var cast 1}} {sl}}

Of course, there are some things you'll have to tweak, like if the cast doesn't work or you are fighting or whatnot, but that should get you what you want.
Reply with quote
dalkinn
Newbie


Joined: 24 Nov 2003
Posts: 6
Location: USA

PostPosted: Mon Nov 24, 2003 5:53 pm   
 
Thanks for the reply. I understood basically what needed to be done, but I have problems getting nested #IF statements to work right. I'll tweak the code you gave and it should work fine.
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