Skip to content

Commit

Permalink
Remedy - Avoid random digits in stream when counting herbs
Browse files Browse the repository at this point in the history
Remedy - Avoid random digits in XLM stream when counting herbs.
  • Loading branch information
cbisazza committed Nov 7, 2023
1 parent 930a79f commit fc10ccb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions remedy.lic
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit fc10ccb

Please sign in to comment.