Configure the pets list at the beginning of this macro, you'll need to add a new "pushlist" command followed by serial number for each pet you want to consider as a valid target. Remember to clear the list after editing it.
Q: Where can I find the pet serial number?
A: Go to the "Macros" tab, click the "Object Inspector" button, select your pet in-game and check the popup window (use CTRL+C to copy that number).
Q: How can I clear my pets list?
A: You can close your client and open it again or, even better: go to the "Macros" tab, click the "Active Objects" button, check the popup window, click the "Lists" tab, find the "pets" list and right click it to remove (you can also click the "Clear All" button but it will remove all available lists, aliases, etc). Another option is to say the following command in-game: -removelist 'pets'
Code: Select all
// Author: Di
// Description: search for damaged pets and heal most needed
if not listexists 'pets'
createlist 'pets'
// Add your pet serials here
pushlist 'pets' 0x...
pushlist 'pets' 0x...
pushlist 'pets' 0x...
endif
if not targetexists and not waitingfortarget
@unsetalias 'pet'
for 0 to 'pets'
if not @findobject 'pets[]'
continue
endif
if not poisoned 'pets[]'
if @yellowhits 'pets[]' or @hits 'pets[]' == maxhits 'pets[]'
continue
endif
endif
if @findobject 'pet' and @hits 'pet' < hits 'pets[]'
continue
endif
@setalias 'pet' 'pets[]'
endfor
if @inrange 'pet' 2 and usequeue == 0
if @usetype! 0xe21 'any' 'backpack'
waitfortarget 1000
if targetexists 'beneficial'
target! 'pet'
pause 3000
endif
else
sysmsg 'Out of bandages!' 22
stop
endif
endif
endif