-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathselfrepair.cmd
More file actions
110 lines (88 loc) · 1.97 KB
/
selfrepair.cmd
File metadata and controls
110 lines (88 loc) · 1.97 KB
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
# Self repair crafting tools
debug 5
var container $primary.container
var forging.hammer $forging.hammer
var has_craft_belt NO
var belt
var target %1
gosub %target
goto done
all:
gosub stamp
gosub outfit
gosub shaping
gosub engine
gosub forge
return
stamp:
gosub repair.all stamp
return
outfit:
var tools needles|scissors|slickstone|yardstick|hide scraper|awl
var belt outfit belt
var has_craft_belt YES
gosub repair.all %tools
return
shaping:
var tools carving knife|shaper|rasp|drawknife|clamps|slender saw
var belt carp belt
var has_craft_belt YES
gosub repair.all %tools
return
engine:
var tools chisels|rifflers|rasp|fine saw|pliers
var belt engine belt
var has_craft_belt YES
gosub repair.all %tools
return
forge:
var tools %forging.hammer|tongs|bellows|shovel|rod
var belt forger belt
var has_craft_belt YES
gosub repair.all %tools
return
repair.all:
var list $0
var list_count 0
eval list_max countsplit("%list","|")
if %list_max = 0 then var list_max 1
repair.loop:
if %list_count < %list_max then {
gosub repair %list(%list_count)
math list_count add 1
goto repair.loop
}
gosub tie.all %list
return
repair:
put .metal_repair $0
waitforre ^REPAIR DONE
return
tie.all:
var list $0
var list_count 0
eval list_max countsplit("%list","|")
tie.loop:
if %list_count < %list_max then {
gosub tie %list(%list_count)
math list_count add 1
goto tie.loop
}
return
tie:
var item $0
send get my %item
pause 0.5
matchre RETURN You attach|You put|Tie what
matchre tie.tool.2 doesn't seem to fit
if "%has_craft_belt" = "YES" then put tie my %item to my %belt
else put put my %item in my %container
matchwait 2
goto tie.tool.2
tie.tool.2:
put put my %item in my %container
return
RETURN:
return
done:
put #parse SELF-REPAIR DONE