Lure Cave
Desligue o cavebot quando tiver mais de 2 monstros na tela e ligue quando tiver menos de 1
Autor:
function distanceFromPlayer(coords)
if not coords then return false end
return getDistanceBetween(pos(), coords)
end
function getMonsters(range, multifloor)
if not range then range = 10 end
local mobs = 0;
for _, spec in pairs(getSpectators(multifloor)) do
mobs = (g_game.getClientVersion() < 960 or spec:getType() < 3) and
spec:isMonster() and distanceFromPlayer(spec:getPosition()) <=
range and mobs + 1 or mobs;
end
return mobs;
end
macro(500, "Lure", function()
if getMonsters() > 2 then
CaveBot.setOff()
else
if getMonsters() < 1 then
CaveBot.setOn()
end
end
end)