From 65addcd5848d99e534d6f4d6c0d2367e0eb3f62a Mon Sep 17 00:00:00 2001 From: mikejc Date: Fri, 16 Aug 2024 12:41:59 -0400 Subject: [PATCH] [scripts][combat-trainer] end GS pause loop after 10 seconds --- combat-trainer.lic | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/combat-trainer.lic b/combat-trainer.lic index c987a4ecd2..8beda904e0 100644 --- a/combat-trainer.lic +++ b/combat-trainer.lic @@ -1712,7 +1712,13 @@ class SpellProcess return unless @command - pause 0.5 until DRRoom.npcs.include?('warrior') + # escape valve in case spell immediately fails (due to anti magic?) + temp_count = 0 + until DRRoom.npcs.include?('warrior') || temp_count > 20 + pause 0.5 + temp_count += 1 + end + fput("command #{@command}") @command = nil end