Your browser does not support JavaScript or its disabled!
Please turn it on, or be aware that some features on this website will not work correctly.
311
TargetBot Toggle #41
564b | 15 lines.
macro(500, "target toggle", function()
    if isInPz() then return end
    local monsters = 0
    for i, mob in ipairs(getSpectators(posz())) do
        if mob:isMonster() and getDistanceBetween(player:getPosition(), mob:getPosition()) >= 1 and getDistanceBetween(player:getPosition(), mob:getPosition()) <= 5 then
            monsters = monsters + 1
        end
    end

    if monsters >= 5  then
      if TargetBot:isOff() then TargetBot:setOn() end
    elseif monsters == 0  then
      if TargetBot:isOn() then TargetBot:setOff() end
    end
end)

25 Jun 2021