From 7c85bbd8dbe8a37ca9024f786b2eb00e18dc407b Mon Sep 17 00:00:00 2001 From: Nyt3 Date: Wed, 27 Sep 2023 14:50:24 -0400 Subject: [PATCH 01/29] Updated combat-trainer --- combat-trainer.lic | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/combat-trainer.lic b/combat-trainer.lic index c4fe1348ab..94d4efced1 100644 --- a/combat-trainer.lic +++ b/combat-trainer.lic @@ -1056,6 +1056,7 @@ class SafetyProcess Flags.add('ct-itemdropped', '^Your (?.*) falls to your feet\.', '^You cannot maintain your grip on the (?.*), and it falls to the ground!') Flags.add('ct-germshieldlost', 'It jerks the.* (?\w+) out of your hands') Flags.add('active-mitigation', 'You believe you could \b(?\w+) out of the way of the \b(?\w+)') + Flags.add('ct-parasite', 'blood mite on your (?.*)\.') @equipment_manager = equipment_manager @health_threshold = settings.health_threshold echo(" @health_threshold: #{@health_threshold}") if $debug_mode_ct @@ -1080,6 +1081,7 @@ class SafetyProcess DRC.fix_standing check_item_recovery(game_state) tend_lodged + tend_parasite active_mitigation game_state.danger = in_danger?(game_state.danger) keep_away if !game_state.danger && game_state.retreating? @@ -1147,6 +1149,13 @@ class SafetyProcess Flags.reset('ct-lodged') end + def tend_parasite + return unless Flags['ct-parasite'] + + DRC.wait_for_script_to_complete('tendme') + Flags.reset('ct-parasite') + end + def keep_away return unless Flags['ct-engaged'] @@ -5322,6 +5331,7 @@ before_dying do Flags.delete('pouch-full') Flags.delete('container-full') Flags.delete('ct-lodged') + Flags.delete('ct-parasite') Flags.delete('ct-engaged') Flags.delete('active-mitigation') Flags.delete('ct-spelllost') From 52829673ced457790ea74fb3efda4c4e2ffdf2d6 Mon Sep 17 00:00:00 2001 From: Nyt3 Date: Wed, 27 Sep 2023 16:56:07 -0400 Subject: [PATCH 02/29] Updated Forge script --- forge.lic | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/forge.lic b/forge.lic index 7c4d8ea200..c4b7c0ad00 100644 --- a/forge.lic +++ b/forge.lic @@ -38,8 +38,8 @@ class Forge ] args = parse_args(arg_definitions) - Flags.add('forge-assembly', 'another finished \S+ shield (handle)', 'another finished wooden (hilt|haft)', 'another finished (long|short|small|large) leather (cord|backing)', 'another finished (small|large) cloth (padding)', 'another finished (long|short) wooden (pole)') - Flags.add('work-done', 'from the successful .* process', 'shows a slightly reduced weight', 'Applying the final touches', /^The .* was successfully/) + Flags.add('forge-assembly', 'another finished \S+ shield (handle)', 'another finished wooden (hilt|haft)', 'another finished (long|short|small|large) leather (cord|backing)', 'another finished (small|large) cloth (padding)', 'another finished (long|short) wooden (pole)', 'appears ready to be reinforced with some (leather strips)') + Flags.add('work-done', 'from the successful .* process', 'shows a slightly reduced weight', 'shows improved protection', 'Applying the final touches', /^The .* was successfully/) Flags.add('ingot-restow', /^You realize .* will not require as much metal as you have, and so you split the ingot and leave the portion you won't be using in your (.*)./) settings = get_settings @@ -79,7 +79,7 @@ class Forge echo("Tongs adjustable? :: #{@adjustable_tongs}") if @debug DRCC.stow_crafting_item('tongs', @bag, @forging_belt) end - + find_item if args.resume DRCC.check_consumables('oil', @info['finisher-room'], @info['finisher-number'], @bag, @bag_items, @forging_belt) unless args.skip set_defaults @@ -148,11 +148,14 @@ class Forge return if @recipe_name.include?('temper') if settings.master_crafting_book - DRCC.find_recipe2(@chapter, @recipe_name, settings.master_crafting_book, @book_type) + DRC.bput("turn my #{settings.master_crafting_book} to discipline #{@book_type}", 'You turn the') if settings.master_crafting_book + DRC.bput("turn my #{settings.master_crafting_book} to page #{DRCC.find_recipe(@chapter, @recipe_name, settings.master_crafting_book)}", 'You turn your', 'The .* is already') + DRC.bput("study my #{settings.master_crafting_book}", 'Roundtime') else DRCC.get_crafting_item("#{@book_type} book", @bag, @bag_items, @forging_belt) echo('*** You will need to upgrade to a journeyman or master book before 176 ranks! ***') if DRSkill.getrank('Forging') == 175 - DRCC.find_recipe2(@chapter, @recipe_name) + DRC.bput("turn my book to page #{DRCC.find_recipe(@chapter, @recipe_name)}", 'You turn your', 'The book is already') + DRC.bput('study my book', 'Roundtime') DRCC.stow_crafting_item("book", @bag, @forging_belt) end end @@ -221,7 +224,7 @@ class Forge magic_cleanup exit end - if /not required/ =~ DRC.bput("assemble my #{@item} with my #{part}", 'affix it securely in place', 'and tighten the pommel to secure it', 'carefully mark where it will attach when you continue crafting', 'is not required to continue crafting') + if /not required/ =~ DRC.bput("assemble my #{@item} with my #{part}", 'affix it securely in place', 'and tighten the pommel to secure it', 'carefully mark where it will attach when you continue crafting', 'You layer the leather strips', 'is not required to continue crafting') DRC.bput("stow my #{part}") end swap_tool(tool) if tool @@ -366,7 +369,7 @@ class Forge when 'not spinning fast enough' # grindstone slowed before we used spin_grindstone when 'ready for grinding away of the excess metal', 'now appears ready for grinding and polishing', - 'thinning the armor\'s metal at a grindstone', 'The armor is ready to be lightened', 'ready to be ground away' # grindstone time + 'thinning the armor\'s metal at a grindstone', 'The armor is ready to be lightened', 'ready to be ground away', 'You think adjusting the armor' # grindstone time unless DRCI.in_left_hand?(@item) DRCC.stow_crafting_item(@hammer, @bag, @forging_belt) if DRCI.in_hands?(@hammer) DRCC.stow_crafting_item('tongs', @bag, @forging_belt) if DRCI.in_hands?('tongs') From 0a30fb0211671bcb9a452ad13dd43211df7204b4 Mon Sep 17 00:00:00 2001 From: Nyt3 Date: Wed, 27 Sep 2023 17:00:08 -0400 Subject: [PATCH 03/29] Updated Forge script --- forge.lic | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/forge.lic b/forge.lic index c4b7c0ad00..6fc74f8ab4 100644 --- a/forge.lic +++ b/forge.lic @@ -148,14 +148,11 @@ class Forge return if @recipe_name.include?('temper') if settings.master_crafting_book - DRC.bput("turn my #{settings.master_crafting_book} to discipline #{@book_type}", 'You turn the') if settings.master_crafting_book - DRC.bput("turn my #{settings.master_crafting_book} to page #{DRCC.find_recipe(@chapter, @recipe_name, settings.master_crafting_book)}", 'You turn your', 'The .* is already') - DRC.bput("study my #{settings.master_crafting_book}", 'Roundtime') + DRCC.find_recipe2(@chapter, @recipe_name, settings.master_crafting_book, @book_type) else DRCC.get_crafting_item("#{@book_type} book", @bag, @bag_items, @forging_belt) echo('*** You will need to upgrade to a journeyman or master book before 176 ranks! ***') if DRSkill.getrank('Forging') == 175 - DRC.bput("turn my book to page #{DRCC.find_recipe(@chapter, @recipe_name)}", 'You turn your', 'The book is already') - DRC.bput('study my book', 'Roundtime') + DRCC.find_recipe2(@chapter, @recipe_name) DRCC.stow_crafting_item("book", @bag, @forging_belt) end end From aeca9381a848cc6ae310050269427832596e1688 Mon Sep 17 00:00:00 2001 From: Nyt3 Date: Wed, 27 Sep 2023 17:04:23 -0400 Subject: [PATCH 04/29] Removed trailing whitespace --- forge.lic | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/forge.lic b/forge.lic index 6fc74f8ab4..3f5e924aaa 100644 --- a/forge.lic +++ b/forge.lic @@ -79,7 +79,7 @@ class Forge echo("Tongs adjustable? :: #{@adjustable_tongs}") if @debug DRCC.stow_crafting_item('tongs', @bag, @forging_belt) end - + find_item if args.resume DRCC.check_consumables('oil', @info['finisher-room'], @info['finisher-number'], @bag, @bag_items, @forging_belt) unless args.skip set_defaults From f93d54e4f74f1ebd3c7f7970c324b69b78202ae4 Mon Sep 17 00:00:00 2001 From: Mahtra Date: Thu, 28 Sep 2023 20:38:29 +1300 Subject: [PATCH 05/29] [scripts][stack-scrolls] Exact spell name matches for discards Prior to this, listing `Shockwave` in my discards caused `Flame Shockwave` to also be discarded. This has the drawback of requiring exact spell names, but the benefit that exact spell names don't have fuzzy matching... --- stack-scrolls.lic | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stack-scrolls.lic b/stack-scrolls.lic index d8783b7dd2..953ce58105 100644 --- a/stack-scrolls.lic +++ b/stack-scrolls.lic @@ -166,7 +166,7 @@ class ScrollStack end waitrt? - if @discard_scrolls.find { |discard| spell_name =~ /#{discard}/i } + if @discard_scrolls.find { |discard| spell_name == discard } DRCI.dispose_trash(scroll, @worn_trashcan, @worn_trashcan_verb) elsif (target = UserVars.stackers.find { |stacker| stacker['contents'].find { |data| data.first == spell_name } }) stack_existing_scroll(target, scroll, spell_name, stacker_container) From d2ef9a1fff702b85e4abd020a6e3e54f2ecae4b7 Mon Sep 17 00:00:00 2001 From: BinuDR <36463075+BinuDR@users.noreply.github.com> Date: Wed, 4 Oct 2023 19:33:17 -0500 Subject: [PATCH 06/29] tdps.lic - Corrected tdp cost calculation method The previous method gave some errors with certain racial modifiers, the correction fixes that and should now give exact calculations. --- tdps.lic | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tdps.lic b/tdps.lic index ca1e274595..d30f6b3e8f 100644 --- a/tdps.lic +++ b/tdps.lic @@ -20,9 +20,7 @@ def cost(current, modifier) cost = 0 start = 10 - 2 * modifier for i in start..current - 1 do - mult = i < 100 ? 3 : 15 - mod = (modifier.to_f * i / 2).truncate - cost += (i * mult) + mod + cost += i * (i < 100 ? 3 : 15) + modifier * (i / 2).floor(0) end return cost end @@ -52,7 +50,7 @@ else end # Calcuate total TDPs spent for each stat -costs = [] +costs = Array.new(8) for i in 0..7 costs[i] = cost(stats[i], mods[i]) end From 6af690caf928d33b03325e6474a3c3bcbc407a10 Mon Sep 17 00:00:00 2001 From: desertkaz Date: Thu, 5 Oct 2023 17:17:42 -0700 Subject: [PATCH 07/29] downcase data for search args.item is always lowercase. this change enables searching for keywords with uppercase values. e.g. god names, races. --- inventory-manager.lic | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inventory-manager.lic b/inventory-manager.lic index d7f8389d89..11c2047f8c 100644 --- a/inventory-manager.lic +++ b/inventory-manager.lic @@ -359,7 +359,7 @@ class InventoryManager total_found = 0 DRC.message "Checking #{k}:" v.each { |data| - if data.include?(item) + if data.downcase.match?(item) total_found += 1 DRC.message "Match #{total_found}): #{data}" end From 82575829961bf6d85d2ef183d282bf7b52aa113d Mon Sep 17 00:00:00 2001 From: desertkaz Date: Thu, 5 Oct 2023 17:21:37 -0700 Subject: [PATCH 08/29] use include like upstream instead of match --- inventory-manager.lic | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inventory-manager.lic b/inventory-manager.lic index 11c2047f8c..b299de26e8 100644 --- a/inventory-manager.lic +++ b/inventory-manager.lic @@ -359,7 +359,7 @@ class InventoryManager total_found = 0 DRC.message "Checking #{k}:" v.each { |data| - if data.downcase.match?(item) + if data.downcase.include?(item) total_found += 1 DRC.message "Match #{total_found}): #{data}" end From 99f57e41a84e1e42c9533fb73a6e1e84c0f49130 Mon Sep 17 00:00:00 2001 From: Mahtra Date: Tue, 10 Oct 2023 11:21:39 +1300 Subject: [PATCH 09/29] [scripts][athletics] Adding ".to_i" to skill checks. --- athletics.lic | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/athletics.lic b/athletics.lic index fd12744b6b..f6455526cb 100644 --- a/athletics.lic +++ b/athletics.lic @@ -18,7 +18,7 @@ class Athletics get_athletics_items - start_exp = DRSkill.getxp('Athletics') + start_exp = DRSkill.getxp('Athletics').to_i @end_exp = [start_exp + 15, 29].min arg_definitions = [ @@ -53,7 +53,7 @@ class Athletics elsif athletics_location == 'Crossing' crossing_athletics elsif athletics_location == 'Riverhaven' - crossing_athletics if DRSkill.getrank('Athletics') > 140 + crossing_athletics if DRSkill.getrank('Athletics').to_i > 140 elsif athletics_location == 'Shard' shard_athletics elsif athletics_location == 'Hibarnhvidar' @@ -99,7 +99,7 @@ class Athletics end def done_training? - DRSkill.getxp('Athletics') >= @end_exp + DRSkill.getxp('Athletics').to_i >= @end_exp end def offset_climbing_song(direction) @@ -195,7 +195,7 @@ class Athletics def pick_climbing_song # start at a high difficulty guess and work downwards - case DRSkill.getrank('Athletics') + case DRSkill.getrank('Athletics').to_i when 0..100 'lament' when 100..250 @@ -258,9 +258,9 @@ class Athletics def ratha_athletics until done_training? - if DRSkill.getrank('Athletics') <= 185 + if DRSkill.getrank('Athletics').to_i <= 185 override_location_and_practice('ratha_rock_gorge') - elsif DRSkill.getrank('Stealth') >= 130 + elsif DRSkill.getrank('Stealth').to_i >= 130 override_location_and_practice('ratha_deep_crack') else # stops in infinte loop when > 185 ranks in athletics and < 130 ranks in stealth From 58785f3f967b3d85e2c9ed1ef130d226ac9c60e4 Mon Sep 17 00:00:00 2001 From: Mahtra Date: Tue, 10 Oct 2023 11:49:14 +1300 Subject: [PATCH 10/29] uservars were the problem --- athletics.lic | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/athletics.lic b/athletics.lic index f6455526cb..379ead4ab0 100644 --- a/athletics.lic +++ b/athletics.lic @@ -18,7 +18,7 @@ class Athletics get_athletics_items - start_exp = DRSkill.getxp('Athletics').to_i + start_exp = DRSkill.getxp('Athletics') @end_exp = [start_exp + 15, 29].min arg_definitions = [ @@ -53,7 +53,7 @@ class Athletics elsif athletics_location == 'Crossing' crossing_athletics elsif athletics_location == 'Riverhaven' - crossing_athletics if DRSkill.getrank('Athletics').to_i > 140 + crossing_athletics if DRSkill.getrank('Athletics') > 140 elsif athletics_location == 'Shard' shard_athletics elsif athletics_location == 'Hibarnhvidar' @@ -99,7 +99,7 @@ class Athletics end def done_training? - DRSkill.getxp('Athletics').to_i >= @end_exp + DRSkill.getxp('Athletics') >= @end_exp end def offset_climbing_song(direction) @@ -195,7 +195,7 @@ class Athletics def pick_climbing_song # start at a high difficulty guess and work downwards - case DRSkill.getrank('Athletics').to_i + case DRSkill.getrank('Athletics') when 0..100 'lament' when 100..250 @@ -210,9 +210,9 @@ class Athletics end def crossing_athletics - if UserVars.athletics <= 50 + if UserVars.athletics.to_i <= 50 swim_loop(get_data('athletics').swimming_options['arthe_dale']['rooms']) - elsif UserVars.athletics < 290 + elsif UserVars.athletics.to_i < 290 waitrt? pause @performance_pause # to give performance time to complete before_dying if stopped from the previous script start_script('performance') unless Script.running?('performance') @@ -223,18 +223,18 @@ class Athletics break unless climb?(data['room'], data['targets']) end end - elsif UserVars.athletics < 450 + elsif UserVars.athletics.to_i < 450 override_location_and_practice('segoltha_bank') else - DRC.message("The xalas argument will train faster at 650+ athletics. Be aware that it's potentially dangerous.") if UserVars.athletics > 650 + DRC.message("The xalas argument will train faster at 650+ athletics. Be aware that it's potentially dangerous.") if UserVars.athletics.to_i > 650 override_location_and_practice('arthelun_rocks') - DRC.message("The xalas argument will train faster at 650+ athletics. Be aware that it's potentially dangerous.") if UserVars.athletics > 650 + DRC.message("The xalas argument will train faster at 650+ athletics. Be aware that it's potentially dangerous.") if UserVars.athletics.to_i > 650 end end def shard_athletics until done_training? - if UserVars.athletics < 240 + if UserVars.athletics.to_i < 240 until done_training? @athletics_options['shard'] .reject { |data| @settings.avoid_athletics_in_justice && data['justice'] } @@ -242,9 +242,9 @@ class Athletics break unless climb?(data['room'], data['targets']) end end - elsif UserVars.athletics < 540 + elsif UserVars.athletics.to_i < 540 climb_cliffs - elsif UserVars.athletics < 850 + elsif UserVars.athletics.to_i < 850 climb_branch elsif UserVars.athletics climb_wyvern @@ -258,9 +258,9 @@ class Athletics def ratha_athletics until done_training? - if DRSkill.getrank('Athletics').to_i <= 185 + if DRSkill.getrank('Athletics') <= 185 override_location_and_practice('ratha_rock_gorge') - elsif DRSkill.getrank('Stealth').to_i >= 130 + elsif DRSkill.getrank('Stealth') >= 130 override_location_and_practice('ratha_deep_crack') else # stops in infinte loop when > 185 ranks in athletics and < 130 ranks in stealth @@ -342,10 +342,10 @@ class Athletics end def climb_branch - if UserVars.athletics < 540 + if UserVars.athletics.to_i < 540 override_location_and_practice('undergondola_branch') else - DRC.message("Warning: Using the undergondola arg with more than 850 athletics is not best use and you may consider the wyvern option instead.") if UserVars.athletics > 850 + DRC.message("Warning: Using the undergondola arg with more than 850 athletics is not best use and you may consider the wyvern option instead.") if UserVars.athletics.to_i > 850 DRCT.walk_to(9607) DRCT.walk_to(9515) until done_training? @@ -375,7 +375,7 @@ class Athletics def climb_wyvern DRCT.walk_to(19_464) until done_training? - DRCT.walk_to(2245) if UserVars.athletics > 540 + DRCT.walk_to(2245) if UserVars.athletics.to_i > 540 DRCT.walk_to(9607) DRCT.walk_to(11_126) DRCT.walk_to(19_464) From a3032e853228cd0aa7e580deba55dbc440447ec0 Mon Sep 17 00:00:00 2001 From: Mahtra Date: Tue, 10 Oct 2023 15:43:42 +1300 Subject: [PATCH 11/29] [scripts][drinfomon]Commenting out pause with notice --- drinfomon.lic | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drinfomon.lic b/drinfomon.lic index 649042e0aa..0d6f560d68 100644 --- a/drinfomon.lic +++ b/drinfomon.lic @@ -2,7 +2,7 @@ Documentation: https://elanthipedia.play.net/Lich_script_development#drinfomon =end -$DRINFOMON_VERSION = '2.0.33' +$DRINFOMON_VERSION = '2.0.34' no_kill_all no_pause_all @@ -1367,7 +1367,10 @@ check_exp_all.call # Wait for exp/info to have been parsed before we continue # otherwise scripts that rely on this data will error. -pause 0.05 while DRSkill.list.empty? +# 10 October 2023 - Commenting this line out, as it causes on a hang fresh out of the character creator +# and seemingly adds no real value otherwise. Will delete this line in a month, along with these comment +# lines. +# pause 0.05 while DRSkill.list.empty? # Note, while dead we cannot check your info, so we skip in that scenario. # If you're alive, we wait til a reasonable sample of info has been populated. # Race and Guild represent the start of info lines, Favors and TDPs represent the end. From c3f33693631e3f56c3f099b8694d9ca05e81aef1 Mon Sep 17 00:00:00 2001 From: urbaj-dr <110074842+urbaj-dr@users.noreply.github.com> Date: Tue, 10 Oct 2023 12:25:44 -0400 Subject: [PATCH 12/29] Update task-forage.lic to handle cluttered rooms Added new optional YAML setting called "wait_in_place." When true, to kill time the script will park in front of the task giver and collect rocks. When false, it runs to the outdoors_room and runs outdoorsmanship.lic. If clutter is detected while waiting in place, the player is forced to wait_in_place = false. If clutter is detected while gathering task items, the next closest room is attempted. --- task-forage.lic | 118 +++++++++++++++++++++++++++++++++++++----------- 1 file changed, 92 insertions(+), 26 deletions(-) diff --git a/task-forage.lic b/task-forage.lic index 1aee33b6e4..b1526585f9 100644 --- a/task-forage.lic +++ b/task-forage.lic @@ -15,6 +15,7 @@ class TaskForage @forage_settings = @settings.task_forage_settings @hometown = @settings.hometown @foraging_data = get_data('forage').foragables + @outdoors_room = @settings.outdoors_room || @settings.safe_room @forage_settings['forage_locations'].each do |entry| existing_item_index = @foraging_data.index { |item| item['item'] == entry['item'] } if existing_item_index @@ -128,6 +129,7 @@ class TaskForage Flags.add('combat', 'You cannot forage while in combat!', 'closes to pole weapon range on you!', 'begins to advance on you!') Flags.add('giver-move', *@move_regex) + Flags.add('cluttered', 'The room is too cluttered to find anything here', 'tries to forage for something, but can\'t find it with all the clutter here') @task_givers = { 'shard' => { 'npc' => 'peddler', 'location' => @shard_path }, 'crossing' => { 'npc' => 'Mags', 'location' => '954' } } @@ -146,6 +148,7 @@ class TaskForage @never_wait = @forage_settings['never_wait'].nil? ? false : @forage_settings['never_wait'] @use_boosts = @forage_settings['task_boosts'].nil? ? false : @forage_settings['task_boosts'] @collect = @forage_settings['collect'].nil? ? false : @forage_settings['collect'] + @wait_in_place = @forage_settings['wait_in_place'].nil? ? true : @forage_settings['wait_in_place'] @debug = @forage_settings['debug'].nil? ? false : @forage_settings['debug'] @boosted = nil @@ -154,6 +157,7 @@ class TaskForage @item_location = nil @tasks_completed = 0 @tasks_failed = 0 + @item_count = 0 echo 'UserVars:' if @debug echo UserVars.task_forage.to_yaml if @debug @@ -245,7 +249,9 @@ class TaskForage def check_giver echo 'check_giver' if @debug - return false unless DRRoom.npcs.include?(@task_giver) + + # If the rooms is cluttered, DRRoom will miss the task giver, even if they are stationary + return false unless (DRRoom.npcs.include?(@task_giver) || (@task_givers[@task_town]['location'].instance_of?(String) && Room.current.id == @task_givers[@task_town]['location'].to_i)) echo 'Found the task giver' if @debug Flags.reset('giver-move') @@ -299,6 +305,7 @@ class TaskForage /I am sorry, you must wait/, /I have a small item that needs/, /To whom are you speaking?/) case result when /I need (\d+) ([^.]+)/ + @item_count = 0 @number = Regexp.last_match(1).to_i @item = Regexp.last_match(2) echo "Gathering #{@number} of #{@item}" if @debug @@ -347,13 +354,15 @@ class TaskForage def cancel_task echo 'cancel_task' if @debug case DRC.bput("ask #{@task_giver} for task cancel", 'wish to end your current', 'do not currently have a', - 'frowns and shakes', 'To whom are you speaking?') + 'frowns and shakes', 'To whom are you speaking?', 'I see that you no longer wish to assist me') when /do not currently have a/, /frowns and shakes/ echo 'No task' if @debug true when /To whom are you speaking?/ find_giver cancel_task + when /I see that you no longer wish to assist me/ + true when /wish to end your current/ echo 'Cancel step 1' if @debug case DRC.bput("ask #{@task_giver} for task cancel", 'I see that you no longer wish to assist', @@ -398,6 +407,7 @@ class TaskForage echo "kill_time: #{repetitions}" if @debug echo "use_boosts: #{@use_boosts}, and current status is #{@boosted}" if @debug echo "never_wait: #{@never_wait}" if @debug + echo "wait_in_place: #{@wait_in_place}" if @debug use_boosts if @use_boosts && @boosted.nil? # No need to kill time if we're using a boost @@ -405,14 +415,34 @@ class TaskForage safe_exit if @never_wait + @wait_in_place ? outdoorsmanship_in_place(repetitions) : outdoorsmanship_script(repetitions * 4) + end + + def outdoorsmanship_in_place(repetitions) + echo "outdoorsmanship_in_place #{repetitions}" if @debug DRCI.stow_hands repetitions.times do |_i| DRC.collect('rock') waitrt? - DRC.kick_pile? unless DRC.kick_pile?('rock') + if Flags['cluttered'] + @wait_in_place = false + outdoorsmanship_script(8) + break + + end + DRC.kick_pile?('rock') end end + def outdoorsmanship_script(repetitions) + echo "outdoorsmanship_script #{repetitions}" if @debug + end_time = Time.now() + 30 + DRCT.walk_to(@outdoors_room) + DRC.wait_for_script_to_complete('outdoorsmanship', [repetitions.to_s]) + pause 0.5 until Time.now > end_time + find_giver + end + def time_to_room(destination) echo "time_to_room: #{destination}" if @debug _previous, shortest_paths = Map.dijkstra(Room.current.id, destination) @@ -495,7 +525,7 @@ class TaskForage echo "evaluate_item: #{@item}" if @debug unless known_item? && mapped_item? && ready_item? && closeby_item? @tasks_failed += 1 - cancel_task + decline_task return false end true @@ -505,58 +535,91 @@ class TaskForage def locate_item echo "locate_item #{@item}" if @debug item_info = @foraging_data.find { |item| item['item'] == @item } - return Room.current.id if item_info['rooms'].include?('any') rooms = DRCT.sort_destinations(item_info['rooms']) rooms.first end + def cluttered_gathering_room + echo "cluttered_room" if @debug + Flags.reset('cluttered') + # Prune the room from the list of possible locations so that we don't try to forage here again + @original_foraging = get_data('forage').foragables + + @foraging_data.each_with_index do |item, index| # Replace all 'any' overrides with the original data + if item['rooms'].include?('any') + orig_item = @original_foraging.find { |o_item| o_item['item'] == item['item'] } + @foraging_data[index] = orig_item if orig_item + end + end + + @foraging_data.each do |item| # Delete all references to the cluttered room + item['rooms'].delete(@item_location.to_i) if item['rooms'].include?(@item_location.to_i) + end + + if evaluate_item + DRCT.walk_to(locate_item) + else + DRC.message("No available locations") + cancel_task + safe_exit + end + end + # Travel to the nearest foraging spot and start to gather them def gather_items echo 'gather_items' if @debug - Flags.reset('combat') DRCT.walk_to(@item_location) - item_count = 0 + Flags.reset('cluttered') + Flags.reset('combat') - if @collect && @number >= 8 + if @collect DRC.collect(@item) - while item_count < @number + if Flags['cluttered'] + cluttered_gathering_room + DRC.collect(@item) + end + while @item_count < @number DRCI.get_item_unsafe(@item) if DRCI.put_away_item?(@item, @forage_container) - item_count += 1 + @item_count += 1 else DRC.message('Unable to store item.') cancel_task safe_exit end end - DRC.kick_pile? unless DRC.kick_pile?(@item.to_s) + DRC.kick_pile?(@item.to_s) else - while item_count < @number + while @item_count < @number echo "combat flag: #{Flags['combat']}" if @debug DRC.retreat if Flags['combat'] if DRC.forage?(@item, 5) - item_count += 1 + @item_count += 1 unless DRCI.put_away_item?(@item, @forage_container) DRC.message("You need to make more room in your #{@forage_container}") cancel_task safe_exit end else - invalid_room? - if DRSkill.getrank('Outdoorsmanship') <= 800 - DRC.message('Unable to find the item. You may not be skilled enough to find it. You might have more success during the day, during better weather, or in a different season.') - DRC.message('task-forage will decline tasks for this item for 2 hours.') - DRC.message('You can permanently blacklist this item by defining its foraging_locations rooms as blank in your YAML.') - echo("EXAMPLE BLACKLIST YAML:\n\ntask_forage_settings:\n forage_locations:\n - item: #{@item}\n rooms: []\n\n\n ") - UserVars.task_forage['item_failures'][@item] = Time.now + if Flags['cluttered'] + cluttered_gathering_room + else + invalid_room? + if DRSkill.getrank('Outdoorsmanship') <= 600 + DRC.message('Unable to find the item. You may not be skilled enough to find it. You might have more success during the day, during better weather, or in a different season.') + DRC.message('task-forage will decline tasks for this item for 2 hours.') + DRC.message('You can permanently blacklist this item by defining its foraging_locations rooms as blank in your YAML.') + echo("EXAMPLE BLACKLIST YAML:\n\ntask_forage_settings:\n forage_locations:\n - item: #{@item}\n rooms: []\n\n\n ") + UserVars.task_forage['item_failures'][@item] = Time.now + end + find_giver + cancel_task + @tasks_failed += 1 + determine_task_necessary + get_task end - find_giver - cancel_task - @tasks_failed += 1 - determine_task_necessary - get_task end end end @@ -578,7 +641,7 @@ class TaskForage def give_item echo 'give_item' if @debug case DRC.bput("give #{@task_giver}", 'and says, "Thanks,', '^What is it you\'re trying to give?', - ' I have a few things here for you, thank you so much for your help') + ' I have a few things here for you, thank you so much for your help', 'Mags sighs and says') when /^What is it you're trying to give?/ find_giver give_item @@ -586,6 +649,9 @@ class TaskForage @tasks_completed += 1 @item = nil kill_time(2) if determine_task_necessary + when /Mags sighs and says/ + @item = nil + safe_exit end end From c901a498bb7953b46bcaf91f08c6c02fe1e24a05 Mon Sep 17 00:00:00 2001 From: urbaj-dr <110074842+urbaj-dr@users.noreply.github.com> Date: Tue, 10 Oct 2023 12:31:56 -0400 Subject: [PATCH 13/29] Update base.yaml for task-forage Added wait_in_place to task-forage Added spaces in comments for consistency and readability --- profiles/base.yaml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/profiles/base.yaml b/profiles/base.yaml index 0da02cb12d..1d90d98ea5 100644 --- a/profiles/base.yaml +++ b/profiles/base.yaml @@ -2511,17 +2511,19 @@ base_wayto_overrides: end_room: 13603 str_proc: start_script('bescort', ['coffin']); wait_while{running?('bescort')}; -#Settings for task-forage (completing foraging tasks for Mags and similar NPCs, primarily for Trading experience) +# Settings for task-forage (completing foraging tasks for Mags and similar NPCs, primarily for Trading experience) task_forage_settings: - #Where foraged items should be temporarily stored + # Where foraged items should be temporarily stored container: backpack - #Whether or not to use BOOST TASK in order to reduce task cooldowns + # Whether or not to use BOOST TASK in order to reduce task cooldowns task_boosts: false - #Use COLLECT for large tasks instead of FORAGE (only use if you know you can COLLECT reliably) + # Use COLLECT for large tasks instead of FORAGE (only use if you know you can COLLECT reliably) collect: false - #When to exit the script and stop training Trading + # When to exit the script and stop training Trading trading_limit: 30 - #Exit as soon as a cooldown is encountered. + # Exit as soon as a cooldown is encountered. never_wait: false - #Show verbose debug messaging + # If waiting for a cooldown, do it by collecting rocks at the task giver. If false, task-forage will run outdoorsmanship.lic at your outdoors_room or safe_Room + wait_in_place: true + # Show verbose debug messaging debug: false From 26349243a1cc66caaa64110fc3b3304b65b87294 Mon Sep 17 00:00:00 2001 From: BinuDR <36463075+BinuDR@users.noreply.github.com> Date: Tue, 10 Oct 2023 18:01:27 -0500 Subject: [PATCH 14/29] base-recipes - New shield recipes added Added the new shield recipes from today's Tuesday Tidings. --- data/base-recipes.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/data/base-recipes.yaml b/data/base-recipes.yaml index d05ead88be..4a83a7568a 100644 --- a/data/base-recipes.yaml +++ b/data/base-recipes.yaml @@ -1432,6 +1432,24 @@ crafting_recipes: part: - shield handle - long cord +- name: a metal deflector + noun: deflector + volume: 25 + type: Armorsmithing + work_order: true + chapter: 4 + part: + - shield handle + - long cord +- name: a metal bulwark + noun: bulwark + volume: 50 + type: armorsmithing + work_order: true + chapter: 4 + part: + - shield handle + - long cord # Blacksmithing Chapter 2 recipes - name: a diagonal-peen mallet noun: mallet From 6c6f2e3c335816f2ce38c6d56f86f0bd87d9bbd8 Mon Sep 17 00:00:00 2001 From: Briarleigh <77058868+Kiriawen@users.noreply.github.com> Date: Sat, 14 Oct 2023 03:06:14 -0500 Subject: [PATCH 15/29] [base-shrines] Fixes and p5 shrines Fixed some of the `push:` nouns and added a `Hibarnhvidar:` section for P5. It's incomplete still but adding what I've got so far. --- data/base-shrines.yaml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/data/base-shrines.yaml b/data/base-shrines.yaml index bd37afedec..be7796c21e 100644 --- a/data/base-shrines.yaml +++ b/data/base-shrines.yaml @@ -172,7 +172,7 @@ shrines: push: altar - location: Berengaria's stone shrine start_room: 2867 - push: altar + push: shrine - location: The rebirth altar in the Temple of Light start_room: 11381 push: altar @@ -194,3 +194,19 @@ shrines: - location: A purple osage heartwood altar at Horse Clan start_room: 6366 push: altar + Hibarnhvidar: + - location: Traveler's Shrine, Hibarnhvidar + start_room: 15867 + push: altar + - location: Albreda's Shrine, Hibarnhvidar + start_room: 15872 + push: altar + - location: The central altar of the Temple of Kertigen + start_room: 3867 + push: altar + - location: A peregan tree altar at Boar Clan + start_room: 11756 + push: altar + - location: Divyaush's slab in an abandoned mine + start_room: 4397 + push: slab From 9b16f3eedaf0a5f56ef94fa4c93911d26cbf0eb6 Mon Sep 17 00:00:00 2001 From: Nyctus Date: Mon, 23 Oct 2023 13:49:20 -0700 Subject: [PATCH 16/29] common-items match string Added match string to match_messages in the count_item_parts function --- common-items.lic | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common-items.lic b/common-items.lic index ebf27b99a0..75221ff505 100644 --- a/common-items.lic +++ b/common-items.lic @@ -571,7 +571,8 @@ module DRCI /There (?:is|are) (?:only )?(.+) parts? left/, /There's (?:only )?(.+) parts? left/, /The (?:.+) has (.+) uses remaining./, - /There are enough left to create (.+) more/ + /There are enough left to create (.+) more/, + /You count out (.+) pieces? of material there/ ] count = 0 $ORDINALS.each do |ordinal| From 8c0d746242b74d57fffc24ffbd089e5fb67db96b Mon Sep 17 00:00:00 2001 From: RyRob <274507+Veranith@users.noreply.github.com> Date: Sun, 29 Oct 2023 21:28:01 -0600 Subject: [PATCH 17/29] adds missing prefix Corrects error when using a Divine Charm due to missing prefix --- safe-room.lic | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/safe-room.lic b/safe-room.lic index fe91744247..71dc0edaa7 100644 --- a/safe-room.lic +++ b/safe-room.lic @@ -138,7 +138,7 @@ class SafeRoom end def use_divine_charm? - return false unless exists?("divine charm") # charm gone (likely too high circle/skill), couldn't heal, return false, heal normal way + return false unless DRCI.exists?("divine charm") # charm gone (likely too high circle/skill), couldn't heal, return false, heal normal way if /is currently "facing" left/ !~ DRC.bput('look my divine charm', /^Suspended along a rawhide cord is a .*/) while /You get an intuitive sense from the charm that it will now heal you if invoked/ !~ DRC.bput('turn my divine charm', /^You get an intuitive sense from.*/) From f0bbb6830ba230ae223d2e31af3d22c7f3b3b4b5 Mon Sep 17 00:00:00 2001 From: Nyctus Date: Fri, 3 Nov 2023 13:21:23 -0700 Subject: [PATCH 18/29] Added compatibility for blank scrolls to common-items Added new match pattern to match_messages in count_item_parts() method --- common-items.lic | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common-items.lic b/common-items.lic index 75221ff505..7f8f7016fd 100644 --- a/common-items.lic +++ b/common-items.lic @@ -572,7 +572,8 @@ module DRCI /There's (?:only )?(.+) parts? left/, /The (?:.+) has (.+) uses remaining./, /There are enough left to create (.+) more/, - /You count out (.+) pieces? of material there/ + /You count out (.+) pieces? of material there/, + /There (?:is|are) (.+) scrolls? left for use with crafting/ ] count = 0 $ORDINALS.each do |ordinal| From 9d844a8e8a0978bad88917290d95cffb4bed21f9 Mon Sep 17 00:00:00 2001 From: Nyctus Date: Fri, 3 Nov 2023 14:03:27 -0700 Subject: [PATCH 19/29] Updates to get_scrolls method This was previously buggy and failing to order scrolls much of the time. I redid some of the logic and moved to ROUND instead of CEIL which will reduce over-buying of scrolls. --- sigilharvest.lic | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/sigilharvest.lic b/sigilharvest.lic index 59cc260718..010c43e35f 100644 --- a/sigilharvest.lic +++ b/sigilharvest.lic @@ -56,7 +56,6 @@ class SigilHarvest @action_difficulty = { "trivial" => 1, "straightforward" => 2, "challenging" => 3, "difficult" => 4, "formidable" => 5 } @args = parse_args(arg_definitions) - @debug = @args.debug # sigil harvesting uses the same sorts of buffs that other gathering skills use i.e. outdoorsmanship and perception DRCA.do_buffs(@settings, 'outdoors') @@ -338,6 +337,7 @@ class SigilHarvest # check our stock of scrolls since we just used some get_scrolls + exit unless @args.roomcap #if roomcap was not specified, exit script once sigil-scrolls are harvested end # scribe_sigils # returns the current seasonw which determines what room list to pull from base-sigils @@ -352,11 +352,9 @@ class SigilHarvest @stock_scrolls ? target_scrolls = @stock_scrolls : target_scrolls = 25 # Count scrolls and store number in a variable, set variable to 0 if scrolls are not found - if /^There (?:are|is) (.*) scrolls? left for use with crafting\.$/ =~ DRC.bput("count my blank scrolls", 'I could not find', /^There (?:is|are) .* scrolls? left for use with crafting\.$/) - num_scrolls = DRC.text2num($1) - else - num_scrolls = 0 - end + num_scrolls = DRCI.count_item_parts('blank scroll') + DRC.message("Scrolls Remaining: #{num_scrolls.to_s}") if @args.debug + DRC.message("Target Scrolls: #{target_scrolls.to_s}") if @args.debug # if we have enough scrolls exit the function return if num_scrolls >= target_scrolls @@ -374,19 +372,27 @@ class SigilHarvest scroll_price = 90 # dokora end + DRC.message("Buying more scrolls from #{Room[scroll_room].title.to_s}") if @args.debug + # ensure hands are clear DRCI.stow_hands - # blank scrolls come in a stack of 25, divide the difference by 25 and ceil to determine the number of times we need to order to meet or exceed stock target - num_to_order = ((target_scrolls - num_scrolls) / 25).ceil() + # blank scrolls come in a stack of 25, divide the difference by 25 and round to determine the number of times we need to order. (Changed to ROUND instead of CEIL. No longer tries to always meet or exceed value but instead gets close to target quantity.) + num_to_order = target_scrolls - num_scrolls + num_to_order = num_to_order / 25 + num_to_order = num_to_order.round # calculate the amount of money needed coppers_needed = num_to_order * scroll_price # go to bank if insufficient funds on hand + DRC.message("Getting #{coppers_needed.to_s} coppers to buy scrolls.") if @args.debug + + #get money if needed DRCM.ensure_copper_on_hand(coppers_needed, @settings) # order repeatedly and combine + DRC.message("Ordering scrolls #{num_to_order} times.") if @args.debug (1..num_to_order).each do DRCT.order_item(scroll_room, 8) DRC.bput('combine', /^You combine|^You must/) From 188f1d795c23fb60a44b3137b05301880a61ba15 Mon Sep 17 00:00:00 2001 From: Nyctus Date: Fri, 3 Nov 2023 14:17:08 -0700 Subject: [PATCH 20/29] Fixing rubocop offenses Space after # in some comments added Removed redundant .to_s methods --- sigilharvest.lic | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/sigilharvest.lic b/sigilharvest.lic index 010c43e35f..7549589818 100644 --- a/sigilharvest.lic +++ b/sigilharvest.lic @@ -337,7 +337,9 @@ class SigilHarvest # check our stock of scrolls since we just used some get_scrolls - exit unless @args.roomcap #if roomcap was not specified, exit script once sigil-scrolls are harvested + + #if roomcap was not specified, exit script once sigil-scrolls are harvested + exit unless @args.roomcap end # scribe_sigils # returns the current seasonw which determines what room list to pull from base-sigils @@ -353,8 +355,8 @@ class SigilHarvest # Count scrolls and store number in a variable, set variable to 0 if scrolls are not found num_scrolls = DRCI.count_item_parts('blank scroll') - DRC.message("Scrolls Remaining: #{num_scrolls.to_s}") if @args.debug - DRC.message("Target Scrolls: #{target_scrolls.to_s}") if @args.debug + DRC.message("Scrolls Remaining: #{num_scrolls}") if @args.debug + DRC.message("Target Scrolls: #{target_scrolls}") if @args.debug # if we have enough scrolls exit the function return if num_scrolls >= target_scrolls @@ -372,7 +374,7 @@ class SigilHarvest scroll_price = 90 # dokora end - DRC.message("Buying more scrolls from #{Room[scroll_room].title.to_s}") if @args.debug + DRC.message("Buying more scrolls from #{Room[scroll_room].title}") if @args.debug # ensure hands are clear DRCI.stow_hands @@ -386,9 +388,9 @@ class SigilHarvest coppers_needed = num_to_order * scroll_price # go to bank if insufficient funds on hand - DRC.message("Getting #{coppers_needed.to_s} coppers to buy scrolls.") if @args.debug + DRC.message("Getting #{coppers_needed} coppers to buy scrolls.") if @args.debug - #get money if needed + # get money if needed DRCM.ensure_copper_on_hand(coppers_needed, @settings) # order repeatedly and combine From cb09e2c91b8847a1e28254f230d9ae8a887ecd15 Mon Sep 17 00:00:00 2001 From: Nyctus Date: Fri, 3 Nov 2023 14:19:48 -0700 Subject: [PATCH 21/29] Fixed one more comment that I missed added missing space after # for one of my comments --- sigilharvest.lic | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sigilharvest.lic b/sigilharvest.lic index 7549589818..2fa0a1a3c8 100644 --- a/sigilharvest.lic +++ b/sigilharvest.lic @@ -338,7 +338,7 @@ class SigilHarvest # check our stock of scrolls since we just used some get_scrolls - #if roomcap was not specified, exit script once sigil-scrolls are harvested + # if roomcap was not specified, exit script once sigil-scrolls are harvested exit unless @args.roomcap end # scribe_sigils From 3984e122491d78d69a5ee4e1d035ccacf390e360 Mon Sep 17 00:00:00 2001 From: Hiinky <46695687+Hiinky@users.noreply.github.com> Date: Sat, 4 Nov 2023 10:34:35 -0400 Subject: [PATCH 22/29] Urgent fix to Corn Maze Current stow logic isn't ever catching a true and returning. This simplifies the check on if the stow was successful or not. --- corn-maze.lic | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/corn-maze.lic b/corn-maze.lic index 92ad5a57d5..f0f112ce59 100644 --- a/corn-maze.lic +++ b/corn-maze.lic @@ -720,12 +720,11 @@ class CornMaze def stow_thing(thing) if @settings.cornmaze_containers.any? @settings.cornmaze_containers.each do |container| - unless DRCI.put_away_item?(thing, container) - unless DRCI.stow_item?(thing) - DRC.message("#{thing} didn't fit anywhere. Dropping it.") - DRCI.dispose_trash(thing, @worn_trashcan, @worn_trashcan_verb) - end - end + return if DRCI.put_away_item?(thing, container) + return if DRCI.stow_item?(thing) + DRC.message("#{thing} didn't fit anywhere. Dropping it.") + DRCI.dispose_trash(thing) + return end else unless DRCI.stow_item?(thing) From 0b43107f07204f809f8a6ba89e62373515c8bd50 Mon Sep 17 00:00:00 2001 From: Hiinky <46695687+Hiinky@users.noreply.github.com> Date: Sat, 4 Nov 2023 11:09:26 -0400 Subject: [PATCH 23/29] Update corn-maze.lic --- corn-maze.lic | 1 - 1 file changed, 1 deletion(-) diff --git a/corn-maze.lic b/corn-maze.lic index f0f112ce59..968a651015 100644 --- a/corn-maze.lic +++ b/corn-maze.lic @@ -724,7 +724,6 @@ class CornMaze return if DRCI.stow_item?(thing) DRC.message("#{thing} didn't fit anywhere. Dropping it.") DRCI.dispose_trash(thing) - return end else unless DRCI.stow_item?(thing) From 42cfc40c1c124b82d2ab8c1597931e64055c2118 Mon Sep 17 00:00:00 2001 From: Hiinky <46695687+Hiinky@users.noreply.github.com> Date: Sat, 4 Nov 2023 11:10:57 -0400 Subject: [PATCH 24/29] Update corn-maze.lic --- corn-maze.lic | 2 ++ 1 file changed, 2 insertions(+) diff --git a/corn-maze.lic b/corn-maze.lic index 968a651015..b016decd4c 100644 --- a/corn-maze.lic +++ b/corn-maze.lic @@ -721,7 +721,9 @@ class CornMaze if @settings.cornmaze_containers.any? @settings.cornmaze_containers.each do |container| return if DRCI.put_away_item?(thing, container) + return if DRCI.stow_item?(thing) + DRC.message("#{thing} didn't fit anywhere. Dropping it.") DRCI.dispose_trash(thing) end From c0b3f646e66f5319724a0dad8eb9947b0a08a140 Mon Sep 17 00:00:00 2001 From: Hiinky <46695687+Hiinky@users.noreply.github.com> Date: Sat, 4 Nov 2023 11:12:43 -0400 Subject: [PATCH 25/29] Update corn-maze.lic --- corn-maze.lic | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/corn-maze.lic b/corn-maze.lic index b016decd4c..1d54b5a96c 100644 --- a/corn-maze.lic +++ b/corn-maze.lic @@ -720,10 +720,8 @@ class CornMaze def stow_thing(thing) if @settings.cornmaze_containers.any? @settings.cornmaze_containers.each do |container| - return if DRCI.put_away_item?(thing, container) - - return if DRCI.stow_item?(thing) - + break if DRCI.put_away_item?(thing, container) + break if DRCI.stow_item?(thing) DRC.message("#{thing} didn't fit anywhere. Dropping it.") DRCI.dispose_trash(thing) end From 36df6d1fa973ae740fe0e5be8916873f65e6fde0 Mon Sep 17 00:00:00 2001 From: Hiinky <46695687+Hiinky@users.noreply.github.com> Date: Sat, 4 Nov 2023 11:14:04 -0400 Subject: [PATCH 26/29] Update corn-maze.lic --- corn-maze.lic | 1 + 1 file changed, 1 insertion(+) diff --git a/corn-maze.lic b/corn-maze.lic index 1d54b5a96c..7c87adf9c7 100644 --- a/corn-maze.lic +++ b/corn-maze.lic @@ -722,6 +722,7 @@ class CornMaze @settings.cornmaze_containers.each do |container| break if DRCI.put_away_item?(thing, container) break if DRCI.stow_item?(thing) + DRC.message("#{thing} didn't fit anywhere. Dropping it.") DRCI.dispose_trash(thing) end From 93cda67173f4a019545c12f5ec2f19c4fbd52c89 Mon Sep 17 00:00:00 2001 From: MahtraDR <93822896+MahtraDR@users.noreply.github.com> Date: Tue, 7 Nov 2023 08:53:50 +1300 Subject: [PATCH 27/29] [scripts][corn-maze] Update stow loop. --- corn-maze.lic | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/corn-maze.lic b/corn-maze.lic index 7c87adf9c7..1521f0c307 100644 --- a/corn-maze.lic +++ b/corn-maze.lic @@ -268,7 +268,7 @@ class CornMaze end def count_he_bottle - DRC.bput("count my bottle", /^I could not find what you were referring to/, /^You count the number of kernels inside the bottle and find that there are \d+,?\d*/).tr(',', '').scan(/\d+/).first.to_i + DRC.bput("count my bottle", /^That doesn't tell you much of anything/, /^I could not find what you were referring to/, /^You count the number of kernels inside the bottle and find that there are \d+,?\d*/).tr(',', '').scan(/\d+/).first.to_i end def do_short_task(task) @@ -720,18 +720,13 @@ class CornMaze def stow_thing(thing) if @settings.cornmaze_containers.any? @settings.cornmaze_containers.each do |container| - break if DRCI.put_away_item?(thing, container) - break if DRCI.stow_item?(thing) - - DRC.message("#{thing} didn't fit anywhere. Dropping it.") - DRCI.dispose_trash(thing) - end - else - unless DRCI.stow_item?(thing) - DRC.message("YOU'VE RUN OUT OF ROOM! GET SOME MORE SPACE, YOU LAZY SLOB!") - DRCI.dispose_trash(thing, @worn_trashcan, @worn_trashcan_verb) + return if DRCI.put_away_item?(thing, container) end end + unless DRCI.stow_item?(thing) + DRC.message("YOU'VE RUN OUT OF ROOM! GET SOME MORE SPACE, YOU LAZY SLOB!") + DRCI.dispose_trash(thing, @worn_trashcan, @worn_trashcan_verb) + end end def recover_stun @@ -744,7 +739,7 @@ class CornMaze end before_dying do - kernel_count = DRC.bput("count my bottle", /^I could not find what you were referring to/, /^You count the number of kernels inside the bottle and find that there are \d+,?\d*/).tr(',', '').scan(/\d+/).first.to_i + kernel_count = DRC.bput("count my bottle", /^That doesn't tell you much of anything/, /^I could not find what you were referring to/, /^You count the number of kernels inside the bottle and find that there are \d+,?\d*/).tr(',', '').scan(/\d+/).first.to_i DRC.message("CM: Exiting script with #{kernel_count} kernels.") Flags.delete('maze_done') Flags.delete('poisoned') From fb1d71c2452a2f31cadce07678dd6ed3de9183a9 Mon Sep 17 00:00:00 2001 From: Mahtra Date: Tue, 7 Nov 2023 12:31:46 +1300 Subject: [PATCH 28/29] [scripts][common] Move from local Time.now to server_time --- common.lic | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common.lic b/common.lic index a4c813f1c1..5354102fbd 100644 --- a/common.lic +++ b/common.lic @@ -879,7 +879,7 @@ module DRC _respond( "" + (make_bold ? bold(text) : text), - ">" + ">" ) end From fc10ccb532593c9d740a801e366add11abbdc99c Mon Sep 17 00:00:00 2001 From: Chris Date: Tue, 7 Nov 2023 01:02:38 +0000 Subject: [PATCH 29/29] Remedy - Avoid random digits in stream when counting herbs Remedy - Avoid random digits in XLM stream when counting herbs. --- remedy.lic | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/remedy.lic b/remedy.lic index 1acd8bcea1..ce45b2a756 100644 --- a/remedy.lic +++ b/remedy.lic @@ -194,7 +194,7 @@ class Remedy when 'none' # this part is to avoid the message "You are already holding that." # in cases where it won't get more herbs, it takes a longer route to get herbs from other bags (not @bag nor @herb_container) - @count = Integer(DRC.bput("count my #{@herb1}", '\d+')) + @count = DRC.bput("count my #{@herb1}", '^You count out \d+').scan(/\d+/).first.to_i while @count < 25 DRC.bput("put my #{@herb1} in my #{@container}", 'You put', 'already has something in it.', 'you count off and place only that many inside') fput("stow my #{@herb1}") # in case there are extra @@ -209,11 +209,11 @@ class Remedy if DRC.bput("combine my #{@herb1}", 'You combine', 'too large to add', 'You must be holding both') == 'You must be holding both' @count = 25 # 25 used to break loops else - @count += Integer(DRC.bput("count my #{@herb1}", '\d+')) # increment to run again + @count += DRC.bput("count my #{@herb1}", '^You count out \d+').scan(/\d+/).first.to_i # increment to run again end end else - @count += Integer(DRC.bput("count my #{@herb1}", '\d+')) + @count += DRC.bput("count my #{@herb1}", '^You count out \d+').scan(/\d+/).first.to_i if DRC.bput("combine my #{@herb1}", 'You combine', 'too large to add', 'You must be holding both') == 'too large to add' f_stack = DRC.bput("count my first #{@herb1}", 'You count out \d+ pieces').scan(/\d+/).first.to_i s_stack = DRC.bput("count my second #{@herb1}", 'I could not find', 'You count out \d+ pieces').scan(/\d+/).first.to_i