Check this shit out :P
lua code:
local playersToHeal = {
["Tank I"] = 80, -- HIGHEST PRIORITY [ek blocker]
["Tank II"] = 50, -- LOWER PRIORITY [palladin blocker]
["Elderapo"] = 99 -- LOWEST PRIORITY [ms/ed shooters]
}
local healingItem = "ultimate healing rune"
--[[ DO NOT EDIT ANYTHING BELOW THIS LINE ]]--
function useItemOnCreature(item, creature)
local itemID
local targetID
if (type(item) == "number") then
itemID = item
elseif (type(item) == "table") then
itemID = item:ID()
elseif (type(item) == "string") then
itemID = Item.GetID(item)
end
if (itemID == 0) then
return false
end
if (type(creature) == "number") then
targetID = creature
elseif (type(creature) == "table") then
targetID = creature:ID()
elseif (type(creature) == "string") then
local target = Creature.New(creature)
if (not target:isValid()) then
return false
end
targetID = target:ID()
end
for index, container in Container.iContainers() do
for slot, item in container:iItems() do
if (item.id == itemID) then
container:UseItemWithCreature(slot, targetID)
return true
end
end
end
return false
end
Module.New("uh-healer", function(mod)
for name, minHealth in pairs(playersToHeal) do
local player = Creature.New(name)
if (player:isOnScreen() and player:isValid() and player:isAlive()) then
if (player:HealthPercent() <= minHealth) then
useItemOnCreature(healingItem, player:ID())
break
end
end
end
end)