Distillo-bot 3000 by Aphlux
Description: Distillo-bot 3000 will watch a selected container and create distillations from extracts placed within.
1# Distillo-bot 3000
2#
3# Automatically creates new distillations when
4# extracts are placed into a selected container.
5# The new distillation will be returned
6# to the same container.
7#
8# Designed for use by guilds or homeowners who
9# want to run a bot that will create distillations
10# for other players.
11#
12# Requirements:
13# A container within reach used as a drop box for extracts.
14# Cannot be a bag in the crafters backpack.
15#
16# The character running this script should have a stock
17# of empty bottles and mortal and pestles in their backpack.
18#
19# Restock commands can be added to restock from another container.
20#
21# Written by: Aphlux (aka Aphra)
22# Created on: September 4, 2022
23# Last updated: May 22, 2023
24
25# gump vars
26@setvar! alchGumpID 949095101
27@setvar! aspectPageID 108
28@setvar! nextPageResponse 11
29
30# select the drop bag where people will place extracts
31if not varexist distDrop
32 overhead 'Select the bag to watch for extracts in.'
33 setvar distDrop
34
35 if find distDrop self
36 overhead 'INVALID: The drop bag cannot be in your own pockets!' 38
37 wait 1000
38 unsetvar distDrop
39 loop
40 endif
41 overhead 'Distillo-bot 3000 Initialized.'
42else
43 dclick distDrop
44endif
45
46overhead 'Waiting for extract drop...' 920
47wait 250
48
49# pickup bottles on the floor
50if counttype 'empty bottle%s%' self = 0
51 @setvar bottleID 0
52 if findtype 'empty bottle%s%' ground -1 -1 2 as bottles
53 @setvar bottleID bottles
54 elseif findtype 'empty bottle%s%' distDrop as bottles
55 @setvar bottleID bottles
56 endif
57
58 if bottleID > 0
59 lift bottleID 60000
60 drop backpack -1 -1 -1
61 say 'Thank you for the bottles!'
62 wait 1000
63 endif
64endif
65
66# pickup mortal and pestle on the floor
67if counttype 'mortar and pestle' self = 0
68 @setvar! toolID 0
69 if findtype 'mortar and pestle' ground -1 -1 2 as tool
70 @setvar! toolID tool
71 elseif findtype 'mortar and pestle' distDrop as tool
72 @setvar! toolID tool
73 endif
74
75 if toolID > 0
76 lift toolID 60000
77 drop backpack -1 -1 -1
78 say 'Thank you for the tools!'
79 wait 1000
80 endif
81endif
82
83# check for an extract in the drop bag
84@setvar! foundExtract 0
85@setvar! shouldSpeak 1
86while findtype 'bottle' distDrop as extract
87 @setvar! foundExtract 1
88 overhead 'Found an extract! Creating a new distill...'
89 getlabel extract extractName
90
91 if shouldSpeak = 1
92 @setvar! shouldSpeak 0
93 say 'Ah, an extract. Let me distill that for you...'
94 wait 250
95 endif
96
97 # check for empty bottles
98 if not findtype 'empty bottle%s%' self
99 overhead 'Need more empty bottles!' 38
100 say "I am out of empty bottles! Please drop some on the floor for me."
101 wait 3000
102 loop
103 endif
104
105 # open the alch gump, and go to page 2
106 # of the aspect section where distills begin
107 if findtype 'mortar and pestle' self as tool
108 gumpclose alchGumpID
109 dclick tool
110 waitforgump alchGumpID
111
112 # goto 'Aspect Items'
113 gumpresponse aspectPageID
114 waitforgump alchGumpID
115 wait 650
116
117 # goto page 3
118 gumpresponse nextPageResponse
119 waitforgump alchGumpID
120 wait 650
121 else
122 overhead 'Need more mortal and pestles!' 38
123 say "I am out of mortar and pestles! Please drop some on the floor for me."
124 wait 3000
125 loop
126 endif
127
128 # move the extract once we know we can make a distill
129 lift extract 1
130 drop backpack -1 -1 -1
131 wait 650
132
133 # go to the page for this extract,
134 # then create it
135 // page 3
136 if 'Air' in extractName
137 overhead 'Air' 1001
138 gumpresponse 200 alchGumpID
139
140 elseif 'Artisan' in extractName
141 overhead 'Artisan' 544
142 gumpresponse 201 alchGumpID
143
144 elseif 'Blood' in extractName
145 overhead 'Blood' 38
146 gumpresponse 202 alchGumpID
147
148 elseif 'Command' in extractName
149 overhead 'Command' 68
150 gumpresponse 203 alchGumpID
151
152 elseif 'Death' in extractName
153 overhead 'Death' 923
154 gumpresponse 204 alchGumpID
155
156 elseif 'Discipline' in extractName
157 overhead 'Discipline' 442
158 gumpresponse 205 alchGumpID
159
160 elseif 'Earth' in extractName
161 overhead 'Earth' 544
162 gumpresponse 206 alchGumpID
163
164 elseif 'Eldritch' in extractName
165 overhead 'Eldritch' 24
166 gumpresponse 207 alchGumpID
167
168 elseif 'Fire' in extractName
169 overhead 'Fire' 38
170 gumpresponse 208 alchGumpID
171
172 elseif 'Fortune' in extractName
173 overhead 'Fortune' 53
174 gumpresponse 209 alchGumpID
175
176 // page 4
177 elseif 'Gadget' in extractName
178 overhead 'Gadget' 53
179 gumpresponse nextPageResponse alchGumpID
180 waitforgump alchGumpID
181 gumpresponse 200 alchGumpID
182
183 elseif 'Harvest' in extractName
184 overhead 'Harvest' 53
185 gumpresponse nextPageResponse alchGumpID
186 waitforgump alchGumpID
187 gumpresponse 201 alchGumpID
188
189 elseif 'Holy' in extractName
190 overhead 'Holy' 53
191 gumpresponse nextPageResponse alchGumpID
192 waitforgump alchGumpID
193 gumpresponse 202 alchGumpID
194
195 elseif 'Lyric' in extractName
196 overhead 'Lyric' 38
197 gumpresponse nextPageResponse alchGumpID
198 waitforgump alchGumpID
199 gumpresponse 203 alchGumpID
200
201 elseif 'Poison' in extractName
202 overhead 'Poison' 68
203 gumpresponse nextPageResponse alchGumpID
204 waitforgump alchGumpID
205 gumpresponse 204 alchGumpID
206
207 elseif 'Shadow' in extractName
208 overhead 'Shadow' 923
209 gumpresponse nextPageResponse
210 waitforgump alchGumpID
211 gumpresponse 205 alchGumpID
212
213 elseif 'Void' in extractName
214 overhead 'Void' 14
215 gumpresponse nextPageResponse alchGumpID
216 waitforgump alchGumpID
217 gumpresponse 206 alchGumpID
218
219 elseif 'War' in extractName
220 overhead 'War' 44
221 gumpresponse nextPageResponse alchGumpID
222 waitforgump alchGumpID
223 gumpresponse 207 alchGumpID
224
225 elseif 'Water' in extractName
226 overhead 'Water' 8
227 gumpresponse nextPageResponse alchGumpID
228 waitforgump alchGumpID
229 gumpresponse 208 alchGumpID
230
231 else
232 overhead 'Unknown extract type! {{extractName}}' 38
233 say 'DISTILLO-BOT FATAL ERROR! CANNOT COMPUTE! CANNOT COMPUTE!'
234 endif
235
236 waitforgump alchGumpID 1000
237 gumpclose alchGumpID
238 wait 3000
239endwhile
240
241# move the new distillations back into the drop bag
242while findtype 'flask' self as distillation
243 lift distillation 99
244 drop distDrop -1 -1 -1
245 wait 1500
246endwhile
247
248if foundExtract == 1
249 say 'There you go! Thank you for using Distillo-bot 3000 and have a nice day.'
250endif
251
252loop