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


Joined: 16 Jan 2003
Posts: 6

PostPosted: Thu Jan 16, 2003 8:16 am   

Generic Healing Bot
 
I need something to read in my Hitpoints and my mana, heal me, and go back and buy a restore when my mana gets too low. prompt line for my mud is as follows:

[Azaroth] r[3084] [H1208 M1211 V1393] ex[D] >

if you could help me out, I would be very appreciative. If you need any more info lemme know. Contact me thru AIM if you have it SN: HawkNo71
Reply with quote
IceChild
Magician


Joined: 11 Oct 2000
Posts: 419
Location: Post Falls, ID, USA

PostPosted: Thu Jan 16, 2003 9:26 am   
 
#VAR MaxHitP {}
#VAR CostOfHeal {}
#ALIAS buyrestore {}
#TRIGGER {~[Azaroth~] r~[3084~] ~[H&HitP M&Mana V&Move~] ex~[&Exits~] ~>} {#IF ((@HitP < @MaxHitP) AND (@Mana > @CostOfHeal)) { cast heal self } { %if(@Mana < @CostOfHeal, buyrestore, "") } {prompt}

Ok, that SHOULD do it, couple things though:

1) CostOfHeal should be is the cost of casting heal on yourself. Just put the value into the default field, and "Reset to Default" on it.

2) MaxHitP should be your maximum Hitpoints, again, just put that value in as you did with CostOfHeal

3) buyrestore - This is a simple blank alias, and in here, simply put in the steps you need to do on your mud to buy a restore when your mana is low...

4) Since I'm not on your mud, this is untested, however, it should work (atleast, in zmud's eyes )


Hope this atleast points you in the right direction.



Icechild
mv -f message.text /dev/null
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Jan 16, 2003 6:19 pm   
 
Auto-heal scripts which rely on the prompt have a tendency to loop. This is because the prompt will continue to show less than max hp's until the healing spell, potion, whatever takes effect. I've used a variable (@healing) to prevent this, with a temporary alarm to reset the variable. You might need a larger number (+2, +3, etc) for the alarm. Oh, the #TR command has a CLASS field between the VALUE field (commands) and the OPTION field. It can be blank, but it still needs to be there.
Corrected trigger:
#VAR Healing 1 1
#TRIGGER {~[Azaroth~] r~[%d~] ~[H&HitP M&Mana V&Move~] ex~[&Exits~] ~>} {#IF ((@HitP < @MaxHitP) AND (@Mana > @CostOfHeal) AND (@Healing = 1)) {#VAR healing 0;#ALARM +1 {#VAR healing 1;#CR};cast heal self} {#IF (@Mana < @CostOfHeal) {buyrestore}}} {} {nocr|prompt}

LightBulb
Senior Member
Reply with quote
IceChild
Magician


Joined: 11 Oct 2000
Posts: 419
Location: Post Falls, ID, USA

PostPosted: Thu Jan 16, 2003 11:09 pm   
 
grr, hate it when I forget something like that ;) I wasn't even looking at zmud at the time (infact, I was only really half here)

Yeah, good point though on the trigger looping problem.... I've had that issue from time to time with my scripts, but again, I wasn't using one as a reference, thanks for catching it.



Icechild
mv -f message.text /dev/null
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Fri Jan 17, 2003 8:01 am   
 
I also find it good practice to give the alarms names so I dont accidentally create many of them.

ie:

#ALARM alarmhealing +1 {#VAR healing 1;#CR}

2cents!

Ton Diening
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