Message
Message
local monsters = 0
for i, mob in ipairs(getSpectators(posz())) do
if mob:isMonster() and getDistanceBetween(player:getPosition(),
mob:getPosition()) <=3 then -- verificar monstros num raio de 10 sqm
monsters = monsters + 1
end
end
if monsters >= 1 then -- quantidade de monstros
saySpell('self destruction', 200) -- magia a ser alterada
end
end)
-------------
macro(100, "Target Inteligente", function()
local battlelist = getSpectators();
local closest = 10
local highesthpc = 1
for key, val in pairs(battlelist) do
if val:isMonster() then
if getDistanceBetween(player:getPosition(), val:getPosition()) <= closest
then
closest = getDistanceBetween(player:getPosition(), val:getPosition())
if val:getHealthPercent() > highesthpc then
highesthpc = val:getHealthPercent()
end
end
end
end
for key, val in pairs(battlelist) do
if val:isMonster() then
if getDistanceBetween(player:getPosition(), val:getPosition()) <= closest
then
if g_game.getAttackingCreature() ~= val and val:getHealthPercent() >=
highesthpc then
g_game.attack(val)
break
end
end
end
end
end)
UI.Separator()
UI.Label("Auto Follow")
if tfollow then
if tfollow:getName() ~= storage[followName].player then
followTE:setText(tfollow:getName())
storage[followName].player = tfollow:getName()
end
end
end
end)
onTextMessage(function(mode, text)
if exit.isOff() then return end
if not text:find("You have finished the Future Saiyans task") then return end
CaveBot.gotoLabel("exit")
delay(500)
return true
end)
local showhp = macro(20000, "Monster HP %", function() end)
onCreatureHealthPercentChange(function(creature, healthPercent)
if showhp:isOff() then return end
if creature:isMonster() or creature:isPlayer() and creature:getPosition() and
pos() then
if getDistanceBetween(pos(), creature:getPosition()) <= 5 then
creature:setText(healthPercent .. "%")
else
creature:clearText()
end
end
end)
addLabel("Label", "Follow Name")
addTextEdit("TxtEdit", storage.fName or "name", function(widget, text)
storage.fName = text
end)
--------------------------
local lastPos = nil
macro(200, "Follow", function()
local leader = getCreatureByName(storage.fName)
local target = g_game.getAttackingCreature()
if leader then
if target and lastPos then
return player:autoWalk(lastPos)
end
if not g_game.getFollowingCreature() then
return g_game.follow(leader)
end
elseif lastPos then
player:autoWalk(lastPos)
end
end)