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:
Kizuno18 2026-07-18 16:42:37 -03:00 committed by GitHub
parent cd4441ed99
commit fec1cca042
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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