SHARE
TWEET

Untitled

a guest Jul 12th, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @cleartargetqueue
  2. //
  3. // First time use will prompt user for pets
  4. //
  5. if not listexists 'pets'
  6.   sysmsg "Pet Healing Macro - Version 1.5" 88
  7.   sysmsg "When prompted select one pet after another" 88
  8.   sysmsg "When all pets are selected, press ESC" 88
  9.   @createlist 'pets'
  10.   //
  11.   // Maximum 5
  12.   //
  13.   for 5
  14.     sysmsg "Select next pet" 88
  15.     promptalias 'pet'
  16.     if @findobject 'pet'
  17.       pushlist 'pets' 'pet'
  18.       sysmsg "Your pet has been saved, press ESC if you have no more pets" 44
  19.     else
  20.       break
  21.     endif
  22.   endfor
  23.   sysmsg "Thank you, pets saved, script is ready" 44
  24. endif
  25. //
  26. // No bandage warning
  27. //
  28. if @counttype '0xe21' 'any' 'backpack' == 0
  29.   sysmsg "No bandages!" 38
  30.   stop
  31. endif
  32. //
  33. // Low bandage warning
  34. //
  35. if @counttype '0xe21' 'any' 'backpack' < 20
  36.   sysmsg "Low bandages!" 38
  37. endif
  38. //
  39. // save equip states
  40. //
  41. if @findlayer 'self' 2
  42.   @setalias 'lhand' 'found'
  43. endif
  44. if @findlayer 'self' 1
  45.   @setalias 'rhand' 'found'
  46. endif
  47. //
  48. // temporary list
  49. //
  50. @removelist 'heal'
  51. @createlist 'heal'
  52. //
  53. // Check all pets in spell range for a cure
  54. //
  55. for 0 to 'pets'
  56.   if poisoned pets[] and @inrange pets[] 15
  57.     if mana 'self' > 6
  58.       headmsg "+Curing+" 172
  59.       cast 'Cure'
  60.       waitfortarget 5000
  61.       target! pets[]
  62.       //
  63.       // Reequip
  64.       //
  65.       if not @findlayer 'self' 1
  66.         equipitem 'rhand' 1
  67.       endif
  68.       if not @findlayer 'self' 2
  69.         equipitem 'lhand' 2
  70.       endif
  71.     endif
  72.   endif
  73. endfor
  74. @clearlist 'heal'
  75. //
  76. // Find most wounded pet near you
  77. //
  78. for 0 to 'pets'
  79.   if @inrange pets[] 15
  80.     //
  81.     // Dead pets cannot be resurrected near aggro
  82.     //
  83.     if hits pets[] == 0
  84.       @unsetalias 'enemy'
  85.       @getenemy 'murderer' 'enemy' 'criminal' 'gray'
  86.       if @inrange 'enemy' 6
  87.         sysmsg "Dead pets cannot resurrected near aggro" 172
  88.         continue
  89.       endif
  90.     endif
  91.     //
  92.     // Check empty heal list
  93.     //
  94.     if list 'heal' == 0
  95.       @pushlist 'heal' pets[]
  96.       continue
  97.     endif
  98.     //
  99.     // Compare next pet to previous
  100.     //
  101.     if diffhits pets[] > diffhits heal[0]
  102.       @clearlist 'heal'
  103.       @pushlist 'heal' pets[]
  104.     endif
  105.   endif
  106. endfor
  107. //
  108. // Warn user about bandge continuation
  109. //
  110. if @timerexists 'vet' and @timer 'vet' < 8000
  111.   sysmsg "Waiting for previous bandage to finish" 172
  112. endif
  113. //
  114. // Heal pet
  115. //
  116. if not @timerexists 'vet'
  117.   //
  118.   // Check most damaged pet in range for heal
  119.   //
  120.   if not @inrange heal[0] 2 and @diffhits heal[0] > 0
  121.     headmsg "(closer)" 172
  122.     pause 2000
  123.     replay
  124.   endif
  125.   //
  126.   //  Heal pet
  127.   //
  128.   if @diffhits heal[0] > 0
  129.     headmsg "+Healing+" 172
  130.     autotargetobject heal[0]
  131.     @canceltarget
  132.     usetype! 0xe21 'any' 'backpack'
  133.     @clearjournal
  134.     settimer 'vet' 0
  135.   endif
  136. endif
  137. //
  138. // Wait for bandage finish
  139. //
  140. if @timerexists 'vet'
  141.   while timer 'vet' < 8000
  142.     if @injournal 'heal' 'system'
  143.       break
  144.     endif
  145.     if @injournal 'cure' 'system'
  146.       break
  147.     endif
  148.     if @injournal 'finish' 'system'
  149.       break
  150.     endif
  151.     if @injournal 'not damaged' 'system'
  152.       break
  153.     endif
  154.     if @injournal 'resurrect' 'system'
  155.       break
  156.     endif
  157.   endwhile
  158.   @removetimer 'vet'
  159. endif
  160. pause 1000
  161. replay
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top