forked from elanthia-online/dr-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshape.lic
152 lines (136 loc) · 5.06 KB
/
shape.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
Documentation: https://elanthipedia.play.net/Lich_script_repository#shape
=end
custom_require.call(%w(common common-crafting))
class Shape
include DRC
include DRCC
def initialize
settings = get_settings
@bag = settings.crafting_container
@bag_items = settings.crafting_items_in_container
@belt = settings.engineering_belt
arg_definitions = [
[
{ name: 'chapter', regex: /\d+/i, variable: true, description: 'Chapter containing the item.' },
{ name: 'recipe_name', display: 'recipe name', regex: /^[A-z\s\-]+$/i, variable: true, description: 'Name of the recipe, wrap in double quotes if this is multiple words.' },
{ name: 'material', regex: /\w+/i, variable: true, description: 'Type of material.' },
{ name: 'noun', regex: /\w+/i, variable: true }
],
[
{ name: 'continue', regex: /continue/i, variable: true },
{ name: 'noun', regex: /\w+/i, variable: true }
]
]
args = parse_args(arg_definitions)
@chapter = args.chapter
@recipe_name = args.recipe_name
@material = args.material
@noun = args.noun
Flags.add('shaping-assembly', 'You need another bone, wood or horn (backing) material', 'another finished bow (string)', 'another finished (long|short) wooden (pole)', 'another .* leather (strip)')
if args.continue
shape("analyze my #{@noun}")
else
shape_item
end
end
def get_item(name)
get_crafting_item(name, @bag, @belt, @belt)
end
def stow_item(name)
stow_crafting_item(name, @bag, @belt)
end
def turn_to(section)
bput("turn my book to #{section}", 'You turn your', 'The book is already')
end
def shape_item
get_item('shaping book')
turn_to("page #{find_recipe(@chapter, @recipe_name)}")
bput('study my book', 'Roundtime')
stow_item('book')
get_item('drawknife')
get_item("#{@material} lumber")
shape('scrape my lumber with my drawknife')
end
def assemble_part
return unless Flags['shaping-assembly']
tool = right_hand
stow_item(tool)
part = Flags['shaping-assembly'][1..-1].join('.')
part = 'backer' if part == 'backing'
Flags.reset('shaping-assembly')
get_item(part)
bput("assemble my #{@noun} with my #{part}", 'affix it securely in place', 'loop both ends', 'loop the string', 'carefully mark where it will attach when you continue crafting', 'add several marks indicating optimal locations')
if part == 'long.pole' || part == 'short.pole'
3.times do
get_item(part)
bput("assemble my #{@noun} with my #{part}", 'affix it securely in place', 'loop both ends', 'loop the string', 'carefully mark where it will attach when you continue crafting', 'add several marks indicating optimal locations')
end
end
get_item(tool)
end
def shape(command)
waitrt?
assemble_part
case bput(command,
'a wood shaper is needed', 'ready for shaping with a wood shaper',
'carved with a carving knife', 'further carving with a knife', 'continued knife carving',
'rubbed out with a rasp', 'A cluster of small knots',
'Applying the final touches',
'That tool does not seem suitable for that task.',
'while it is inside of something',
'Glue should now be applied', 'glue to fasten it',
'ready to be clamped', 'pushed with clamps', 'pushing it with clamps',
'Some wood stain',
'You fumble around but',
'ASSEMBLE Ingredient1')
when 'a wood shaper is needed', 'ready for shaping with a wood shaper'
waitrt?
stow_item(right_hand)
get_item('shaper')
command = "shape my #{@noun} with my shaper"
when 'carved with a carving knife', 'further carving with a knife', 'continued knife carving'
waitrt?
stow_item(right_hand)
get_item('carving knife')
command = "carve my #{@noun} with my knife"
when 'rubbed out with a rasp', 'A cluster of small knots'
waitrt?
stow_item(right_hand)
get_item('rasp')
command = "rub my #{@noun} with my rasp"
when 'ready to be clamped', 'pushed with clamps', 'pushing it with clamps'
waitrt?
stow_item(right_hand)
get_item('clamp')
command = "push my #{@noun} with my clamp"
when 'Glue should now be applied', 'glue to fasten it'
waitrt?
stow_item(right_hand)
get_item('glue')
command = "apply glue to my #{@noun}"
when 'Some wood stain'
waitrt?
stow_item(right_hand)
get_item('stain')
command = "apply stain to my #{@noun}"
when 'Applying the final touches'
finish
when 'while it is inside of something', 'You fumble around but'
echo '*** ERROR TRYING TO CRAFT, EXITING ***'
stow_item(right_hand)
exit
when 'That tool does not seem suitable for that task.'
shape("analyze my #{@noun}")
end
shape(command)
end
def finish
waitrt?
stow_item(right_hand)
fput("get my #{@material} lumber")
fput("put my #{@material} lumber in my #{@bag}")
exit
end
end
Shape.new