Install:
Just copy and paste on Bot > Tools > Ingame macro editor
Usage:
Go to Bot > Tools. Click on Friends Field, fill your friend to heal separated by a comma. Push the button "heal sio friends" to enable/disable the system.
Note:
1. The script is preset to heal when friend health percent is lower than 70%, to change this value, check the gpHealPercent variable.
Script:
Code:
Code:
local gpHealFriends = {}
local gpHealPercent = 70
local enableHealFriends = macro(1000, "Heal Sio Friends", function()
end)
addLabel("gpHealFriendLabel", "Friends:")
addTextEdit("healfriend", table.concat(gpHealFriends, ","), function(widget, text)
setFriends(text)
widget:setText(text)
end)
onCreatureHealthPercentChange(function (creature, healthPrecent)
checkFriend(creature)
end)
onCreatureAppear(function (creature)
checkFriend(creature)
end)
onCreaturePositionChange (function ()
checkFriends()
end)
function checkFriends()
if enableHealFriends:isOff() then
return
end
local spectators = getSpectators(pos(), false)
for i, spec in pairs(spectators) do
checkFriend(spec)
end
end
function checkFriend(creature)
if enableHealFriends:isOff() or not creature:isPlayer() then
return
end
if not table.contains(gpHealFriends, creature:getName()) then
return
end
if creature:getHealthPercent() <= gpHealPercent then
say(string.format("exura sio \"%s", creature:getName()))
end
end
function setFriends(text)
local result = {}
for friend in text:gmatch("([^,]+)") do
table.insert(result, friend)
end
gpHealFriends = result
end
![[Image: sio.gif]](https://tibian.pl/images/sio.gif)