forked from rpherbig/dr-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fir.lic
175 lines (152 loc) · 4.22 KB
/
fir.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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# Documentation: https://elanthipedia.play.net/Lich_script_repository#fir
custom_require.call(%w[common common-crafting common-items common-money common-travel drinfomon equipmanager])
class FirQuest
include DRC
include DRCI
include DRCM
include DRCT
include DRCC
def initialize
arg_definitions = [
[
{ name: 'number', regex: /\d+/, description: 'Number of Fir Familiars to make (1-3)' }
]
]
args = parse_args(arg_definitions)
EquipmentManager.new.empty_hands
@settings = get_settings
@bag = @settings.crafting_container
@bag_items = @settings.crafting_items_in_container
@belt = @settings.engineering_belt
if args.number
if args.number.to_i > 3
echo '****Cannot get more than 3 at a time!****'
exit
else
num = args.number.to_i
end
else
num = 1
end
check_carving_knife
get_holy_water
get_fir_bark(num)
goto_shard_temple
unless goto_old_man
open_wall
goto_old_man
end
get_talisman(num)
move 'out'
walk_to 2807
carve_talisman(num)
end
def open_wall
bput('put right hand in first hole', 'You have passed the test of lore')
bput('get fir bark', 'you get')
bput('put left hand in second hole', 'You have passed the test of the tree')
bput('stow right', 'You put')
bput('get my silver vial', 'You get')
bput('get water from vial', 'You get some holy water')
bput('stow vial', 'You put')
bput('put right hand in third hole', 'A foreboding wall moves out of your way to allow passage!')
bput('get my silver vial', 'You get')
bput('put water in my vial', 'You put')
bput('stow vial', 'You put')
end
def goto_old_man
return false if ['A voice whispers in your head', "You can't"].include? bput('west', 'A voice whispers in your head', "You can't", 'Obvious exits')
move 'go stairs'
true
end
def carve_talisman(number)
number.times do
case bput('get fir talisman', 'You get', 'What were you referring to?')
when 'What were you referring to?'
echo 'No more talismans!'
exit
when 'You get'
bput('rub my fir talisman', 'You rub')
get_crafting_item('carving knife', @bag, @belt, @belt)
bput('swap', 'You move')
carve
stow_crafting_item('carving knife', @bag, @belt)
bput('stow talisman', 'You put')
end
end
end
def carve
case bput('carve my talisman', 'fine details', 'Roundtime', 'Round time')
when /fine details/
nil
else
carve
end
end
def get_talisman(number)
number.times do
break if bput('get fir bark', 'You get', 'I could not find') == 'I could not find'
bput('give man', 'The old man takes your bark')
bput('stow right', 'You put')
end
end
def check_carving_knife
return if exists?('carving knife')
echo '**** You need a carving knife! ****'
beep
exit
end
def get_holy_water
return if exists?('silver vial')
if DRSkill.getrank('Thievery') >= 231
walk_to 19_073
bput('steal silver vial in catalog', 'Roundtime')
else
temp_settings = @settings
temp_settings.hometown = 'Crossing'
unless ensure_copper_on_hand(500, temp_settings)
echo '***STATUS*** Insufficient funds to buy silver vial'
beep
exit
end
buy_item(19_073, 'silver vial')
end
walk_to 5779
bput('fill my vial with water from basin', 'You fill your silver vial with some water.')
bput('stow my silver vial', 'You put')
end
def get_fir_bark(number)
return if exists?('fir bark')
walk_to 989
number.times do |_x|
bput('pull tree', 'releasing a small precious piece', 'You should try again later.')
bput('stow fir bark', 'You put')
end
end
def goto_shard_temple
walk_to 2807
# walk_to 2895
move 'north'
move 'north'
move 'north'
move 'north'
move 'north'
move 'northeast'
move 'northwest'
move 'northwest'
move 'north'
move 'north'
move 'east'
move 'east'
move 'northeast'
move 'east'
move 'east'
move 'climb stile'
move 'east'
move 'south'
move 'south'
move 'west'
move 'west'
end
end
FirQuest.new