Heal Potion Automation

p00n

Lifetimer
Joined
Aug 23, 2006
Messages
89
Reaction score
0
Points
0
Not quite sure this is what this particular forum is for - I think it is this - but this snippet started from the old krust.mac for automatically clicking a heal potion when hps <= 25%, and I'm not stunned, hovering, or feigned:

|
Code:
|Uses Healing Potion if possible
		/If (${Me.PctHPs} <=25 && !${Me.Stunned} && ${Me.State.NotEqual[HOVER]} && ${Me.Standing} && ${FindItem[Distillate of Divine Healing XIII].InvSlot} && !${FindItem[Distillate of Divine Healing XIII].TimerReady}) {
		/potionbelt activate 1  
		/echo # CLICKING HEAL POTION!!!
		/popup CLICKING HEAL POTION!!!

For the SK's among us, I also did a leech touch else after the above:

Code:
} else /If (${Me.PctHPs} <=25 && !${Me.Stunned} && ${Me.State.NotEqual[HOVER]} && ${Me.Standing} && ${Me.AltAbilityReady[Leech Touch]}) {
         /casting "Leech Touch" alt -invis
    	 /echo # LIFE TAPPING!!!
    	 /popup LIFE TAPPING!!!
       }

MQ2Cast plugin is needed.
 
Timer

Could anyone put this to sit for a said number of seconds then and watch for need of a potion?

Code:
		/If (${Me.PctHPs} <=25 && !${Me.Stunned} && ${Me.State.NotEqual[HOVER]} && ${Me.Standing} && ${FindItem[Distillate of Divine Healing XIII].InvSlot} && !${FindItem[Distillate of Divine Healing XIII].TimerReady}) {
		/potionbelt activate 1  
		/echo # CLICKING HEAL POTION!!!
		/popup CLICKING HEAL POTION!!!
 
hmm

This is what i use, I check my health first, and then call a potion call sub to handle the potion without having to use /potionbelt.

So i can just use any potion i want from inventory.

Code:
|-------------------------------------------------------------------------------- 
|SUB: Check HP - During Fight
|-------------------------------------------------------------------------------- 
Sub CheckHP 

   /echo Checking my hitpoints, currently at (${Me.PctHPs}%) ...
   
   /if (${Me.PctHPs}<${InFightHP}) {
      /declare TempID int inner
      /varset  TempID ${Target.ID}
      /keypress forward 
      /keypress back 
      /keypress F1
      /delay 10 ${Target.ID}==${Me.ID}
      /echo Healing myself, because of low health...
      /call UseHoTPotion
      /delay 1s 
      
      /if (${TempID}) { 
	  /target id ${TempID}
	  /delay 10
      } else {
	  /squelch /target clear
      }

   }

/doevents 
   
/return
|--------------------------------------------------------------------------------

|--------------------------------------------------------------------------------
|SUB: UseHealPotion
|-------------------------------------------------------------------------------- 
Sub UseHoTPotion 

/declare MyBestHoTPotion   string local
/declare LevelMark          string local

/if (${Me.Level}>=1  && (${FindItem[Distillate of Celestial Healing I].ID}))  /varset LevelMark I
/if (${Me.Level}>=5  && (${FindItem[Distillate of Celestial Healing II].ID}))  /varset LevelMark II
/if (${Me.Level}>=10 && (${FindItem[Distillate of Celestial Healing III].ID})) /varset LevelMark III
/if (${Me.Level}>=20 && (${FindItem[Distillate of Celestial Healing IV].ID})) /varset LevelMark IV
/if (${Me.Level}>=30 && (${FindItem[Distillate of Celestial Healing V].ID})) /varset LevelMark V
/if (${Me.Level}>=40 && (${FindItem[Distillate of Celestial Healing VI].ID})) /varset LevelMark VI
/if (${Me.Level}>=50 && (${FindItem[Distillate of Celestial Healing VII].ID})) /varset LevelMark VII
/if (${Me.Level}>=55 && (${FindItem[Distillate of Celestial Healing VII].ID})) /varset LevelMark VIII
/if (${Me.Level}>=60 && (${FindItem[Distillate of Celestial Healing IX].ID})) /varset LevelMark IX
/if (${Me.Level}>=65 && (${FindItem[Distillate of Celestial Healing X].ID})) /varset LevelMark X
/if (${Me.Level}>=70 && (${FindItem[Distillate of Celestial Healing XI].ID})) /varset LevelMark XI
/if (${Me.Level}>=75 && (${FindItem[Distillate of Celestial Healing XII].ID})) /varset LevelMark XII
/if (${Me.Level}>=80 && (${FindItem[Distillate of Celestial Healing XIII].ID})) /varset LevelMark XIII

/varset MyBestHoTPotion "Distillate of Celestial Healing ${LevelMark}"
         
    /echo Checking for self healing potions.

    /if (${FindItem[${MyBestHoTPotion}].ID})   {
        /echo Using potion: ${MyBestHoTPotion}
        /call cast ${MyBestHoTPotion} item
        /if (${Cursor.ID}) /autoinventory
    } else {
        /echo I do not have any HoT potions !	    
    }         	      

/doevents
    
/return 
|--------------------------------------------------------------------------------


This way If i am using a toon who cant heal himself, i just call the UseHoTPotion sub.

The CheckHP can of course be expanded upon to first do a class check, and then either call UseHOtPotion if a non healer class, or call some other sub for self healing from healing spells.

I use variants of the UseHoTPotion sub to check for best HastePots ... and best Clarity Pots .... on toons to keep haste or clarity always on me... so it always uses the best available one i have based on my level and what is in inventory. Much more flexible than just being limited to what i have in potion belt slots.
 
Could anyone put this to sit for a said number of seconds then and watch for need of a potion?
You'd want to add a second if statement to check on your combat state. Actually, put that first maybe? You don't want to be sitting if you're in combat, you may not make it back up.