Skip to content

Commit

Permalink
Merge pull request #6725 from MahtraDR/corn_maze
Browse files Browse the repository at this point in the history
[scripts][corn-maze] Update stow loop.
  • Loading branch information
MahtraDR authored Nov 6, 2023
2 parents bf17199 + 93cda67 commit c5f9fd1
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions corn-maze.lic
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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')
Expand Down

0 comments on commit c5f9fd1

Please sign in to comment.