Advertisement
Cavitt

Auto Healer Version 1.02

Jan 8th, 2012
763
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.83 KB | None | 0 0
  1. --[[
  2.     Auto Healer
  3.     Version 1.02
  4.     Created by Syntax
  5. ]]
  6.  
  7. local config = {
  8.     WhiteList = {"DarkstaR", "Syntax"},
  9.     healWhiteList = true, -- heal players specified in the whitelist
  10.     healParty = true, -- heal party members
  11.     healAlly = true, -- heal war allies
  12.    
  13.     range = 4, -- max distance to heal players
  14.     mana = 140, -- minimum mana needed to cast
  15.     health = 40, -- % of friend's health to heal at
  16.    
  17.     method = "exura sio" -- this is the only method currently, rune healing will be added later
  18. }
  19.  
  20. local function sio(name)
  21.     if(Self.Mana() >= config.mana)then
  22.         Self.Say("exura sio \""..name)
  23.         sleep(math.random(200,600))
  24.     end
  25. end
  26.  
  27. local function think()
  28.     for i = CREATURES_LOW, CREATURES_HIGH do
  29.         local creature = Creature.GetFromIndex(i)
  30.         if (creature:isValid()) then
  31.             if (creature:isOnScreen() and creature:isVisible() and creature:isAlive()) then
  32.                 local name = creature:Name()
  33.                 if(creature:isWarAlly() and config.healAlly) or (creature:isPartyMember() and config.healParty) or (table.find(config.WhiteList, name, false) and config.healWhiteList)then
  34.                     if(creature:DistanceFromSelf() <= config.range) and (creature:HealthPercent() <= config.health)then
  35.                         if(config.method == "exura sio")then
  36.                             sio(name)
  37.                         else
  38.                             displayInformationMessage("Unsupported method type in Auto Healer Script!")
  39.                         end
  40.                     end
  41.                 end
  42.             end
  43.         end
  44.     end
  45.     sleep(math.random(100,300))
  46.     think()
  47. end
  48.  
  49. local function display()
  50.     local display = "Auto Healer by Syntax (v1.02)\n------------------\n\nMethod: " .. config.method .. "\nHeal Party: " .. tostring(config.healParty) .. "\n" .. "Heal War Allies: " .. tostring(config.healAlly)
  51.     if(config.healWhiteList)then
  52.         display = display .. "\n" .. "Heal Players:" .. table.concat(config.WhiteList, ", ")
  53.     end
  54.     displayInformationMessage(display)
  55. end
  56.  
  57. display()
  58. think()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement