Silence trainer scan noise during Growl auto-teach

- Add MTH_Growl_IsTeaching(); the beast-training scanner skips its chat
  feedback while auto-teach is driving the trainer window (no more
  'scan did not run yet' spam on tame)
- Confirm the taught rank in chat: 'Auto-taught Growl (Rank N) to <pet>.'
This commit is contained in:
DuvelCorp
2026-09-13 10:46:23 +02:00
parent dec41628ad
commit 71c84e1704
2 changed files with 19 additions and 0 deletions
+4
View File
@@ -714,6 +714,10 @@ local function MTH_PT_RunDoubleScan(triggerBase)
or triggerText == "beast-training-rows-open"
or triggerText == "petbook-visible-poll"
)
-- Stay quiet while Growl auto-teach is driving the trainer window.
if feedbackOnOpen and type(MTH_Growl_IsTeaching) == "function" and MTH_Growl_IsTeaching() then
feedbackOnOpen = false
end
if not MTH_PT_ShouldScanNow() then
if MTH_PT_DebugLog then
MTH_PT_DebugLog("scan skipped: no beast-training rows, trigger=" .. tostring(triggerBase or ""))
+15
View File
@@ -151,6 +151,16 @@ local MTH_Growl_Pending = nil
-- The offer currently awaiting the player's Yes/No answer. { rank, name, level }
local MTH_Growl_Offer = nil
-- While we auto-open the trainer to teach Growl, silence the Beast Training
-- scanner's chat feedback (set on confirm; expires after the teach window).
local MTH_Growl_SuppressScanUntil = 0
function MTH_Growl_IsTeaching()
local getTime = MTH_Growl_GetGlobal("GetTime")
local now = (type(getTime) == "function" and getTime()) or 0
return now < (MTH_Growl_SuppressScanUntil or 0)
end
local function MTH_Growl_TryTrainNow()
if not MTH_Growl_Pending or MTH_Growl_Pending.done then
return false
@@ -195,6 +205,9 @@ local function MTH_Growl_TryTrainNow()
MTH_Growl_DebugLog("Trained Growl Rank " .. tostring(bestRank)
.. " (target " .. tostring(target) .. ") for '" .. tostring(MTH_Growl_Pending.name)
.. "' via DoCraft(" .. tostring(bestIndex) .. ")")
if MTH and type(MTH.Print) == "function" then
MTH:Print("Auto-taught Growl (Rank " .. tostring(bestRank) .. ") to " .. tostring(MTH_Growl_Pending.name) .. ".")
end
MTH_Growl_Pending.done = true
if MTH_Growl_Pending.closeAfter then
@@ -255,6 +268,8 @@ end)
-- ---------------------------------------------------------------------------
local function MTH_Growl_StartTraining(rank, petName)
local alreadyOpen = MTH_Growl_IsTrainingWindowVisible()
local getTime = MTH_Growl_GetGlobal("GetTime")
MTH_Growl_SuppressScanUntil = ((type(getTime) == "function" and getTime()) or 0) + 10
MTH_Growl_Pending = {
rank = rank,
name = petName,