Atacar Monstros

Descrição

Atacar todos os monstros que aparecer na sua tela.

Autor:

                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
macro(100, "Mobs", function() local battlelist = getSpectators(); local closest = 10 local lowesthpc = 101 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() < lowesthpc then lowesthpc = 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() <= lowesthpc then g_game.attack(val) delay(100) break end end end end end)