Atacar Monstros

Descrição

Atacar todos os montros da tela, ignorando os monstros da lista.

Autor: Luiz

                --monstros que vão ser ignorados no target
local monstrosIgnorados = {
    ['bunny'] = true,
    ['ninja'] = true,
    ['pet'] = true,
    ['clone'] = true,
}

local distancia2 = 7 -- distancia para atacar os monstros

macro(200, "Atacar Monstros", function()
local monstros = g_map.getSpectators(g_game.getLocalPlayer():getPosition(), false)
for k,v in pairs(monstros) do  
    if not isInPz() and v:isMonster() and not g_game.isAttacking() 
      and not monstrosIgnorados[v:getName():lower()] 
      and getDistanceBetween(pos(), v:getPosition()) <= distancia2 then
            g_game.attack(v)
        end
    end
end)