mirror of
https://github.com/OTCv8/otclientv8.git
synced 2025-12-17 09:27:11 +01:00
Updated to OTCv8 3.1 rev 118
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
CaveBot.Actions = {}
|
||||
|
||||
vBot.lastLabel = ""
|
||||
|
||||
local antiTrapTriggered = false
|
||||
-- it adds an action widget to list
|
||||
@@ -77,6 +77,7 @@ CaveBot.registerAction = function(action, color, callback)
|
||||
end
|
||||
|
||||
CaveBot.registerAction("label", "yellow", function(value, retries, prev)
|
||||
vBot.lastLabel = value
|
||||
return true
|
||||
end)
|
||||
|
||||
@@ -177,7 +178,8 @@ CaveBot.registerAction("goto", "green", function(value, retries, prev)
|
||||
if not path2 then
|
||||
local target = {} -- c = creature, d = distance
|
||||
for i, spec in pairs(getSpectators()) do
|
||||
if spec:isMonster() then
|
||||
local hppc = spec:getHealthPercent()
|
||||
if spec:isMonster() and (hppc and hppc > 0) then
|
||||
local path = findPath(playerPos, spec:getPosition(), 7, { ignoreNonPathable = true, precision = 1 })
|
||||
if path then
|
||||
local dist = getDistanceBetween(pos, spec:getPosition())
|
||||
@@ -193,8 +195,7 @@ CaveBot.registerAction("goto", "green", function(value, retries, prev)
|
||||
end
|
||||
g_game.setChaseMode(1)
|
||||
CaveBot.setOff()
|
||||
antiTrapTriggered = true
|
||||
return "retry"
|
||||
schedule(1000, function() CaveBot.setOn() end)
|
||||
else
|
||||
return false -- no other way
|
||||
end
|
||||
@@ -234,13 +235,6 @@ CaveBot.registerAction("goto", "green", function(value, retries, prev)
|
||||
return "retry"
|
||||
end)
|
||||
|
||||
onAttackingCreatureChange(function(creature, oldCreature)
|
||||
if antiTrapTriggered then
|
||||
CaveBot.setOn()
|
||||
antiTrapTriggered = false
|
||||
end
|
||||
end)
|
||||
|
||||
CaveBot.registerAction("use", "#FFB272", function(value, retries, prev)
|
||||
local pos = regexMatch(value, "\\s*([0-9]+)\\s*,\\s*([0-9]+)\\s*,\\s*([0-9]+)")
|
||||
if not pos[1] then
|
||||
|
||||
Reference in New Issue
Block a user