forked from elanthia-online/dr-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
clean-lumber.lic
87 lines (76 loc) · 2.28 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
=begin
Documentation: https://elanthipedia.play.net/Lich_script_repository#clean-leather
=end
custom_require.call(%w[common common-items common-crafting common-money common-travel drinfomon])
class CleanLumber
include DRC
include DRCC
include DRCI
include DRCM
include DRCT
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 get_item(name)
get_crafting_item(name, @bag, @bag_items, @belt)
end
def stow_item(name)
stow_crafting_item(name, @bag, @belt)
end
def process_size(args, size)
while 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 right_hand
fput('swap')
pause
end
size = right_hand.split.last
end
unless get_item('saw') != /woodcutting saw|wood saw/
stow_item('saw')
case bput("get saw from #{@bag}", 'You get', 'What were')
when /What were/
echo('No saw found')
exit
end
end
until bput("cut #{size} with my saw", 'roundtime', 'you complete', 'ready to be carved') =~ /you complete|ready to be carved/
waitrt?
end
pause
waitrt?
stow_item('saw')
get_item('drawknife')
until bput("scrape #{size} with my drawknife", 'roundtime', 'work completes') == 'work completes'
waitrt?
end
pause
waitrt?
stow_item('drawknife')
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