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
Enathe
Novice


Joined: 17 Nov 2001
Posts: 34
Location: USA

PostPosted: Sat Feb 15, 2003 9:35 pm   

Auto Heal
 
I have a prompt which looks like this

<77/77hp 110/110m 230/230mv>

I have tried unsucessfully to make a trigger that will look at the prompt continually. My goal is when the HP falls below 20 my main char Enathe would tell Anathe to heal or cure light. Looking for something really simply so I can learn from it. As of yet I have had a really hard time with some of the more complicated scripts. Thanks all for the help
Reply with quote
Charbal
GURU


Joined: 15 Jun 2001
Posts: 654
Location: USA

PostPosted: Sat Feb 15, 2003 9:50 pm   
 
You might try something like:

(untested)

#TRIGGER {~<(%d)/%dhp %d/%dm %d/%dmv~>} {#IF (%1 < 20) {tell Anathe heal}} {prompt}



 - Charbal
Reply with quote
Enathe
Novice


Joined: 17 Nov 2001
Posts: 34
Location: USA

PostPosted: Sun Feb 16, 2003 12:39 am   
 
Hey that worked great thanks! There is still one issue though. Now it says it far more than is needed. It tells Anathe heal, but then the prompt comes up before the heal can be accomplished. So now 3 or 4 "anathe heal's" stack up before the first one is cast. Any way to get it to wait for a response before telling again?
Reply with quote
Deneir
Beginner


Joined: 14 Feb 2003
Posts: 19
Location: USA

PostPosted: Sun Feb 16, 2003 12:56 am   
 
Couple ways you could fix that :) probably even some i dont know but another trigger set to turn off the class that the Auto Heal is on would be what i would do for example:

#trigger {^You tell Anathe, 'heal'} {#class Heal 0;#wait 5000;#class Heal 1}

Only thing is you would have to put your AutoHeal trigger in its own class folder named Heal or whatever u prefer.

And for anyone who asks i put the #wait in there so he wouldnt have to make another trigger to turn it back on itll wait 5 seconds and then autoheal will be back on.

Reply with quote
mimique6
Newbie


Joined: 09 Jan 2003
Posts: 9
Location: USA

PostPosted: Sun Feb 16, 2003 12:57 am   
 
Mmkay, assuming you just want to tell the char to heal you, and if you are healed, then tell it again, make a variable for it. Say, "waitforheal"

#TRIGGER {~<(%d)/%dhp %d/%dm %d/%dmv~>}
{#IF (%1 < 20) {#if (@waitforheal=1) {tell Anathe heal; waitforheal=0}}
} {prompt}

#trigger {msg saying you've been healed by him} {waitforheal=1}

Hope this helps!
(untested)

~Mimique

Is it bad when Zmud plays more than you do?
Reply with quote
Enathe
Novice


Joined: 17 Nov 2001
Posts: 34
Location: USA

PostPosted: Mon Feb 17, 2003 5:53 pm   
 
Ok tried the last script and now for some reason when I fall below 20HP nothing happens. Not sure why. Any suggestions?

Thanks all
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Mon Feb 17, 2003 6:52 pm   
 
Do you have a variable, @waitforheal? Is it equal to 1?

#VAR waitforheal 1 1

Enter that at the command line to create the variable, with an initial value of 1 (so you can be healed now) and a default value of 1 (so you can be healed whenever you connect).

LightBulb
Advanced Member
Reply with quote
Enathe
Novice


Joined: 17 Nov 2001
Posts: 34
Location: USA

PostPosted: Mon Feb 17, 2003 10:33 pm   
 
Ok, that fixed the problem. Thanks Lightbulb.
Reply with quote
Enathe
Novice


Joined: 17 Nov 2001
Posts: 34
Location: USA

PostPosted: Mon Aug 04, 2003 4:12 am   
 
I am on a new mud now and my prompt looks like this

h54% m100% v95% >

I am just copied and pasted previous settings to this mud and changed my pattern to this.

~h(%d)%~

This works great except that the trigger fires if @waitforheal=1 no matter what. If doensn't take into account the fact that I want it to fire only if @waitforheal=1 AND %1 < 50. Here is what I have all in all


#trigger {~h(%d)%~}{#IF (%1<20) {#if (@waitforheal=1) {
tell mathe heal
waitforheal=0
}} {prompt}

#var waitforheal 1 1

Any suggestions would me most helpful thanks.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Mon Aug 04, 2003 6:36 am   
 
#trigger {h(%d)~%} {#IF (%1<20) {#if (@waitforheal=1) {
tell mathe heal
waitforheal=0
}} {prompt}
Reply with quote
Enathe
Novice


Joined: 17 Nov 2001
Posts: 34
Location: USA

PostPosted: Mon Aug 04, 2003 6:53 am   
 
I had to remove the {prompt} part because it just kept spitting prompt out. Other than that can you help me understand what it was that I was doing wrong and how yours worked?

Thanks again
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Mon Aug 04, 2003 2:59 pm   
 
Sorry about {prompt}, I just copied your trigger and changed the pattern, since that's where your problem was. Here's the correct trigger, redone the way I script:
#TR {h(%d)~%} {#IF (%1 < 20) {#IF (@waitforheal = 1) {tell mathe heal;#VAR waitforheal 0}}} {} {nocr|prompt}

As for what's different, you used the zMUD quote character ~ at the end of your pattern, telling zMUD to ignore the }, so your pattern didn't end when it was supposed to. You also left out the space between } and {, which also causes zMUD to ignore the }.
Reply with quote
propagandalf
Newbie


Joined: 05 Aug 2003
Posts: 2

PostPosted: Tue Aug 05, 2003 1:24 pm   
 
Enathe,

Go back to the way that casts every time your prompt comes up. You said that if the prompt is shown three or four times before you can cast, that you cast several times too many. When I wrote an autoheal script, I used this exact method in my script, and had the same problem. Here's how to fix it:

Set the prompt trigger to a class of its own (e.g. autoheal). Part of the trigger action must be to turn off this class. This will make it fire only once. Next, you have to make another trigger for the success message of your spell. This trigger turns the autoheal class back on. You might want to make a trigger that automatically recasts a failed spell, if you don't have one already.

The sequence of events is therefore: Prompt trigger scans prompt and sees that you have less than 20. Prompt trigger sends command to cast cure light and turns itself off. Further prompts are ignored. Cure light command goes through, the spell is cast, you see the success message. The success trigger turns autoheal class back on, and it starts scanning the prompt again. Repeat when hp drops below 20 again.

This worked very well for me :)

Propagandalf
Reply with quote
Konquer
Newbie


Joined: 31 Mar 2006
Posts: 4

PostPosted: Fri Mar 31, 2006 4:22 pm   
 
I have a question reguaring this topic. I read through it and have tried your script and it works really well, however. I'm not using it to have someone else heal me, but instead to heal myslef. It works good, but too god. It multi casts and i waste allot of mana. How can I remedy that?

Here's the modifications I made:

#TR {^~<%d/%dhp %d/%dm %d/%dmv>}
#IF (@hp < 350) {hm}
#IF (@mana < 300) {#echo LOW MANA}

how can I modify it so that it waits until after the heal is cast before it reads the prompt again?
Reply with quote
Iceclaw
Apprentice


Joined: 11 Sep 2005
Posts: 124

PostPosted: Sat Apr 01, 2006 3:36 am   
 
#if (@hp <350&@healinprog=0) {hm;#var healinprog 1}
Then when you get a heal message (the one that says you cast/failed/whatever)
#var healinprog 0
:)
Reply with quote
Kisapmata
Beginner


Joined: 19 May 2003
Posts: 15
Location: Uh... KS?

PostPosted: Sat Nov 18, 2006 5:52 pm   
 
A mild bump for a question.
Here is what my prompt looks like:

100%hp 100%m 3443v

I want it so that I will quaff potions to heal my mana (the 2nd % on there).
The moves part (3rd) changes, so I don't know if that would make it different.
But I want to c2 (alias for quaffing mana pots) when my mana goes below 40%.
Seems easy no? But not for me heh ^^;
_________________
DiNK!@%
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