Script OT cliente Atacar todos os bixos e ignorar os pets


Angel And Hells

Recommended Posts

auto_attack = cycleEvent(function()
  ignore = {'Pet Archer', 'Pet Blaze', 'Pet Dog', 'Pet Mage', 'Pet Mercenary', 'Pet Witchdoctor', 'Pet Wolf'}
  if not g_game.isOnline() then 
    return 
  end
  
  if g_game.isAttacking() then 
    return 
  end

  local player = g_game.getLocalPlayer()
  local spec = g_map.getSpectators(player:getPosition())

  function isInArray(tbl, value)
    for k, v in ipairs(tbl) do
      if v == value then
        return k
      end
    end
    return false
  end

  for k,monster in pairs(spec) do
    if not isInArray(ignore, monster:getName()) then
      if monster:isMonster() and not monster:isPlayer() and not monster:isNpc() then
        g_game.attack(monster)
        break
      end
    end
  end
end, 400)

 

  • Like 4
Link to comment
Share on other sites

6 hours ago, ThiagoMetal said:

auto_attack = cycleEvent(function()
  ignore = {'Pet Archer', 'Pet Blaze', 'Pet Dog', 'Pet Mage', 'Pet Mercenary', 'Pet Witchdoctor', 'Pet Wolf'}
  if not g_game.isOnline() then 
    return 
  end
  
  if g_game.isAttacking() then 
    return 
  end

  local player = g_game.getLocalPlayer()
  local spec = g_map.getSpectators(player:getPosition())

  function isInArray(tbl, value)
    for k, v in ipairs(tbl) do
      if v == value then
        return k
      end
    end
    return false
  end

  for k,monster in pairs(spec) do
    if not isInArray(ignore, monster:getName()) then
      if monster:isMonster() and not monster:isPlayer() and not monster:isNpc() then
        g_game.attack(monster)
        break
      end
    end
  end
end, 400)

 

E para incluir um ataque por SD ou magia, quais os lugares editar?

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.