mirror of
https://github.com/mehah/otclient
synced 2026-08-15 16:29:06 -04:00
fix: expose TargetBot.Danger() in cavebot_1.3 for cave scripts (#1754)
New Features: - Added a new target danger readout, making the current danger value available during gameplay. - Danger information now tracks consistently with each macro cycle, improving real-time visibility into risk level.
This commit is contained in:
parent
cd4441ed99
commit
fec1cca042
1 changed files with 9 additions and 0 deletions
|
|
@ -3,6 +3,7 @@ local config = nil
|
|||
local lastAction = 0
|
||||
local cavebotAllowance = 0
|
||||
local lureEnabled = true
|
||||
local dangerValue = 0
|
||||
|
||||
-- ui
|
||||
local configWidget = UI.Config()
|
||||
|
|
@ -67,6 +68,7 @@ targetbotMacro = macro(100, function()
|
|||
local looting = TargetBot.Looting.process(targets, dangerLevel)
|
||||
local lootingStatus = TargetBot.Looting.getStatus()
|
||||
|
||||
dangerValue = dangerLevel
|
||||
ui.danger.right:setText(dangerLevel)
|
||||
if highestPriorityParams and not isInPz() then
|
||||
ui.target.right:setText(highestPriorityParams.creature:getName())
|
||||
|
|
@ -211,6 +213,13 @@ TargetBot.enableLuring = function()
|
|||
lureEnabled = true
|
||||
end
|
||||
|
||||
TargetBot.Danger = function()
|
||||
if not TargetBot.isOn() then
|
||||
return 0
|
||||
end
|
||||
return dangerValue
|
||||
end
|
||||
|
||||
-- attacks
|
||||
local lastSpell = 0
|
||||
local lastAttackSpell = 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue