forked from brycole/gemstone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbundleall.lic
152 lines (128 loc) · 7.48 KB
/
bundleall.lic
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
=begin
Bundles all herbs in open containers and puts the bundles in your Lich.herbsack
If it misses some herbs, try looking in the container before you run it.
~sangreal
=end
silence_me
herbs = ["some haphip root", "some dirty haphip root", "a tincture of haphip", "a sparrowhawk pie", "a pennyroyal tea", "a dull crimson ale", "a flagon of Agrak's Amber ale", "a barrel of Agrak's Amber ale", "some woth flower", "some fragrant woth flower", "a tincture of woth", "a flower-shaped tart", "a valerian root potion", "a stalagmite brew", "a flagon of Dacra's Dream ale", "a barrel of Dacra's Dream ale", "some ephlox moss", "a ball of ephlox moss", "a tincture of ephlox", "some frog's bone porridge", "a sweetfern potion", "a crushed cavegrass tea", "a flagon of Golden Goose ale", "a barrel of Golden Goose ale", "a bur-clover potion", "a crystalline bur-clover elixir", "a tincture of bur-clover", "a starfish potion", "a daggit root potion", "a dirty rat fur potion", "a flagon of Volcano Vision ale", "a barrel of Volcano Vision ale", "a wingstem potion", "a crystalline wingstem elixir", "a tincture of wingstem", "an earthworm potion", "a wyrmwood root potion", "a dirty crevice brew", "a flagon of Wort's Winter ale", "a barrel of Wort's Winter ale", "a rose-marrow potion", "a crystalline rose-marrow elixir", "a tincture of rose-marrow", "an elk horn potion", "some feverfew tea", "a rusty red ale", "a flagon of Semak's Smooth ale", "a barrel of Semak's Smooth ale", "some torban leaf", "some fresh torban leaf", "a tincture of torban", "a Ma Leaftoe's spiced torban tart", "a valerian root tea", "a dark frothing ale", "a flagon of Miner's Muddy ale", "a barrel of Miner's Muddy ale", "some sovyn clove", "a small sovyn clove", "a tincture of sovyn", "some rock ptarmigan feathers", "an angelica root potion", "a grainy black potion", "a flagon of Captn' Pegleg's ale", "a barrel of Captn' Pegleg's ale", "a bolmara potion", "a crystalline bolmara elixir", "a tincture of bolmara", "a snowflake elixir", "a red lichen potion", "a glowing mold tea", "a flagon of Kenar's Dropjaw ale", "a barrel of Kenar's Dropjaw ale", "a brostheras potion", "a crystalline brostheras elixir", "a tincture of brostheras", "some polar bear fat soup", "a pennyroyal potion", "a stone soot brew", "a flagon of Reaper's Red ale", "a barrel of Reaper's Red ale", "some aloeas stem", "some withered aloeas stem", "a tincture of aloeas", "some ram's bladder", "a feverfew potion", "a sticky lichen tea", "a flagon of Dark Swampwater ale", "a barrel of Dark Swampwater ale", "some wolifrew lichen", "some dry wolifrew lichen", "a tincture of wolifrew", "a Leaftoe's lichen tart", "some red lichen tea", "a thick foggy ale", "a flagon of Orc's Head ale", "a barrel of Orc's Head ale", "some basal moss", "a ball of basal moss", "a tincture of basal", "some tundra grass", "some ginkgo nut tea", "a chunky black ale", "a flagon of Mama Dwarf's ale", "a barrel of Mama Dwarf's ale", "a tincture of moss", "some pothinir grass", "some bright green pothinir grass", "a tincture of pothinir", "a musk ox tart", "a ginkgo nut potion", "a roasted ratweed tea", "a flagon of Aged Schooner ale", "a barrel of Aged Schooner ale", "some cactacae spine", "some prickly cactacae spine", "a tincture of cactacae", "some elk fat gel", "a manroot tea", "a spotted toadstool ale", "a flagon of Bearded Ladies' ale", "a barrel of Bearded Ladies' ale", "some calamia fruit", "some ripe calamia fruit", "a tincture of calamia", "some walrus blubber", "a manroot potion", "a stalactite brew", "a flagon of Mad Mutt Frothy ale", "a barrel of Mad Mutt Frothy ale", "some acantha leaf", "some spicy acantha leaf", "a tincture of acantha", "an iceberry tart", "some acantha leaf tea", "a grey mushroom potion", "a flagon of Olak's Ol'style ale", "a barrel of Olak's Ol'style ale", "a flagon of Bloody Krolvin ale", "a barrel of Bloody Krolvin ale", "some ambrominas leaf", "some sugary ambrominas leaf", "a tincture of ambrominas", "a Dabbings Family special tart", "some sweetfern tea", "a bubbling brown ale", "a flagon of Lost Dogwater ale", "a barrel of Lost Dogwater ale", "a talneo potion", "a crystalline talneo elixir", "a tincture of talneo", "a rock lizard potion", "a wyrmwood root tea", "a brown weedroot ale", "a flagon of Gert's Homemade ale", "a barrel of Gert's Homemade ale"]
herbsack_full = false
stowsack = GameObj.inv.find{|bag| bag.id == XMLData.stow_container_id}
unless herbsack = GameObj.inv.find { |bag| bag.name =~ /#{Lich.herbsack}/i }
echo 'Herbsack not found. Exiting'
exit
end
if GameObj.right_hand.id || GameObj.left_hand.id
refill_hands = true
empty_hands
end
if GameObj.right_hand.id || GameObj.left_hand.id
echo "Failed to empty hands?"
exit
end
if herbsack.contents.nil?
fput "open ##{herbsack.id}"
fput "look in ##{herbsack.id}"
close_herbsack = true
end
stow_item = proc{|item|
if script.vars[1]
["on","in","behind","under"].each{|place|
store_result = dothistimeout "place ##{item.id} #{place} #{script.vars[1]}",1,/You put|You slip|You carefully|fit/
break unless store_result =~ /^Your/
}
else
store_result = nil
unless herbsack_full
store_result = dothistimeout "_drag ##{item.id} ##{herbsack.id}",2,/You put|You slip|You carefully add|closed|fit/
end
if store_result =~ /fit|closed/
herbsack_full = true
end
if herbsack_full
store_result = dothistimeout "stow ##{item.id}",2,/You put|You slip|You carefully add|closed|fit/
if store_result =~ /fit/
echo "I don't know where to put your herbs!"
exit
end
end
end
}
contents = nil
if script.vars[1]
bench = (GameObj.room_desc.to_a + GameObj.loot.to_a).find{|obj| obj.noun == script.vars[1]}
unless bench
echo "Could not find target"
exit
end
if bench.contents.nil?
if bench.noun == "bin"
fput "look in ##{bench.id}"
else
fput "look on ##{bench.id}"
end
end
herbsack = bench
contents = GameObj.loot.to_a + bench.contents
else
contents = GameObj.containers.delete_if{|x,y| !GameObj.inv.any?{|z| z.id == x}}.values.flatten
end
ignore_list = Array.new
herbs.each{|herb|
bundle = contents.find_all{|item|
item.full_name.lstrip == herb
}
if bundle.length == 1 then
if herbsack.contents.find{|obj| obj.id == bundle[0].id} && herbsack_full == false
next
elsif stowsack.contents.find{|obj| obj.id == bundle[0].id} && herbsack_full == true
next
else
fput "get ##{bundle[0].id}"
stow_item.call(bundle[0])
next
end
elsif bundle.length == 0 then
next
end
bundle = bundle[0]
full = false
if bundle then
fput "get ##{bundle.id}"
ignore_list.push(bundle.id)
end
until (item = contents.find{|item| item.full_name.lstrip == herb && !ignore_list.include?(item.id)}).nil?
unless bundle
bundle = item
fput "get ##{item.id}"
ignore_list.push(item.id)
next
end
fput "get ##{item.id}"
if item.name =~ /potion|tincture|elixir|barrel|flagon|tea|soup/
until (pour_result = dothis "pour ##{item.id} in ##{bundle.id}",/You have|You only|You can|twinkling/) =~ /You can|twinkling/
end
full = true if pour_result =~ /You can/
else
bundle_result = dothis "bundle",/Carefully|If you|Try as|You can't/
if bundle_result =~ /If you/ then
full = true
elsif bundle_result =~ /Try as|You can't/
stow_item.call(item)
ignore_list.push(item.id)
else
bundle = GameObj.right_hand
end
end
if full then
stow_item.call(bundle)
bundle = item
full = false
end
ignore_list.push(item.id)
end
if bundle then
stow_item.call(bundle)
end
}
fput "close ##{herbsack.id}" if close_herbsack
fill_hands if refill_hands