From d9793682d7e79efa01cb59057c5d07342ae210d8 Mon Sep 17 00:00:00 2001 From: Robert Herbig Date: Sat, 13 Feb 2016 12:57:15 -0500 Subject: [PATCH] Prevent idling out of the game while healing Output 'tdp' every 60 seconds Fixes #196 --- crossing-training.lic | 3 +-- safe-room.lic | 11 ++++++++++- workorders.lic | 4 ++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/crossing-training.lic b/crossing-training.lic index b93f7ea6d8..dd4355b1fc 100644 --- a/crossing-training.lic +++ b/crossing-training.lic @@ -448,7 +448,7 @@ class CrossingTraining def train_performance unless play_song? - @settings.crossing_training.delete("Performance") + @settings.crossing_training.delete('Performance') return end Flags.reset('ct-song') @@ -751,7 +751,6 @@ class CrossingTraining # https://elanthipedia.play.net/mediawiki/index.php/Blacksmithing_Products def train_forging - if @settings.train_workorders([]).include?('Blacksmithing') wait_for_script_to_complete('workorders', ['Blacksmithing']) return diff --git a/safe-room.lic b/safe-room.lic index a626e1acf9..7f7ec9ce84 100644 --- a/safe-room.lic +++ b/safe-room.lic @@ -20,7 +20,16 @@ class SafeRoom elsif DRStats.guild != 'Necromancer' walk_to 6218 fput('lie') - waitfor('Dokt waves a large hand at you', 'Dokt gives you a quick glance') + Flags.add('healthy', 'Dokt waves a large hand at you', 'Dokt gives you a quick glance') + timer = 0 + until Flags['healthy'] + pause 1 + timer += 1 + if timer % 60 == 0 + # Output a harmless command to prevent being logged out + fput 'tdp' + end + end fput('stand') end diff --git a/workorders.lic b/workorders.lic index 8a320b8b53..da622299bc 100644 --- a/workorders.lic +++ b/workorders.lic @@ -187,7 +187,7 @@ class WorkOrders pause 60 end end - + def found_room? %w(oak maple birch).each do |wood| fput("open #{wood} door") @@ -196,7 +196,7 @@ class WorkOrders return true if DRRoom.pcs.empty? fput('go door') end - + false end end