From fec1cca042c8e89a96fef092078d4a01a2a41052 Mon Sep 17 00:00:00 2001 From: Kizuno18 <110933270+Kizuno18@users.noreply.github.com> Date: Sat, 18 Jul 2026 16:42:37 -0300 Subject: [PATCH] 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. --- .../default_configs/cavebot_1.3/targetbot/target.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mods/game_bot/default_configs/cavebot_1.3/targetbot/target.lua b/mods/game_bot/default_configs/cavebot_1.3/targetbot/target.lua index 9bf04f6ea..df0e081fa 100644 --- a/mods/game_bot/default_configs/cavebot_1.3/targetbot/target.lua +++ b/mods/game_bot/default_configs/cavebot_1.3/targetbot/target.lua @@ -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