Enhanced Auto Pet Heal - Now with lists!

Lopsang

Master
Rather than the traditional pet heal macros this one operates on lists so you never have to retarget your pets. If you mount, stable or claim a new pet it automatically picks it up (provided its serial is in your list). Works very well with mounts.

I also added provoke / "all kill" protection, where if you have a cursor up it will not hijack the cursor.

###################################################

Updates:
  1. fixed a bug / added code to ensure the pets never equal each other
  2. added conditional to not search for new pets if both are defined

Code:
if not listexists 'petlist'
  createlist 'petlist'
  //add an entry for each pet you hunt with:
  @pushlist 'petlist' 0x176ca2 // rare white horse
  @pushlist 'petlist' 0x1572d2 // meta
  @pushlist 'petlist' 0x2627 // white wyrm
endif
//Removes pets if mounted, stabled or you get too far away
if findalias 'Pet1' and not @findobject 'Pet1'
  unsetalias 'Pet1'
endif
if findalias 'Pet2' and not @findobject 'Pet2'
  unsetalias 'Pet2'
endif
//makes sure the pets never equal each other
if findalias 'Pet1' and findalias 'Pet2'
  if serial 'Pet1' == serial 'Pet2'
    unsetalias 'Pet2'
  endif
endif
//Searches for your pets when you don't have 2 active
if not @findobject 'Pet1' or not @findobject 'Pet2'
  for 0 to 'petlist'
    if @findobject petlist[] 'any' 'ground' 0 30
      if not @findobject 'Pet1'
        setalias 'Pet1' petlist[]
      elseif not @findobject 'Pet2' and serial 'Pet1' != 'petlist[]'
        setalias 'Pet2' petlist[]
      endif
    endif
  endfor
endif
// sets backup bandie timer just in case
if not timerexists 'bandie'
  settimer 'bandie' 10000
endif
// provoke protection if target cursor exists
if not targetexists
  //Starts healing your pets
  if @injournal 'finish applying' 'system' or timer 'bandie' >= 10000
    if @findobject 'Pet1' and @findobject 'Pet2'
      if hits 'Pet1' < 90 or hits 'Pet2' < 90
        if diffhits 'Pet1' > diffhits 'Pet2' and @inrange 'Pet1' 1
          usetype 0xe21 'any' 'backpack'
          waitfortarget 3500
          target! 'Pet1'
          settimer 'bandie' 0
        elseif @inrange 'Pet2' 1 and hits 'Pet2' < 90
          usetype 0xe21 'any' 'backpack'
          waitfortarget 3500
          target! 'Pet2'
          settimer 'bandie' 0
        endif
        clearjournal
        pause 1000
      endif
    elseif @findobject 'Pet1' or @findobject 'Pet2'
      if hits 'found' < 90 and @inrange 'found' 1
        usetype 0xe21 'any' 'backpack'
        waitfortarget 3500
        target! 'found'
        settimer 'bandie' 0
        clearjournal
        pause 1000
      endif
    endif
  endif
endif
if @injournal 'too far away' 'system'
  @clearjournal
elseif @injournal 'stay close enough' 'system'
  @clearjournal
endif
 
Last edited by a moderator:

Nasty_Girl

Apprentice
Hello,

I like this script like hell...if anyone could implemet this (look below) it would be perfect...

1.) Message to GET CLOSER: (real cool feature)
while not @inrange 'pet1' 2 and not @inrange 'pet2' 2
headmsg "Get closer"
pause 300

2.) Auto Protection:
//Auto Protection
if not timerexists 'Protect'
createtimer 'Protect'
settimer 'Protect' 300000
endif
if timer 'Protect' >= 300000
cast 'Protection'
settimer 'Protect' 0
endif

3.) Auto Bless if overloaded:
[found no code]

4.) PK Protection like Sussex' Tamer assistant: (optional)
//Find RuneBook
if not findalias 'Escape Book'
promptalias 'Escape Book'
endif
// Pk Recall Routine
@unsetalias 'friend'
getfriend 'murderer' 'humanoid' 'closest'
while @inrange 'friend' 28
cast "Recall"
msg 'all follow me'
pause 200
msg 'all follow me'
pause 50
msg 'all follow me'
pause 50
msg 'all follow me'
pause 50
msg 'all follow me'
waitfortarget 2000
target! 0x406afe4f
@unsetalias 'friend'
endwhile

Maybe a job for @Experience :rolleyes:

So Long,

Nasty
 

Experience

Grandmaster
Untested, so please test it and lemme know if there's any issues


if not listexists 'petlist'
createlist 'petlist'
endif
//add an entry for each pet you hunt with:
@pushlist 'petlist' '' // Death Beetle
@pushlist 'petlist' '' // Meta
@pushlist 'petlist' '' // white wyrm
//Removes pets if mounted, stabled or you get too far away
if findalias 'pet1' and not @findobject 'pet1'
unsetalias 'pet1'
endif
if findalias 'Pet2' and not @findobject 'pet2'
unsetalias 'pet2'
endif
//makes sure the pets never equal each other
if findalias 'pet1' and findalias 'pet2'
if serial 'pet1' == serial 'pet2'
unsetalias 'pet2'
endif
endif
//Searches for your pets when you don't have 2 active
if not @findobject 'pet1' or not @findobject 'pet2'
for 0 to 'petlist'
if @findobject petlist[] 'any' 'ground' 0 30
if not @findobject 'pet1'
setalias 'pet1' petlist[]
elseif not @findobject 'pet2' and serial 'pet1' != 'petlist[]'
setalias 'pet2' petlist[]
endif
endif
endfor
endif
//Anti-PK Runebook
if not @findobject 'Escape book'
promptalias 'Escape book'
endif
//Experience
//Heals 2 pets.
//Included health/weight check on self
//Auto Protection
if not timerexists 'Protect'
createtimer 'Protect'
settimer 'Protect' 300000
endif
if timer 'Protect' >= 300000
cast 'Protection'
settimer 'Protect' 0
endif
@cleartargetqueue
@clearjournal
if dead 'self'
stop
endif
if not timerexists 'VetBandage'
createtimer 'VetBandage'
settimer 'VetBandage' 0
endif
//Setup
if not findalias 'pet1'
headmsg 'Select first pet'
promptalias 'pet1'
endif
if not findalias 'pet2'
headmsg 'Select second pet'
promptalias 'pet2'
endif
//Heal them to full
while not @inrange 'pet1' 2 and not @inrange 'pet2' 2
headmsg "Get closer"
pause 300
endwhile
//Pk Detection
@getenemy 'criminal' 'murderer' 'humanoid' 'closest'
if @graphic 'enemy' == 401 or if @graphic 'enemy' == 402
while inrange 'enemy' 15
cast 'recall'
autotargetobject 'Escape book'
msg 'All Come'
pause 500
msg 'All Follow me'
pause 500
msg 'All Come'
pause 500
msg 'All Follow me'
pause 1500
endwhile
endif
while hits 'pet1' == maxhits 'pet1' and hits 'pet2' == maxhits 'pet2'
if weight > maxweight
cast 'bless' 'self'
endif
pause 500
endwhile
if diffhits 'pet1' > diffhits 'pet2'
if @inrange 'pet1' 1 and timer 'VetBandage' >= '6100'
bandage
autotargetobject! 'pet1'
settimer 'VetBandage' 0
if poisoned 'pet1'
pause 1200
endif
@cleartargetqueue
endif
else
if @inrange 'pet2' 1 and timer 'VetBandage' >= '6100'
bandage
autotargetobject! 'pet2'
settimer 'VetBandage' 0
if poisoned 'pet2'
pause 1200
endif
@cleartargetqueue
endif
endif
if not @injournal 'finish' 'system'
pause 800
replay
elseif @injournal 'finish' 'system'
@clearjournal
replay
elseif @injournal 'too far away' 'system'
@clearjournal
replay
elseif @injournal 'stay close enough' 'system'
@clearjournal
replay
endif
@clearjournal
 

stunoma.

Grandmaster
Lol seems like everyone wants to do less playing the game and more sitting around and watching scripts go off


Sent from my iPhone using Tapatalk
 

Experience

Grandmaster
@Nasty_Girl Should be good to go. That's what I get for using copy/paste haha



if not listexists 'petlist'
createlist 'petlist'
endif
//add an entry for each pet you hunt with:
@pushlist 'petlist' '' // Death Beetle
@pushlist 'petlist' '' // Meta
@pushlist 'petlist' '' // white wyrm
//Removes pets if mounted, stabled or you get too far away
if findalias 'pet1' and not @findobject 'pet1'
unsetalias 'pet1'
endif
if findalias 'Pet2' and not @findobject 'pet2'
unsetalias 'pet2'
endif
//makes sure the pets never equal each other
if findalias 'pet1' and findalias 'pet2'
if serial 'pet1' == serial 'pet2'
unsetalias 'pet2'
endif
endif
//Searches for your pets when you don't have 2 active
if not @findobject 'pet1' or not @findobject 'pet2'
for 0 to 'petlist'
if @findobject petlist[] 'any' 'ground' 0 30
if not @findobject 'pet1'
setalias 'pet1' petlist[]
elseif not @findobject 'pet2' and serial 'pet1' != 'petlist[]'
setalias 'pet2' petlist[]
endif
endif
endfor
endif
//Anti-PK Runebook
if not @findobject 'Escape book'
promptalias 'Escape book'
endif
//Experience
//Heals 2 pets.
//Included health/weight check on self
//Auto Protection
if not timerexists 'Protect'
createtimer 'Protect'
settimer 'Protect' 300000
endif
if timer 'Protect' >= 300000
cast 'Protection'
settimer 'Protect' 0
endif
@cleartargetqueue
@clearjournal
if dead 'self'
stop
endif
if not timerexists 'VetBandage'
createtimer 'VetBandage'
settimer 'VetBandage' 0
endif
//Setup
if not findalias 'pet1'
headmsg 'Select first pet'
promptalias 'pet1'
endif
if not findalias 'pet2'
headmsg 'Select second pet'
promptalias 'pet2'
endif
//Heal them to full
while not @inrange 'pet1' 2 and not @inrange 'pet2' 2
headmsg "Get closer"
pause 300
endwhile
//Pk Detection
@getenemy 'criminal' 'murderer' 'humanoid' 'closest'
if @graphic 'enemy' == 401 or @graphic 'enemy' == 402
while inrange 'enemy' 15
cast 'recall'
autotargetobject 'Escape book'
msg 'All Come'
pause 500
msg 'All Follow me'
pause 500
msg 'All Come'
pause 500
msg 'All Follow me'
pause 1500
endwhile
endif
while hits 'pet1' == maxhits 'pet1' and hits 'pet2' == maxhits 'pet2'
if weight > maxweight
cast 'bless' 'self'
endif
pause 500
endwhile
if diffhits 'pet1' > diffhits 'pet2'
if @inrange 'pet1' 1 and timer 'VetBandage' >= '6100'
bandage
autotargetobject! 'pet1'
settimer 'VetBandage' 0
if poisoned 'pet1'
pause 1200
endif
@cleartargetqueue
endif
else
if @inrange 'pet2' 1 and timer 'VetBandage' >= '6100'
bandage
autotargetobject! 'pet2'
settimer 'VetBandage' 0
if poisoned 'pet2'
pause 1200
endif
@cleartargetqueue
endif
endif
if not @injournal 'finish' 'system'
pause 800
replay
elseif @injournal 'finish' 'system'
@clearjournal
replay
elseif @injournal 'too far away' 'system'
@clearjournal
replay
elseif @injournal 'stay close enough' 'system'
@clearjournal
replay
endif
@clearjournal
 

Dimok

Master
That top macro doesn't work for me at all. Tried putting in my deathbeetle in pet list, maybe I'm doin something wrong
 

Fuego

Grandmaster
@Experience Is this one better[your still my king] then your vet one?? Digging the auto cast protection, bless and recall features. Downfall, no pet4 Draon in it.
 

Experience

Grandmaster
It depends on your use for it. The reason I dont like the list idea is if you are trying to heal an allies pets or w/e you have to use a diff macro or do it manually because they aren't in the list. and if they are it will conflict with your pets when all pets are visible
 
Top