-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMC_Mix.cmd
298 lines (270 loc) · 8.43 KB
/
MC_Mix.cmd
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
#debug 10
var mix.repeat 0
var current.lore ALCHEMY
if_3 var herb1 %3
if_4 var herb2 %4
if_2 var mix.repeat %2
if_1 put #var MC.order.noun %1
var tool mix
var alcohol.gone 0
var water.gone 0
var catalyst.gone 0
var special NULL
include mc_include.cmd
action var tool mix when appears free of defects that would
action var tool mix when You do not see anything that would prevent
action var tool mix when composition looks accurate
action var tool mix when ^You realize the(.*) is not required to continue
action var tool mix when ^That tool does not seem
action var tool turn when Clumps of material stick to the sides
action var tool turn when ^Once finished you notice clumps of material
action var tool smell when As you finish, the mixture begins to transition colors
action var tool smell when takes on an odd hue
action var tool sieve when ^Upon completion you see (?:some )?particulate clouding up the mixture
action var tool sieve when ^A thick froth coats
action var water.gone 1 when ^But there are no liquids
action var special water when ^You need another splash of water to continue crafting
action var special alcohol when ^You need another splash of alcohol to continue crafting
action var special catalyst when ^You need another catalyst material to
action var special add.herb when You need another prepared herb to
action var tool done when ^Applying the final touches, you complete working
#action (work) goto Retry when \.\.\.wait|type ahead
action (work) off
var alchemy.storage $MC_ALCHEMY.STORAGE
action (order) var water.order $1 when (\d+)\)\..*10 splashes of water.*(Lirums|Kronars|Dokoras)
action (order) var alcohol.order $1 when (\d+)\)\..*10 splashes of grain alcohol.*(Lirums|Kronars|Dokoras)
action (order) var catalyst.order $1 when (\d+)\)\..*a massive coal nugget.*(Lirums|Kronars|Dokoras)
var liquid tonic|wash|potion|elixir|draught
var solid cream|salve|balm|poultices|ungent|ointment
if matchre("$MC.order.noun", "%liquid") then
{
echo
echo * LIQUID - Using Stick/Bowl
echo
var mixer $MC_STICK
var bowl $MC_BOWL
var tool.mix mix
var water alcohol
}
if matchre("$MC.order.noun", "%solid") then
{
echo
echo * SOLID - Using Mortar/Pestle
echo
var mixer $MC_PESTLE
var bowl $MC_MORTAR
var tool.mix crush
var water water
}
unfinished:
gosub ToolCheckRight %bowl
if matchre("%bowl", "$lefthand") then gosub PUT swap
send look in my %bowl
waitforre (^In the (.*)\.$|^I could not find|^There is nothing in there)
pause 1
if contains("$0", "unfinished") then
{
send analyze my $MC.order.noun
waitforre ^You.*analyze
if !matchre("%bowl", "$righthand") then gosub PUT swap
pause 1
goto work
}
if !matchre("$0", "There is nothing in there") then
{
put tilt %bowl
put tilt %bowl
pause 2
}
first.mix:
gosub ToolCheckRight %bowl
if matchre("%bowl", "$lefthand") then gosub PUT swap
gosub ToolCheckLeft %herb1
gosub PUT_IT my %herb1 in my %bowl
pause 0.5
if "$lefthand" != "Empty" then gosub STOW_LEFT
pause 0.5
gosub GET my %mixer
if !matchre("$lefthand|$righthand", "%mixer") then gosub GET my mixer from my portal
pause 0.5
if "%tool.mix" = "crush" then gosub Action %tool.mix %herb1 in my %bowl with my %mixer
else gosub Action %tool.mix my %bowl with my %mixer
pause 5
goto work
work:
action (work) on
save %tool
if "%tool" = "done" then goto done
gosub %tool
goto work
mix:
gosub specialcheck
gosub ToolCheckLeft %mixer
if "%tool.mix" = "crush" then gosub Action %tool.mix $MC.order.noun in my %bowl with my %mixer
else gosub Action %tool.mix my %bowl with my %mixer
return
sieve:
gosub specialcheck
gosub ToolCheckLeft $MC_SIEVE
var tool mix
gosub Action push my $MC.order.noun with my $MC_SIEVE
return
smell:
gosub specialcheck
var tool mix
gosub Action smell my $MC.order.noun
return
turn:
gosub specialcheck
var tool mix
gosub Action turn my %bowl
return
water:
if %water.gone = 1 then gosub new.tool
gosub ToolCheckLeft water
var tool mix
send pour part water in my %bowl
pause 0.5
if !contains("$lefthandnoun", "water") then var water.gone 1
return
alcohol:
if %alcohol.gone = 1 then gosub new.tool
gosub ToolCheckLeft alcohol
var tool mix
send pour part alcohol in my %bowl
pause 0.5
if !contains("$lefthandnoun", "alcohol") then var alcohol.gone 1
return
catalyst:
if %catalyst.gone = 1 then gosub new.tool
if !contains("$lefthandnoun", "nugget") then
{
if "$lefthand" != "Empty" then gosub STOW_LEFT
gosub GET my coal nugget from my %alchemy.storage
}
var tool mix
send put nugget in my %bowl
pause 0.5
if !contains("$lefthandnoun", "nugget") then var catalyst.gone 1
return
add.herb:
gosub ToolCheckLeft %herb2
var tool mix
send put %herb2 in my %bowl
pause 0.5
return
specialcheck:
if "%special" != "NULL" then gosub %special
var special NULL
return
new.tool:
if contains("$scriptlist", "mastercraft") then
{
action (work) off
var temp.room $roomid
if ((%water.gone = 1) || (%alcohol.gone = 1) || (%catalyst.gone = 1)) then
{
if matchre("$righthand", "%bowl") then gosub PUT_IT #$righthandid in my %tool.storage
if matchre("$lefthand", "%bowl") then gosub PUT_IT #$lefthandid in my %tool.storage
}
if %water.gone = 1 then
{
if !("$righthand" = "Empty" || "$lefthand" = "Empty") then send put my %bowl in my %tool.storage
gosub summonwater
if (("$righthandnoun" != "%bowl") && ("$lefthandnoun" != "%bowl")) then send get my %bowl from my %tool.storage
pause .5
var water.gone 0
}
if %alcohol.gone = 1 then
{
if (("$righthand" != "Empty") || ("$lefthand" != "Empty")) then send put my %bowl in my %tool.storage
gosub summonalcohol
if (("$righthandnoun" != "%bowl") && ("$lefthandnoun" != "%bowl")) then send get my %bowl from my %tool.storage
var alcohol.gone 0
}
if %catalyst.gone = 1 then
{
gosub automove Forging suppl
if (("$righthand" != "Empty" || ("$lefthand" != "Empty")) then send put my %bowl in my %tool.storage
action (order) on
pause 1
gosub ORDER
action (order) off
gosub ORDER %catalyst.order
gosub PUT_IT my nugget in my %alchemy.storage
if (("$righthandnoun" != "%bowl") && ("$lefthandnoun" != "%bowl")) then send get my %bowl from my %tool.storage
var catalyst.gone 0
}
gosub automove %temp.room
pause 0.5
unvar temp.room
action (work) on
return
}
else
{
echo *** Out of Water or Alcohol! Go get more!
put #parse MIX DONE
put #parse ALCHEMY DONE
exit
}
lack.coin:
if "%get.coin" = "off" then goto lack.coin.exit
action (withdrawl) goto lack.coin.exit when (^The clerk flips through her ledger|^The clerk tells you)
gosub automove teller
send withd 5 gold
waitfor The clerk counts|You count out
gosub automove %temp.room
var need.coin 0
action remove (^The clerk flips through her ledger|^The clerk tells you)
pause 1
goto %purchaselabel
lack.coin.exit:
echo You need some startup coin to purchase stuff! Go to the bank and try again!
put #parse Need coin
exit
return:
return
Retry:
pause 1
goto work
repeat:
math mix.repeat subtract 1
gosub PUT_IT my $MC.order.noun in my %alchemy.storage
if ("%repair" = "on") then gosub check.tools
gosub GET my remedy book
if !matchre("$righthand|$lefthand", "book") then gosub GET my remedy book from my portal
gosub STUDY my book
gosub PUT_IT my book in my %alchemy.storage
gosub GET my %material
if !matchre("$righthand|$lefthand", "%material") then gosub GET my %material from my portal
var tool mix
goto first.mix
done:
if %water.gone = 1 then gosub new.tool
if %catalyst.gone = 1 then gosub new.tool
if %alcohol.gone = 1 then gosub new.tool
if "$lefthand" != "Empty" then gosub STOW_LEFT
gosub GET my $MC.order.noun from my %bowl
if %mix.repeat > 1 then
{
gosub PUT_IT $MC.order.noun in %alchemy.storage
goto repeat
}
if "$righthand" != "Empty" then gosub STOW_RIGHT
if ("%repair" = "on") then gosub check.tools
gosub countcheck
put #parse ALCHEMY DONE
exit
countcheck:
if $MC_NOWO then return
action var temprem $1 when ^You count out (\d+) uses remaining\.
gosub PUT count my $MC.order.noun
if %temprem > 5 then
{
gosub PUT mark my $MC.order.noun at 5
gosub PUT break my $MC.order.noun
gosub PUT empty left
gosub PUT swap
}
return