-
Notifications
You must be signed in to change notification settings - Fork 178
/
clean-lumber.lic
73 lines (65 loc) · 2.19 KB
/
clean-lumber.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
=begin
Documentation: https://elanthipedia.play.net/Lich_script_repository#clean-leather
=end
custom_require.call(%w[common common-crafting])
class CleanLumber
def initialize
arg_definitions = [
[
{ name: 'type', regex: /\w+/, description: 'wood type to process' },
{ name: 'source', regex: /\w+/, description: 'container' },
{ name: 'storage', regex: /\w+/, description: 'container to put lumber in' }
]
]
args = parse_args(arg_definitions)
settings = get_settings
@bag = settings.crafting_container
@bag_items = settings.crafting_items_in_container
@belt = settings.engineering_belt
%w[stick log branch limb deed].each { |size| process_size(args, size) }
end
def process_size(args, size)
while DRC.bput("get #{args.type} #{size} from my #{args.source}", 'You get', 'You carefully remove', 'What were you') != 'What were you'
if size == 'deed'
was_deed = true
fput('tap my deed')
pause
until DRC.right_hand
fput('swap')
pause
end
size = DRC.right_hand.split.last
end
unless DRCC.get_crafting_item('saw', @bag, @bag_items, @belt) != /woodcutting saw|wood saw/
DRCC.stow_crafting_item('saw', @bag, @belt)
case DRC.bput("get saw from #{@bag}", 'You get', 'What were')
when /What were/
echo('No saw found')
exit
end
end
until DRC.bput("cut #{size} with my saw", 'roundtime', 'you complete', 'ready to be carved') =~ /you complete|ready to be carved/
waitrt?
end
pause
waitrt?
DRCC.stow_crafting_item('saw', @bag, @belt)
DRCC.get_crafting_item('drawknife', @bag, @bag_items, @belt)
until DRC.bput("scrape #{size} with my drawknife", 'roundtime', 'work completes') == 'work completes'
waitrt?
end
pause
waitrt?
DRCC.stow_crafting_item('drawknife', @bag, @belt)
fput("get #{args.type} lumber from my #{args.storage}")
fput('combine')
if args.storage
fput("put my lumber in my #{args.storage}")
else
fput('stow lumber')
end
size = 'deed' if was_deed
end
end
end
CleanLumber.new