From f4ad7b524935e7e28e1e0c353892fb5d66693e4b Mon Sep 17 00:00:00 2001 From: SildenEgypt <442029+SildenEgypt@users.noreply.github.com> Date: Mon, 2 Mar 2026 11:42:13 +0000 Subject: [PATCH] thistle: prevent lockups Occasionally automato would lock up if something happened it wasn't expecting it, or something didn't happen that it was expecting to happen, so added checkbreaks to prevent automato locking up in those edge cases --- scripts/thistle.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/thistle.lua b/scripts/thistle.lua index bcc9e80..cbabeed 100644 --- a/scripts/thistle.lua +++ b/scripts/thistle.lua @@ -322,10 +322,12 @@ function clickAll(image_name, message, up) if up then for i=#buttons, 1, -1 do srClickMouseNoMove(buttons[i][0]+5, buttons[i][1]+3); + checkBreak(); -- Prevent locking up in event of an error end else for i=1, #buttons do srClickMouseNoMove(buttons[i][0]+5, buttons[i][1]+3); + checkBreak(); -- Prevent locking up in event of an error end end lsSleep(100); @@ -367,6 +369,7 @@ function clickAllComplex(image_names, message) -- click all buttons for j=1, #image_names do srClickMouseNoMove(window_locs[i][0] + dpos[j][0] + 5, window_locs[i][1] + dpos[j][1] + 5); + checkBreak(); -- Prevent locking up in event of an error end first = nil; end @@ -383,9 +386,11 @@ function clickAllComplex(image_names, message) end setWaitSpot(window_locs[i][0], window_locs[i][1]); srClickMouseNoMove(window_locs[i][0], window_locs[i][1] + cascade_offset); + checkBreak(); -- Prevent locking up in event of an error waitForChange(); end lsSleep(100); + checkBreak(); -- Prevent locking up in event of an error end -- Initialize last_mon