-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrepairtools.cmd
350 lines (336 loc) · 11.3 KB
/
repairtools.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
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
########################
# MINI REPAIR TOOLS SCRIPT BY SHROOM
# STARTS AT YLONO REPAIR SHOP!
# REPAIRS ANY TOOLS YOU SET
#######################
var REPAIRER ylono
var Tool.Storage $MC_ENGINEERING.STORAGE
send stop play
pause 0.2
if_1 then goto %1
START:
## ENGINEERING TOOLS
var TOOL chisel
gosub REPAIR
var TOOL rasp
gosub REPAIR
var TOOL riffler
gosub REPAIR
var TOOL saw
gosub REPAIR
var TOOL plier
gosub REPAIR
## ALCHEMTY TOOLS
var TOOL bowl
gosub REPAIR
var TOOL mortar
gosub REPAIR
var TOOL pestle
gosub REPAIR
var TOOL sieve
gosub REPAIR
var TOOL mixing stick
gosub REPAIR
## ENCHANTING TOOLS
var TOOL burin
gosub REPAIR
var TOOL loop
gosub REPAIR
var TOOL fount
gosub REPAIR
var TOOL brazier
gosub REPAIR
var TOOL NULL
gosub REPAIR
WAIT.FOR.REPAIR:
var repairloop 0
put out
pause 0.5
send stop play
WAITING.REPAIR.LOOP:
pause 0.5
math repairloop add 1
if (%repairloop > 30) then goto DONE.REPAIR
send collect coin
pause 2
pause
send kick pile
pause
goto WAITING.REPAIR.LOOP
DONE.REPAIR:
pause 0.5
gosub automove ylono
pause 0.3
put .repairdone
waitforre REPAIR DONE\!
goto DONE
REPAIR:
pause 0.001
gosub GET MY %TOOL
gosub PUT give my %TOOL to %REPAIRER
gosub PUT give my %TOOL to %REPAIRER
gosub EMPTY.HANDS
return
REPAIR.DONE:
gosub GET MY TICKET
gosub PUT give my ticket to %REPAIRER
gosub EMPTY.HANDS
return
GET:
var Get $0
GET.CONTINUE:
pause 0.001
matchre GET.CONTINUE ^\.\.\.wait\s+\d+\s+sec(?:onds?|s)?\.?$|^Sorry\,
matchre GET.CONTINUE ^You struggle with .* great weight but can't quite lift it\!
matchre GET2 ^You should untie
matchre GET2 ^Get what\?
matchre GET2 ^I could not find what you were referring to\.
matchre GET2 ^What were you referring to\?
matchre GET2 ^You pull at it
matchre RETURN You'?r?e? (?:hand|slip|put|get|.* to|can't|quickly|switch|deftly|swiftly|untie|sheathe|strap|slide|desire|raise|sling|pull|drum|trace|wear|tap|recall|press|hang|gesture|push|move|whisper|lean|tilt|cannot|mind|drop|drape|loosen|work|lob|spread|not|fill|will|now|slowly|quickly|spin|filter|need|shouldn't|pour|blow|twist|struggle|place|knock|toss|set|add|search|circle|fake|weave|shove|try|must|wave|sit|fail|turn|already|can\'t|glance|bend|swing|chop|bash|dodge|feint|draw|parry|carefully|quietly|sense|begin|rub|sprinkle|stop|combine|take|decide|insert|lift|retreat|load|fumble|exhale|yank|allow|have|are|wring|icesteel|scan|vigorously|adjust|bundle|ask|form|lose|remove|accept|pick|silently|realize|open|grab|fade|offer|aren't|kneel|don\'t|close|let|find|attempt|tie|roll|attach|feel(?! fully rested)|read|reach|gingerly|come|corruption|count|secure|unload|remain|release|shield) .*(?:\.|\!|\?)?
matchre RETURN ^You are already holding that\.
matchre RETURN ^You remove|Please rephrase
send get %Get
matchwait
GET2:
pause 0.001
matchre GET.CONTINUE ^\.\.\.wait\s+\d+\s+sec(?:onds?|s)?\.?$|^Sorry\,
matchre GET.CONTINUE ^You struggle with .* great weight but can't quite lift it\!
matchre RETURN You'?r?e? (?:hand|slip|put|get|.* to|can't|quickly|switch|deftly|swiftly|untie|sheathe|strap|slide|desire|raise|sling|pull|drum|trace|wear|tap|recall|press|hang|gesture|push|move|whisper|lean|tilt|cannot|mind|drop|drape|loosen|work|lob|spread|not|fill|will|now|slowly|quickly|spin|filter|need|shouldn't|pour|blow|twist|struggle|place|knock|toss|set|add|search|circle|fake|weave|shove|try|must|wave|sit|fail|turn|already|can\'t|glance|bend|swing|chop|bash|dodge|feint|draw|parry|carefully|quietly|sense|begin|rub|sprinkle|stop|combine|take|decide|insert|lift|retreat|load|fumble|exhale|yank|allow|have|are|wring|icesteel|scan|vigorously|adjust|bundle|ask|form|lose|remove|accept|pick|silently|realize|open|grab|fade|offer|aren't|kneel|don\'t|close|let|find|attempt|tie|roll|attach|feel(?! fully rested)|read|reach|gingerly|come|corruption|count|secure|unload|remain|release|shield) .*(?:\.|\!|\?)?
matchre RETURN ^Untie what\?
matchre RETURN ^You are already holding that\.
matchre RETURN ^Get what\?
matchre RETURN ^You remove
matchre RETURN ^I could not find what you were referring to\.
matchre RETURN ^What were you referring to\?|Please rephrase
send untie %Get
matchwait
STOW:
var Stow $0
STOW.CONT:
pause 0.001
matchre STOW.CONT ^\.\.\.wait\s+\d+\s+sec(?:onds?|s)?\.?$|^Sorry\,
matchre RETURN ^You put your .*\.
matchre RETURN ^What were you referring to\?
matchre RETURN ^Stow what\? Type 'STOW HELP' for details\.
send put my %Stow in my %Tool.Storage
matchwait 7
STOW.2:
pause 0.001
matchre STOW.2 ^\.\.\.wait\s+\d+\s+sec(?:onds?|s)?\.?$|^Sorry\,
matchre RETURN ^You put your .*\.
matchre RETURN ^What were you referring to\?
matchre RETURN ^Stow what\? Type 'STOW HELP' for details\.
send stow my %Stow
matchwait
PUT:
var Command $0
PUT.CONT:
pause 0.001
matchre PUT.CONT ^\.\.\.wait\s+\d+\s+sec(?:onds?|s)?\.?$|^Sorry\,
matchre PUT.CONT ^You don't seem to be able to move to do that|^You can't do that while entangled in a web
matchre PUT.STOW ^You need a free hand|You will need more coin
matchre RETURN ^\>|^You|^Please rephrase that command\.|^.* what\?|^Roundtime\:?\s+\d+\s+sec(?:onds|s)?\.?|^\[Roundtime\:?\s+\d+\s+sec(?:onds|s)?\.?\]|^\(Roundtime\:?\s+\d+\s+sec(?:onds|s)?\.?\)|^I could not find what you were referring to\.|^What were you referring to\?
send %Command
matchwait
PUT.STOW:
if ("$righthand" != "Empty") then gosub STOW RIGHT
if ("$lefthand" != "Empty") then gosub STOW LEFT
goto PUT.CONT
EMPTY.HANDS:
pause 0.1
if matchre("$righthand","(mortar|pestle|sieve|mixing stick) then
{
put tie $righthand to my alch belt
pause 0.5
}
if ("$righthand" != "Empty") then
{
eval Item tolower($righthandnoun)
gosub put put my %Item in my %Tool.Storage
}
if ("$lefthand" != "Empty") then
{
eval Item tolower($lefthandnoun)
gosub put put my %Item in my %Tool.Storage
}
return
RETURN:
pause 0.1
return
DONE:
gosub clear
pause 0.5
echo *** TOOL REPAIR COMPLETE!
put #parse TOOL REPAIR COMPLETE!
exit
#### AUTOMOVE
AUTOMOVE:
delay 0.0001
action (moving) on
var Moving 0
var Destination $0
var automovefailCounter 0
if (!$standing) then gosub AUTOMOVE_STAND
if ($roomid = 0) then gosub moveRandomDirection
if ("$roomid" = "%Destination") then return
AUTOMOVE_GO:
pause 0.0001
matchre AUTOMOVE_FAILED ^(?:AUTOMAPPER )?MOVE(?:MENT)? FAILED
matchre AUTOMOVE_RETURN ^YOU HAVE ARRIVED(?:\!)?
matchre AUTOMOVE_RETURN ^SHOP CLOSED(?:\!)?
matchre AUTOMOVE_FAIL_BAIL ^DESTINATION NOT FOUND
put #goto %Destination
matchwait 4
if (%Moving = 0) then goto AUTOMOVE_FAILED
matchre AUTOMOVE_FAILED ^(?:AUTOMAPPER )?MOVE(?:MENT)? FAILED
matchre AUTOMOVE_RETURN ^YOU HAVE ARRIVED(?:\!)?
matchre AUTOMOVE_RETURN ^SHOP CLOSED(?:\!)?
matchre AUTOMOVE_FAIL_BAIL ^DESTINATION NOT FOUND
matchwait 45
goto AUTOMOVE_FAILED
AUTOMOVE_STAND:
pause 0.1
matchre AUTOMOVE_STAND ^\.\.\.wait|^Sorry\,|^Please wait\.
matchre AUTOMOVE_STAND ^Roundtime\:?|^\[Roundtime\:?|^\(Roundtime\:?|^\[Roundtime|^Roundtime
matchre AUTOMOVE_STAND ^The weight of all your possessions prevents you from standing\.
matchre AUTOMOVE_STAND ^You are still stunned\.
matchre AUTOMOVE_RETURN ^You stand(?:\s*back)? up\.
matchre AUTOMOVE_RETURN ^You are already standing\.
send stand
matchwait
AUTOMOVE_FAILED:
pause 0.1
# put #script abort automapper
pause 0.2
math automovefailCounter add 1
if (%automovefailCounter > 3) then goto AUTOMOVE_FAIL_BAIL
send #mapper reset
pause 0.1
put look
pause 0.5
pause 0.2
if ($roomid = 0) || (%automovefailCounter > 2) then gosub moveRandomDirection
goto AUTOMOVE_GO
AUTOMOVE_FAIL_BAIL:
action (moving) off
put #echo
put #echo >Log Crimson *** AUTOMOVE FAILED. ***
put #echo >Log Destination: %Destination
put #echo Crimson *** AUTOMOVE FAILED. ***
put #echo Crimson Destination: %Destination
put #echo
return
AUTOMOVE_RETURN:
action (moving) off
pause 0.1
pause 0.2
return
MOVERANDOM:
moveRandomDirection:
var moveloop 0
moveRandomDirection_2:
math moveloop add 1
if $north then
{
gosub MOVE north
return
}
if $northwest then
{
gosub MOVE northwest
return
}
if $northeast then
{
gosub MOVE northeast
return
}
if $southeast then
{
gosub MOVE southeast
return
}
if $south then
{
gosub MOVE south
return
}
if $west then
{
gosub MOVE west
return
}
if $east then
{
gosub MOVE east
return
}
if $southwest then
{
gosub MOVE southwest
return
}
if $out then
{
gosub MOVE out
return
}
if $up then
{
gosub MOVE up
return
}
if $down then
{
gosub MOVE down
return
}
if matchre("$roomname","Temple Hill Manor, Grounds") then
{
gosub MOVE go gate
return
}
if matchre("$roomobjs","\b(arch|door|gate|hole|hatch|trapdoor|path|animal trail)\b") then
{
gosub MOVE go $1
return
}
if matchre("$roomobjs","thick fog") || matchre("$roomexits","thick fog") then
{
gosub RANDOMMOVE
return
}
echo *** No random direction possible?? Looking to attempt to reset room exit vars
send search
pause 0.4
pause 0.2
#might need a counter here to prevent infinite loops
put look
pause 0.5
pause 0.2
if (%moveloop > 4) then
{
echo *** Cannot find a room exit!! Stupid fog!
echo *** ATTEMPTING RANDOM DIRECTIONS...
gosub RANDOMMOVE
return
}
goto moveRandomDirection_2
RANDOMMOVE:
random 1 13
if (%r = 1) && ($north) then gosub MOVE n
if (%r = 2) && ($northeast) then gosub MOVE ne
if (%r = 3) && ($east) then gosub MOVE e
if (%r = 4) && ($northwest) then gosub MOVE nw
if (%r = 5) && ($southeast) then gosub MOVE se
if (%r = 6) && ($south) then gosub MOVE s
if (%r = 7) && ($southwest) then gosub MOVE sw
if (%r = 8) && ($west) then gosub MOVE w
if (%r = 9) && ($out) then gosub MOVE out
if (%r = 10) && matchre("$roomobjs","\bdoor\b") then gosub MOVE go door
if (%r = 11) && matchre("$roomobjs","\bgate\b") then gosub MOVE go gate
if (%r = 12) && matchre("$roomobjs","\barch\b") then gosub MOVE go arch
if (%r = 13) && matchre("$roomobjs","\bportal\b") then gosub MOVE go port
# if $roomid == 0 then goto moveRandomDirection_2
return