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.
1.4K
Fight Mode Toggle #39
Toggles current fight mode depending on amount of mobs around.
511b | 19 lines.
local fightmode = 1
macro(500, "Fight Mode 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 then
            monsters = monsters + 1
        end
    end
    if monsters >= 4 then
        fightmode = 3
    else
        fightmode = 1
    end

    if fightmode ~= g_game.getFightMode() then
        g_game.setFightMode(fightmode)
    end
end)
- remove | + add

12 Jun 2021
Ads