From 7afb786564d33392fb3a05c834721413f909f8b2 Mon Sep 17 00:00:00 2001 From: OSXLich-Doug Date: Thu, 29 Aug 2024 15:24:21 -0400 Subject: [PATCH 01/17] [all][init.rb] bugfix: address WINE variance between linux / installs --- lib/init.rb | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/lib/init.rb b/lib/init.rb index e94e7c89..2a215f40 100644 --- a/lib/init.rb +++ b/lib/init.rb @@ -64,28 +64,23 @@ def key_exists?(path) end elsif defined?(Wine) ## Needs improvement - iteration and such. Quick slam test. Why does Linux != MacOS (ver 9)? - case RUBY_PLATFORM - when /linux/ - $sf_fe_loc = Wine.registry_gets('HKEY_LOCAL_MACHINE\\Software\\Simutronics\\STORM32\\Directory') || '' - $wiz_fe_loc_temp = Wine.registry_gets('HKEY_LOCAL_MACHINE\\Software\\Simutronics\\WIZ32\\Directory') - $sf_fe_loc_temp = Wine.registry_gets('HKEY_LOCAL_MACHINE\\Software\\Simutronics\\STORM32\\Directory') - when /darwin/ - $sf_fe_loc = Wine.registry_gets('HKEY_LOCAL_MACHINE\\Software\\Wow6432Node\\Simutronics\\STORM32\\Directory') || '' - $wiz_fe_loc_temp = Wine.registry_gets('HKEY_LOCAL_MACHINE\\Software\\Wow6432Node\\Simutronics\\WIZ32\\Directory') - $sf_fe_loc_temp = Wine.registry_gets('HKEY_LOCAL_MACHINE\\Software\\Wow6432Node\\Simutronics\\STORM32\\Directory') - else # prior result - probably no longer valid, but may be needed in break/fix - $sf_fe_loc = Wine.registry_gets('HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\Simutronics\\STORM32\\Directory') || '' - $wiz_fe_loc_temp = Wine.registry_gets('HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Simutronics\\WIZ32\\Directory') - $sf_fe_loc_temp = Wine.registry_gets('HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Simutronics\\STORM32\\Directory') + unless sf_fe_loc_temp = Wine.registry_gets('HKEY_LOCAL_MACHINE\\Software\\Simutronics\\STORM32\\Directory') + sf_fe_loc_temp = Wine.registry_gets('HKEY_LOCAL_MACHINE\\Software\\Wow6432Node\\Simutronics\\STORM32\\Directory') end - - if $wiz_fe_loc_temp - $wiz_fe_loc = $wiz_fe_loc_temp.gsub('\\', '/').gsub('C:', Wine::PREFIX + '/drive_c') + unless wiz_fe_loc_temp = Wine.registry_gets('HKEY_LOCAL_MACHINE\\Software\\Simutronics\\WIZ32\\Directory') + wiz_fe_loc_temp = Wine.registry_gets('HKEY_LOCAL_MACHINE\\Software\\Wow6432Node\\Simutronics\\WIZ32\\Directory') end - if $sf_fe_loc_temp - $sf_fe_loc = $sf_fe_loc_temp.gsub('\\', '/').gsub('C:', Wine::PREFIX + '/drive_c') + + unless sf_fe_loc_temp || wiz_fe_loc_temp + $sf_fe_loc = '' end + if wiz_fe_loc_temp + $wiz_fe_loc = wiz_fe_loc_temp.gsub('\\', '/').gsub('C:', Wine::PREFIX + '/drive_c') + end + if sf_fe_loc_temp + $sf_fe_loc = sf_fe_loc_temp.gsub('\\', '/').gsub('C:', Wine::PREFIX + '/drive_c') + end if !File.exist?($sf_fe_loc) $sf_fe_loc =~ /SIMU/ ? $sf_fe_loc = $sf_fe_loc.gsub("SIMU", "Simu") : $sf_fe_loc = $sf_fe_loc.gsub("Simu", "SIMU") Lich.log("Cannot find STORM equivalent FE to launch.") if !File.exist?($sf_fe_loc) From b03ade4c22399186fa88a28d011330f06d33e7a8 Mon Sep 17 00:00:00 2001 From: OSXLich-Doug Date: Thu, 29 Aug 2024 15:26:32 -0400 Subject: [PATCH 02/17] rubocop cleanup --- lib/init.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/init.rb b/lib/init.rb index 2a215f40..9e4d2fce 100644 --- a/lib/init.rb +++ b/lib/init.rb @@ -64,10 +64,10 @@ def key_exists?(path) end elsif defined?(Wine) ## Needs improvement - iteration and such. Quick slam test. Why does Linux != MacOS (ver 9)? - unless sf_fe_loc_temp = Wine.registry_gets('HKEY_LOCAL_MACHINE\\Software\\Simutronics\\STORM32\\Directory') + unless (sf_fe_loc_temp = Wine.registry_gets('HKEY_LOCAL_MACHINE\\Software\\Simutronics\\STORM32\\Directory')) sf_fe_loc_temp = Wine.registry_gets('HKEY_LOCAL_MACHINE\\Software\\Wow6432Node\\Simutronics\\STORM32\\Directory') end - unless wiz_fe_loc_temp = Wine.registry_gets('HKEY_LOCAL_MACHINE\\Software\\Simutronics\\WIZ32\\Directory') + unless (wiz_fe_loc_temp = Wine.registry_gets('HKEY_LOCAL_MACHINE\\Software\\Simutronics\\WIZ32\\Directory')) wiz_fe_loc_temp = Wine.registry_gets('HKEY_LOCAL_MACHINE\\Software\\Wow6432Node\\Simutronics\\WIZ32\\Directory') end From 052ef66dc737c7c7ef913efea706be7ed535bf3c Mon Sep 17 00:00:00 2001 From: OSXLich-Doug Date: Thu, 29 Aug 2024 17:03:25 -0400 Subject: [PATCH 03/17] Bring Wizard into the Fold --- lib/init.rb | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/lib/init.rb b/lib/init.rb index 9e4d2fce..871420f0 100644 --- a/lib/init.rb +++ b/lib/init.rb @@ -71,22 +71,19 @@ def key_exists?(path) wiz_fe_loc_temp = Wine.registry_gets('HKEY_LOCAL_MACHINE\\Software\\Wow6432Node\\Simutronics\\WIZ32\\Directory') end - unless sf_fe_loc_temp || wiz_fe_loc_temp - $sf_fe_loc = '' - end + sf_fe_loc_temp ? $sf_fe_loc = sf_fe_loc_temp.gsub('\\', '/').gsub('C:', Wine::PREFIX + '/drive_c') : $sf_fe_loc = '' + wiz_fe_loc_temp ? $wiz_fe_loc = wiz_fe_loc_temp.gsub('\\', '/').gsub('C:', Wine::PREFIX + '/drive_c') : $wiz_fe_loc = '' - if wiz_fe_loc_temp - $wiz_fe_loc = wiz_fe_loc_temp.gsub('\\', '/').gsub('C:', Wine::PREFIX + '/drive_c') - end - if sf_fe_loc_temp - $sf_fe_loc = sf_fe_loc_temp.gsub('\\', '/').gsub('C:', Wine::PREFIX + '/drive_c') - end - if !File.exist?($sf_fe_loc) + unless File.exist?($sf_fe_loc) $sf_fe_loc =~ /SIMU/ ? $sf_fe_loc = $sf_fe_loc.gsub("SIMU", "Simu") : $sf_fe_loc = $sf_fe_loc.gsub("Simu", "SIMU") - Lich.log("Cannot find STORM equivalent FE to launch.") if !File.exist?($sf_fe_loc) + Lich.log("Cannot find STORM equivalent FE to launch.") unless File.exist?($sf_fe_loc) end -end + unless File.exist?($wiz_fe_loc) + $wiz_fe_loc =~ /SIMU/ ? $wiz_fe_loc = $wiz_fe_loc.gsub("SIMU", "Simu") : $wiz_fe_loc = $wiz_fe_loc.gsub("Simu", "SIMU") + Lich.log("Cannot find WIZARD FE to launch.") unless File.exist?($wiz_fe_loc) + end +end ## The following should be deprecated with the direct-frontend-launch-method ## TODO: remove as part of chore/Remove unnecessary Win32 calls ## Temporarily reinstatated for DR From 704db9e4a915978db50d48bc09351ecfedd19125 Mon Sep 17 00:00:00 2001 From: OSXLich-Doug Date: Thu, 29 Aug 2024 18:27:22 -0400 Subject: [PATCH 04/17] expanded reporting logic --- lib/init.rb | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/lib/init.rb b/lib/init.rb index 871420f0..e56af978 100644 --- a/lib/init.rb +++ b/lib/init.rb @@ -63,26 +63,37 @@ def key_exists?(path) end end elsif defined?(Wine) - ## Needs improvement - iteration and such. Quick slam test. Why does Linux != MacOS (ver 9)? - unless (sf_fe_loc_temp = Wine.registry_gets('HKEY_LOCAL_MACHINE\\Software\\Simutronics\\STORM32\\Directory')) + ## reminder Wine is defined in the file wine.rb by confirming prefix, directory and executable + unless sf_fe_loc_temp = Wine.registry_gets('HKEY_LOCAL_MACHINE\\Software\\Simutronics\\STORM32\\Directory') sf_fe_loc_temp = Wine.registry_gets('HKEY_LOCAL_MACHINE\\Software\\Wow6432Node\\Simutronics\\STORM32\\Directory') end - unless (wiz_fe_loc_temp = Wine.registry_gets('HKEY_LOCAL_MACHINE\\Software\\Simutronics\\WIZ32\\Directory')) + unless wiz_fe_loc_temp = Wine.registry_gets('HKEY_LOCAL_MACHINE\\Software\\Simutronics\\WIZ32\\Directory') wiz_fe_loc_temp = Wine.registry_gets('HKEY_LOCAL_MACHINE\\Software\\Wow6432Node\\Simutronics\\WIZ32\\Directory') end - - sf_fe_loc_temp ? $sf_fe_loc = sf_fe_loc_temp.gsub('\\', '/').gsub('C:', Wine::PREFIX + '/drive_c') : $sf_fe_loc = '' - wiz_fe_loc_temp ? $wiz_fe_loc = wiz_fe_loc_temp.gsub('\\', '/').gsub('C:', Wine::PREFIX + '/drive_c') : $wiz_fe_loc = '' - - unless File.exist?($sf_fe_loc) - $sf_fe_loc =~ /SIMU/ ? $sf_fe_loc = $sf_fe_loc.gsub("SIMU", "Simu") : $sf_fe_loc = $sf_fe_loc.gsub("Simu", "SIMU") - Lich.log("Cannot find STORM equivalent FE to launch.") unless File.exist?($sf_fe_loc) + ## at this point, the temp variables are either FalseClass or have what wine believes is the Directory subkey from registry + ## fix it up so we can use it on a *nix based system. If the return is FalseClass, leave it FalseClass + sf_fe_loc_temp ? $sf_fe_loc = sf_fe_loc_temp.gsub('\\', '/').gsub('C:', Wine::PREFIX + '/drive_c') : :noop + wiz_fe_loc_temp ? $wiz_fe_loc = wiz_fe_loc_temp.gsub('\\', '/').gsub('C:', Wine::PREFIX + '/drive_c') : :noop + ## if we have a String class (directory) and the directory exists -- no error detectable at this level + ## if we have a nil, we have no directory, or if we have a path but cannot find that path (directory) we have an error + if $sf_fe_loc.nil? # no directory + Lich.log("STORM equivalent FE is not installed under WINE.") + else + unless $sf_fe_loc.is_a? String and File.exist?($sf_fe_loc) # cannot confirm directory location + Lich.log("Cannot find STORM equivalent FE to launch under WINE.") + end end - - unless File.exist?($wiz_fe_loc) - $wiz_fe_loc =~ /SIMU/ ? $wiz_fe_loc = $wiz_fe_loc.gsub("SIMU", "Simu") : $wiz_fe_loc = $wiz_fe_loc.gsub("Simu", "SIMU") - Lich.log("Cannot find WIZARD FE to launch.") unless File.exist?($wiz_fe_loc) + if $wiz_fe_loc.nil? # no directory + Lich.log("WIZARD FE is not installed under WINE.") + else + unless $wiz_fe_loc.is_a? String and File.exist?($wiz_fe_loc) # cannot confirm directory location + Lich.log("Cannot find WIZARD FE to launch under WINE.") + end + end + if $sf_fe_loc.nil? and $wiz_fe_loc.nil? # got nuttin - no FE installed under WINE in registry (or something changed. . . ) + Lich.log("This system has WINE installed but does not have a suitable FE from Simu installed under WINE.") end + ## We have either declared an error, or the global variables for Simu FE are populated with a confirmed path end ## The following should be deprecated with the direct-frontend-launch-method ## TODO: remove as part of chore/Remove unnecessary Win32 calls From 91cba24031f7a9a67576569b63d9fb5a1364b2a3 Mon Sep 17 00:00:00 2001 From: OSXLich-Doug Date: Thu, 29 Aug 2024 18:28:59 -0400 Subject: [PATCH 05/17] le rubocop sigh --- lib/init.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/init.rb b/lib/init.rb index e56af978..aee27e2b 100644 --- a/lib/init.rb +++ b/lib/init.rb @@ -64,10 +64,10 @@ def key_exists?(path) end elsif defined?(Wine) ## reminder Wine is defined in the file wine.rb by confirming prefix, directory and executable - unless sf_fe_loc_temp = Wine.registry_gets('HKEY_LOCAL_MACHINE\\Software\\Simutronics\\STORM32\\Directory') + unless (sf_fe_loc_temp = Wine.registry_gets('HKEY_LOCAL_MACHINE\\Software\\Simutronics\\STORM32\\Directory')) sf_fe_loc_temp = Wine.registry_gets('HKEY_LOCAL_MACHINE\\Software\\Wow6432Node\\Simutronics\\STORM32\\Directory') end - unless wiz_fe_loc_temp = Wine.registry_gets('HKEY_LOCAL_MACHINE\\Software\\Simutronics\\WIZ32\\Directory') + unless (wiz_fe_loc_temp = Wine.registry_gets('HKEY_LOCAL_MACHINE\\Software\\Simutronics\\WIZ32\\Directory')) wiz_fe_loc_temp = Wine.registry_gets('HKEY_LOCAL_MACHINE\\Software\\Wow6432Node\\Simutronics\\WIZ32\\Directory') end ## at this point, the temp variables are either FalseClass or have what wine believes is the Directory subkey from registry From 35ddd580a3ea42643e10a0376c7fa4b088744128 Mon Sep 17 00:00:00 2001 From: OSXLich-Doug Date: Thu, 29 Aug 2024 18:32:25 -0400 Subject: [PATCH 06/17] le redux sigh --- lib/init.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/init.rb b/lib/init.rb index aee27e2b..2a57e96c 100644 --- a/lib/init.rb +++ b/lib/init.rb @@ -78,14 +78,14 @@ def key_exists?(path) ## if we have a nil, we have no directory, or if we have a path but cannot find that path (directory) we have an error if $sf_fe_loc.nil? # no directory Lich.log("STORM equivalent FE is not installed under WINE.") - else + else unless $sf_fe_loc.is_a? String and File.exist?($sf_fe_loc) # cannot confirm directory location Lich.log("Cannot find STORM equivalent FE to launch under WINE.") end end if $wiz_fe_loc.nil? # no directory Lich.log("WIZARD FE is not installed under WINE.") - else + else unless $wiz_fe_loc.is_a? String and File.exist?($wiz_fe_loc) # cannot confirm directory location Lich.log("Cannot find WIZARD FE to launch under WINE.") end From b7306be0418adb1b82a89c22c09000a03b60ea0d Mon Sep 17 00:00:00 2001 From: OSXLich-Doug Date: Fri, 30 Aug 2024 09:44:26 -0400 Subject: [PATCH 07/17] [all][games.rb] Prevent race condition in games thread --- lib/games.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/games.rb b/lib/games.rb index 416482c1..b238a70b 100644 --- a/lib/games.rb +++ b/lib/games.rb @@ -204,7 +204,7 @@ def Game.open(host, port) @@infomon_loaded = true end - if @@autostarted and !@@cli_scripts and defined? XMLData.game + if @@autostarted and !@@cli_scripts and defined? XMLData.game and !XMLData.name.empty? if (arg = ARGV.find { |a| a =~ /^\-\-start\-scripts=/ }) for script_name in arg.sub('--start-scripts=', '').split(',') Script.start(script_name) From d8242045db0df31f9e5758bfe17c832c03d0c70c Mon Sep 17 00:00:00 2001 From: OSXLich-Doug Date: Fri, 30 Aug 2024 10:47:51 -0400 Subject: [PATCH 08/17] Improvements Adding Effects dialogs to the fray - Tysong Aligning decades old `and` to `&&` --- lib/games.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/games.rb b/lib/games.rb index b238a70b..51f73b02 100644 --- a/lib/games.rb +++ b/lib/games.rb @@ -199,12 +199,12 @@ def Game.open(host, port) end end - if !@@infomon_loaded && defined?(Infomon) && !XMLData.name.empty? + if !@@infomon_loaded && defined?(Infomon) && !XMLData.name.empty? && !XMLData.dialogs.empty? ExecScript.start("Infomon.redo!", { :quiet => true, :name => "infomon_reset" }) if XMLData.game !~ /^DR/ && Infomon.db_refresh_needed? @@infomon_loaded = true end - if @@autostarted and !@@cli_scripts and defined? XMLData.game and !XMLData.name.empty? + if @@autostarted && !@@cli_scripts && defined?(XMLData.game) && !XMLData.name.empty? if (arg = ARGV.find { |a| a =~ /^\-\-start\-scripts=/ }) for script_name in arg.sub('--start-scripts=', '').split(',') Script.start(script_name) From eb0439f1f0d2ced68e98ef166e522b26b0324cf2 Mon Sep 17 00:00:00 2001 From: OSXLich-Doug Date: Fri, 30 Aug 2024 13:23:44 -0400 Subject: [PATCH 09/17] and deprovements --- lib/games.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/games.rb b/lib/games.rb index 51f73b02..7da55239 100644 --- a/lib/games.rb +++ b/lib/games.rb @@ -204,7 +204,7 @@ def Game.open(host, port) @@infomon_loaded = true end - if @@autostarted && !@@cli_scripts && defined?(XMLData.game) && !XMLData.name.empty? + if @@autostarted && !@@cli_scripts && !XMLData.name.empty? if (arg = ARGV.find { |a| a =~ /^\-\-start\-scripts=/ }) for script_name in arg.sub('--start-scripts=', '').split(',') Script.start(script_name) From a22eef6330f17f8ee6583e1ba0cdb8e7905f4d9c Mon Sep 17 00:00:00 2001 From: OSXLich-Doug Date: Fri, 30 Aug 2024 14:20:05 -0400 Subject: [PATCH 10/17] 'cause pico seconds matter dammit Tysong recommends checking 1 var instead of 2 - implemented --- lib/games.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/games.rb b/lib/games.rb index 7da55239..1d551389 100644 --- a/lib/games.rb +++ b/lib/games.rb @@ -204,7 +204,7 @@ def Game.open(host, port) @@infomon_loaded = true end - if @@autostarted && !@@cli_scripts && !XMLData.name.empty? + if !@@cli_scripts && @@autostarted && !XMLData.name.empty? if (arg = ARGV.find { |a| a =~ /^\-\-start\-scripts=/ }) for script_name in arg.sub('--start-scripts=', '').split(',') Script.start(script_name) From 0890f95d22786d48b2708587b2ec40018e9a9787 Mon Sep 17 00:00:00 2001 From: OSXLich-Doug Date: Fri, 30 Aug 2024 14:51:36 -0400 Subject: [PATCH 11/17] Updating DR for good Tysong update to eliminate needless checking impact to DR in stream. --- lib/games.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/games.rb b/lib/games.rb index 1d551389..7ad39395 100644 --- a/lib/games.rb +++ b/lib/games.rb @@ -199,7 +199,7 @@ def Game.open(host, port) end end - if !@@infomon_loaded && defined?(Infomon) && !XMLData.name.empty? && !XMLData.dialogs.empty? + if !@@infomon_loaded && (defined?(Infomon) || !$DRINFOMON_VERSION.nil?) && !XMLData.name.empty? && !XMLData.dialogs.empty? ExecScript.start("Infomon.redo!", { :quiet => true, :name => "infomon_reset" }) if XMLData.game !~ /^DR/ && Infomon.db_refresh_needed? @@infomon_loaded = true end From 7a315033a5672a5e8c43ddab3a1e742c1e49cac5 Mon Sep 17 00:00:00 2001 From: "Ryan P. McKinnon" <15917743+mrhoribu@users.noreply.github.com> Date: Sat, 31 Aug 2024 09:46:27 -0400 Subject: [PATCH 12/17] [gs][stash.rb] bugfix: wear code improvement Update `wear` coding to validate on GameObj no longer being in hand/in inventory instead of ingame FE response lines. --- lib/stash.rb | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/stash.rb b/lib/stash.rb index dfec79ff..00622544 100644 --- a/lib/stash.rb +++ b/lib/stash.rb @@ -67,6 +67,18 @@ def self.add_to_bag(bag, item) end end + def self.wear_to_inv(item) + try_or_fail(command: "wear ##{item.id}") do + 20.times { + return true if ![GameObj.right_hand, GameObj.left_hand].map(&:id).compact.include?(item.id) && @weapon_displayer.include?(bag.id) + return true if (![GameObj.right_hand, GameObj.left_hand].map(&:id).compact.include?(item.id) and GameObj.inv.to_a.map(&:id).include?(item.id)) + return true if item.name =~ /^ethereal \w+$/ && ![GameObj.right_hand, GameObj.left_hand].map(&:id).compact.include?(item.id) + sleep 0.1 + } + return false + end + end + def self.sheath_bags # find ready list settings for sheaths only; regex courtesy Eloot @sheath = {} @@ -129,7 +141,7 @@ def self.stash_hands(right: false, left: false, both: false) if (left || both) && left_hand.id waitrt? if (left_hand.noun =~ /shield|buckler|targe|heater|parma|aegis|scutum|greatshield|mantlet|pavis|arbalest|bow|crossbow|yumi|arbalest/)\ - and (wear_result = dothistimeout("wear ##{left_hand.id}", 8, /^You .*#{left_hand.noun}|^With careful precision, you|^You toss the shield|^You can only wear \w+ items in that location\.$|^You can't wear that\.$/)) and (wear_result !~ /^You can only wear \w+ items in that location\.$|^You can't wear that\.$/) + and wear_to_inv(left_hand) actions.unshift proc { dothistimeout "remove ##{left_hand.id}", 3, /^You (?:remove|sling|unsling)|^With a slight roll of your shoulder, you|^You .*#{left_hand.noun}|^Remove what\?/ 20.times { break if GameObj.left_hand.id == left_hand.id or GameObj.right_hand.id == left_hand.id; sleep 0.1 } From acc2dc0d6d4d89d2ab597d352fd5939e2b058f6c Mon Sep 17 00:00:00 2001 From: "Ryan P. McKinnon" <15917743+mrhoribu@users.noreply.github.com> Date: Sat, 31 Aug 2024 09:47:51 -0400 Subject: [PATCH 13/17] Update stash.rb change from `wear_to_inv` to `Lich::Stash::wear_to_inv` --- lib/stash.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/stash.rb b/lib/stash.rb index 00622544..c958aba5 100644 --- a/lib/stash.rb +++ b/lib/stash.rb @@ -141,7 +141,7 @@ def self.stash_hands(right: false, left: false, both: false) if (left || both) && left_hand.id waitrt? if (left_hand.noun =~ /shield|buckler|targe|heater|parma|aegis|scutum|greatshield|mantlet|pavis|arbalest|bow|crossbow|yumi|arbalest/)\ - and wear_to_inv(left_hand) + and Lich::Stash::wear_to_inv(left_hand) actions.unshift proc { dothistimeout "remove ##{left_hand.id}", 3, /^You (?:remove|sling|unsling)|^With a slight roll of your shoulder, you|^You .*#{left_hand.noun}|^Remove what\?/ 20.times { break if GameObj.left_hand.id == left_hand.id or GameObj.right_hand.id == left_hand.id; sleep 0.1 } From 2a9445874a906bb6100756f37a976e70616ff948 Mon Sep 17 00:00:00 2001 From: "Ryan P. McKinnon" <15917743+mrhoribu@users.noreply.github.com> Date: Sat, 31 Aug 2024 10:03:30 -0400 Subject: [PATCH 14/17] removal of weapon_displayer check when wearing item --- lib/stash.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/stash.rb b/lib/stash.rb index c958aba5..36c5ca77 100644 --- a/lib/stash.rb +++ b/lib/stash.rb @@ -70,7 +70,6 @@ def self.add_to_bag(bag, item) def self.wear_to_inv(item) try_or_fail(command: "wear ##{item.id}") do 20.times { - return true if ![GameObj.right_hand, GameObj.left_hand].map(&:id).compact.include?(item.id) && @weapon_displayer.include?(bag.id) return true if (![GameObj.right_hand, GameObj.left_hand].map(&:id).compact.include?(item.id) and GameObj.inv.to_a.map(&:id).include?(item.id)) return true if item.name =~ /^ethereal \w+$/ && ![GameObj.right_hand, GameObj.left_hand].map(&:id).compact.include?(item.id) sleep 0.1 From 815acd4bc47f24a1b17ac5b2141aebb3beb7b704 Mon Sep 17 00:00:00 2001 From: "Ryan P. McKinnon" <15917743+mrhoribu@users.noreply.github.com> Date: Sat, 31 Aug 2024 10:07:43 -0400 Subject: [PATCH 15/17] change remove wear code to use fput instead of dothistimeout Unnecessarily using a dothistimeout as comparing GameObj afterwards, not game output lines --- lib/stash.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/stash.rb b/lib/stash.rb index 36c5ca77..1e3f5231 100644 --- a/lib/stash.rb +++ b/lib/stash.rb @@ -142,7 +142,7 @@ def self.stash_hands(right: false, left: false, both: false) if (left_hand.noun =~ /shield|buckler|targe|heater|parma|aegis|scutum|greatshield|mantlet|pavis|arbalest|bow|crossbow|yumi|arbalest/)\ and Lich::Stash::wear_to_inv(left_hand) actions.unshift proc { - dothistimeout "remove ##{left_hand.id}", 3, /^You (?:remove|sling|unsling)|^With a slight roll of your shoulder, you|^You .*#{left_hand.noun}|^Remove what\?/ + fput "remove ##{left_hand.id}" 20.times { break if GameObj.left_hand.id == left_hand.id or GameObj.right_hand.id == left_hand.id; sleep 0.1 } if GameObj.right_hand.id == left_hand.id From 23639c2cfa326b29c4511b652f9b7609367a4705 Mon Sep 17 00:00:00 2001 From: "Ryan P. McKinnon" <15917743+mrhoribu@users.noreply.github.com> Date: Sun, 1 Sep 2024 18:43:46 -0400 Subject: [PATCH 16/17] Update R4LGTK3.iss prep for 5.10.1 bugfix release --- R4LGTK3.iss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R4LGTK3.iss b/R4LGTK3.iss index d62592f9..1253e04b 100644 --- a/R4LGTK3.iss +++ b/R4LGTK3.iss @@ -3,7 +3,7 @@ ; to support the Lich scripting environment for Simutronics games #define MyAppName "Ruby4Lich5" -#define MyAppVersion "5.10.0" +#define MyAppVersion "5.10.1" #define RubyVersion "3.3.4" #define MyAppPublisher "Elanthia-Online" #define MyAppURL "https://github.com/elanthia-online/lich-5/" @@ -12,7 +12,7 @@ [Setup] ; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications. ; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) -AppId= {{edd9ccd7-33cb-4577-a470-fe8fd087eaec} +AppId= {{edd9ccd7-33cb-4577-a470-fe8fd087eaed} AppName={#MyAppName} AppVersion={#MyAppVersion} AppVerName={#MyAppName} Ruby {#RubyVersion} & Lich {#MyAppVersion} From b3098ae309b221e53d9d15a0ecbb4321432da2e1 Mon Sep 17 00:00:00 2001 From: "Ryan P. McKinnon" <15917743+mrhoribu@users.noreply.github.com> Date: Sun, 1 Sep 2024 18:44:21 -0400 Subject: [PATCH 17/17] Update version.rb prep for Lich 5.10.1 bugfix release --- lib/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/version.rb b/lib/version.rb index f2caaf5a..31ff3584 100644 --- a/lib/version.rb +++ b/lib/version.rb @@ -1,5 +1,5 @@ # Lich5 carveout to better manage semver -LICH_VERSION = '5.10.0' +LICH_VERSION = '5.10.1' REQUIRED_RUBY = '2.6' RECOMMENDED_RUBY = '3.2'