Friend Healer
lua code:local target = { -- add targets u want to heal and at what percent
['Furpan'] = 40,
['Furpans Friend'] = 40
}
local option = {
sio = true, -- use sio to heal friend
rune = true, -- use rune to heal friend
potion = true, -- use potion to heal friend
rune_id = 3160, -- what rune to heal friend
potion_id = 236 -- what potion to heal friend
}
local prio = {'sio', 'rune', 'potion'} -- in what order should we check?
Module.New('HEAL', function(mod)
local breaking = false
for i = 1, 3 do
if (option[prio[i]]) then
if (prio[i] == 'sio') then
for name, percent in pairs(target) do
local c = Creature.New(name)
if (c:isOnScreen()) then
if (c:HealthPercent() < percent) then
Self.Say('exura sio "' .. name)
breaking = true
break
end
end
end
if (breaking) then break end
elseif (prio[i] == 'rune') then
for name, percent in pairs(target) do
local c = Creature.New(name)
if (c:isOnScreen()) then
if (c:HealthPercent() < percent) then
Self.UseItemWithCreature(option['rune_id'], c:ID())
breaking = true
break
end
end
end
if (breaking) then break end
elseif (prio[i] == 'potion') then
for name, percent in pairs(target) do
local c = Creature.New(name)
if (c:isOnScreen()) then
if (c:HealthPercent() < percent and c:DistanceFromSelf() == 1) then
Self.UseItemWithCreature(option['potion_id'], c:ID())
breaking = true
break
end
end
end
if (breaking) then break end
end
end
end
mod:Delay(500)
end)