From 45061ef9650fdf36ef16a733aae614467b4c17bb Mon Sep 17 00:00:00 2001 From: Derek Hoffmann Date: Wed, 28 Feb 2024 12:57:32 -0500 Subject: [PATCH 1/3] [wand-watcher.lic] check listed wands are defined in gear --- wand-watcher.lic | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/wand-watcher.lic b/wand-watcher.lic index 9e9ce991ee..93f45f7d9f 100644 --- a/wand-watcher.lic +++ b/wand-watcher.lic @@ -47,6 +47,18 @@ class WandWatcher /^You are in no condition to do that/] UserVars.wand_watcher_timers = {} if !(UserVars.wand_watcher_timers) || args.reset + # check to ensure wands are defined in gear, and warn user if not + wands_not_in_gear = @wand_list.reject { |wand, _details| settings.gear.find { |item| wand =~ /#{item[:adjective]}\s*#{item[:name]}/i } } + if wands_not_in_gear.size > 0 + message = "To minimize the possibility that items that you hold in your hands could be lost they should be listed in your `gear:`. The following wands are not listed in your `gear:` settings:" + message += "\n - #{wands_not_in_gear.collect{|k,v| k}.join("\n - ")}" + message += "\nIf you need assistance with this, please ask in the lich discord (listed in #{$clean_lich_char}links) for help." + message += "\n\n---This check is *advisory* for now, but will become mandatory in the near future.---" + DRC.message(message) + pause 10 + end + + # Don't allow users to make foolish mistakes, always prevent use during go2/burgle @no_use_scripts << 'go2' @no_use_scripts << 'burgle' From e785a88477e6f61f1a482003ea44e9ea5de66b0a Mon Sep 17 00:00:00 2001 From: Derek Hoffmann Date: Wed, 28 Feb 2024 13:40:33 -0500 Subject: [PATCH 2/3] [wand-watcher.lic] rubocop --- wand-watcher.lic | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/wand-watcher.lic b/wand-watcher.lic index 93f45f7d9f..34ca8d313b 100644 --- a/wand-watcher.lic +++ b/wand-watcher.lic @@ -49,16 +49,15 @@ class WandWatcher # check to ensure wands are defined in gear, and warn user if not wands_not_in_gear = @wand_list.reject { |wand, _details| settings.gear.find { |item| wand =~ /#{item[:adjective]}\s*#{item[:name]}/i } } - if wands_not_in_gear.size > 0 + if wands_not_in_gear.size > 0 message = "To minimize the possibility that items that you hold in your hands could be lost they should be listed in your `gear:`. The following wands are not listed in your `gear:` settings:" - message += "\n - #{wands_not_in_gear.collect{|k,v| k}.join("\n - ")}" + message += "\n - #{wands_not_in_gear.collect { |k, v| k }.join("\n - ")}" message += "\nIf you need assistance with this, please ask in the lich discord (listed in #{$clean_lich_char}links) for help." message += "\n\n---This check is *advisory* for now, but will become mandatory in the near future.---" DRC.message(message) pause 10 end - # Don't allow users to make foolish mistakes, always prevent use during go2/burgle @no_use_scripts << 'go2' @no_use_scripts << 'burgle' From 5148d89e0f3b9133505a8418319c07a71b113363 Mon Sep 17 00:00:00 2001 From: Derek Hoffmann Date: Wed, 28 Feb 2024 13:48:56 -0500 Subject: [PATCH 3/3] [wand-watcher.lic] rubocop again --- wand-watcher.lic | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wand-watcher.lic b/wand-watcher.lic index 34ca8d313b..bf231edc8b 100644 --- a/wand-watcher.lic +++ b/wand-watcher.lic @@ -51,7 +51,7 @@ class WandWatcher wands_not_in_gear = @wand_list.reject { |wand, _details| settings.gear.find { |item| wand =~ /#{item[:adjective]}\s*#{item[:name]}/i } } if wands_not_in_gear.size > 0 message = "To minimize the possibility that items that you hold in your hands could be lost they should be listed in your `gear:`. The following wands are not listed in your `gear:` settings:" - message += "\n - #{wands_not_in_gear.collect { |k, v| k }.join("\n - ")}" + message += "\n - #{wands_not_in_gear.collect { |k, _v| k }.join("\n - ")}" message += "\nIf you need assistance with this, please ask in the lich discord (listed in #{$clean_lich_char}links) for help." message += "\n\n---This check is *advisory* for now, but will become mandatory in the near future.---" DRC.message(message)