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.
383
TargetBot Blacklist #50
Add blacklisted items to TargetingBot.
Example from 1.3
File: targetbot/target.lua | 1.02kb | 17 lines.
 -- main loop, controlled by config
targetbotMacro = macro(100, function()
  local pos = player:getPosition()
  local creatures = g_map.getSpectatorsInRange(pos, false, 6, 6) -- 12x12 area
  if #creatures > 10 then -- if there are too many monsters around, limit area
    creatures = g_map.getSpectatorsInRange(pos, false, 3, 3) -- 6x6 area
  end
  local highestPriority = 0
  local dangerLevel = 0
  local targets = 0
  local highestPriorityParams = nil
+ local tblackList = { "rat", "dog", "cat", "training dummy"}
  for i, creature in ipairs(creatures) do
    local path = findPath(player:getPosition(), creature:getPosition(), 7, {ignoreLastCreature=true, ignoreNonPathable=true, ignoreCost=true})
-   if creature:isMonster() and (oldTibia or creature:getType() < 3) and path then
+   if creature:isMonster() and (oldTibia or creature:getType() < 3) and path and not table.contains(tblackList, creature:getName(), true) then
      local params = TargetBot.Creature.calculateParams(creature, path) -- return {craeture, config, danger, priority}

24 Jul 2021