From 8b0f5dbe0e06b6db2ec2e674f3806362d3b33f89 Mon Sep 17 00:00:00 2001 From: Derek Hoffmann Date: Sun, 14 Jan 2024 12:35:05 -0500 Subject: [PATCH 1/4] Add warning if no scripts are executed duirng t2 loop --- t2.lic | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/t2.lic b/t2.lic index 42a0e19179..fb4586fe13 100644 --- a/t2.lic +++ b/t2.lic @@ -51,6 +51,7 @@ class T2 trainables = @settings['training_list'] EquipmentManager.new.empty_hands + warn_user = true # should only stay true if it gets through the below loop without executing anything. trainables.each do |trainable| # Skip if learning rate is above start threshold for this trainable if trainable['skill'].is_a?(Array) @@ -81,8 +82,14 @@ class T2 execute_actions(trainable['scripts']) update_cooldown(trainable['skill']) if has_cooldown?(trainable['skill']) echo "***STATUS*** Completed #{trainable_title} in #{Time.at(Time.now - trainable_start_time).strftime("%Mm:%Ss")}" + warn_user = false break end + if warn_user + DRC.message("Ran out of things to do - please read the T2 tutorial if you see this message.\n https://github.com/rpherbig/dr-scripts/wiki/T2-Tutorial") + DRC.message("Sleeping 5 seconds.) + pause 5 + end end if !@settings.t2_after_shutdown.empty? echo "***STATUS*** Controlled shutdown, executing shutdown actions." From 8b4315efd5549eb5b3fa2d87ef51efc8b072aad9 Mon Sep 17 00:00:00 2001 From: Derek Hoffmann Date: Sun, 14 Jan 2024 12:40:16 -0500 Subject: [PATCH 2/4] Missing end quote --- t2.lic | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t2.lic b/t2.lic index fb4586fe13..4e226ef02a 100644 --- a/t2.lic +++ b/t2.lic @@ -87,7 +87,7 @@ class T2 end if warn_user DRC.message("Ran out of things to do - please read the T2 tutorial if you see this message.\n https://github.com/rpherbig/dr-scripts/wiki/T2-Tutorial") - DRC.message("Sleeping 5 seconds.) + DRC.message("Sleeping 5 seconds.") pause 5 end end From 6b63779290efbf3483a769d89d69de6c63c43db2 Mon Sep 17 00:00:00 2001 From: Derek Hoffmann Date: Sun, 14 Jan 2024 12:42:23 -0500 Subject: [PATCH 3/4] rubocop spacing --- t2.lic | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/t2.lic b/t2.lic index 4e226ef02a..85bf59400c 100644 --- a/t2.lic +++ b/t2.lic @@ -47,11 +47,12 @@ class T2 def run loop do break if @shutdown - +` trainables = @settings['training_list'] EquipmentManager.new.empty_hands - warn_user = true # should only stay true if it gets through the below loop without executing anything. + # should only stay true if it gets through the below loop without executing anything. + warn_user = true trainables.each do |trainable| # Skip if learning rate is above start threshold for this trainable if trainable['skill'].is_a?(Array) From 739194fdb566a04130d78e1d0575fa5e8f61c233 Mon Sep 17 00:00:00 2001 From: Derek Hoffmann Date: Sun, 14 Jan 2024 12:43:19 -0500 Subject: [PATCH 4/4] typo --- t2.lic | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t2.lic b/t2.lic index 85bf59400c..375a20ea61 100644 --- a/t2.lic +++ b/t2.lic @@ -47,7 +47,7 @@ class T2 def run loop do break if @shutdown -` + trainables = @settings['training_list'] EquipmentManager.new.empty_hands