Skip to content

Commit

Permalink
Update useherbs.lic
Browse files Browse the repository at this point in the history
Changed the ;useherbs fill routine to use the go_to_herbalist function instead of a single Script.run hardcoded to a single go2 location. Also added a deposit at end of fill routine to deposit leftover coins. Added in "small sovyn clove" and attempt to add some extra look in herbcontainer regex.
  • Loading branch information
mrhoribu authored Jan 9, 2020
1 parent 8cddbbc commit cd83e54
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions useherbs.lic
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ $known_herbs = [
{ :name=>"barrel of Bearded Ladies' ale", :type=>"minor limb scar", :short_name => "Bearded Ladies' ale" },
# fixme
{ :name=>"some sovyn clove", :type=>"severed limb", :short_name => "sovyn clove", :store_doses=>1 },
{ :name=>"small sovyn clove", :type=>"severed limb", :short_name => "sovyn clove", :store_doses=>1 },
{ :name=>"sovyn clove", :type=>"severed limb", },
{ :name=>"tincture of sovyn", :type=>"severed limb", },
{ :name=>"candied ptarmigan feather", :type=>"severed limb", :short_name => 'ptarmigan feather', :store_doses=>1 },
Expand Down Expand Up @@ -625,7 +626,7 @@ elsif script.vars[1].downcase == 'fill'
unless silvers > 4000
withdraw.call
end
Script.run('go2', '325')
go_to_herbalist.call
herb_shop_menu = read_menu.call
for herb_type in [ 'blood', 'major head wound', 'minor head wound', 'major head scar', 'minor head scar', 'major organ wound', 'minor organ wound', 'major organ scar', 'minor organ scar', 'missing eye', 'major limb wound', 'minor limb wound', 'major limb scar', 'minor limb scar', 'severed limb', 'major nerve wound', 'minor nerve wound', 'major nerve scar', 'minor nerve scar' ]
unless herb_container.contents.any? { |obj| $known_herbs.any? { |herb| (herb[:name] == obj.name) and herb[:type] == herb_type } }
Expand Down Expand Up @@ -656,6 +657,7 @@ elsif script.vars[1].downcase == 'fill'
end
end
fput "close ##{herb_container.id}" if close_herbsack
deposit.call
Script.run('go2', start_room.id.to_s)
exit
elsif script.vars[1].downcase == 'escort'
Expand All @@ -680,7 +682,7 @@ elsif script.vars[1].downcase == 'escort'
if open_result =~ /^You open/
close_herbsack = true
else
dothistimeout "look in ##{herb_container.id}", 10, /In the .*? you see/
dothistimeout "look in ##{herb_container.id}", 10, /In the .*? you see|In the .*?\:/
if herb_container.contents.nil?
echo "error: failed to find herb container contents (#{herb_container.name}, #{herb_container.id})"
exit
Expand Down Expand Up @@ -915,7 +917,7 @@ elsif script.vars[1].downcase == 'stock'
if open_result =~ /^You open/
close_herbsack = true
else
dothistimeout "look in ##{herb_container.id}", 10, /In the .*? you see/
dothistimeout "look in ##{herb_container.id}", 10, /In the .*? you see|In the .*?\:/
if herb_container.contents.nil?
echo "error: timeout while trying to look in herb container (#{herb_container.name}, #{herb_container.id})"
exit
Expand Down Expand Up @@ -1293,7 +1295,7 @@ else
if open_result =~ /^You open/
close_herbsack = true
else
dothistimeout "look in ##{herb_container.id}", 10, /In the .*? you see/
dothistimeout "look in ##{herb_container.id}", 10, /In the .*? you see|In the .*?\:/
if herb_container.contents.nil?
echo 'fixme 38923'
exit
Expand Down

0 comments on commit cd83e54

Please sign in to comment.