forked from elanthia-online/dr-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappraisal.lic
170 lines (150 loc) · 5.92 KB
/
appraisal.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
=begin
Documentation: https://elanthipedia.play.net/Lich_script_repository#appraisal
=end
custom_require.call(%w[common common-travel drinfomon equipmanager])
class Appraisal
include DRC
include DRCT
def initialize
arg_definitions = [
[
{ name: 'focus', regex: /focus/i, description: 'Perform appraise focus on an item.' },
{ name: 'item', regex: /\w+/i, description: 'Item to use appraise focus with.' }
],
[]
]
args = parse_args(arg_definitions)
@equipment_manager = EquipmentManager.new
settings = get_settings
train_list = settings.appraisal_training
if args.focus
if DRSkill.getrank('Appraisal') < 200
echo 'You need at least 200 Appraisal to use Appraise Focus.'
exit
end
appraise_focus(args.item)
else
train_list.each do |task|
break if DRSkill.getxp('Appraisal') >= 30
case task
when 'zills'
assess_zills
when 'pouches'
train_appraisal_with_pouches(settings.full_pouch_container, settings.gem_pouch_adjective, settings.gem_pouch_noun)
when 'gear'
train_appraisal_with_gear
when 'bundle'
train_appraisal_with_bundle
when 'art'
train_appraisal_with_art
else
echo "#{task} is not a valid appraisal_training setting"
end
end
end
end
def train_appraisal_with_art
wait_for_script_to_complete('study-art', ['appraisal'])
end
def train_appraisal_with_gear
@equipment_manager.wear_equipment_set?('standard')
@equipment_manager.items.each { |item| break unless appraise_item?(item) }
end
def train_appraisal_with_bundle
bput('appraise my bundle quick', 'Roundtime', 'Appraise what', 'You cannot appraise')
waitrt?
end
def train_appraisal_with_pouches(full_pouch_container, gem_pouch_adjective, gem_pouch_noun)
if gem_pouch_adjective
case bput("appraise my #{gem_pouch_adjective} #{gem_pouch_noun} quick", 'Roundtime', 'You can.t appraise the', 'Appraise what', /You.ll need to open the .* to examine its contents./)
when /You.ll need to open the .* to examine its contents./
bput("open my #{gem_pouch_adjective} #{gem_pouch_noun}", /You open your .*./, /That is already open/)
bput("appraise my #{gem_pouch_adjective} #{gem_pouch_noun} quick", 'Roundtime', 'You can.t appraise the', 'Appraise what')
bput("close my #{gem_pouch_adjective} #{gem_pouch_noun}", /You close your/, /That is already closed/)
end
waitrt?
end
pause 1
$ORDINALS.each do |ordinal|
case bput("get #{ordinal} #{gem_pouch_adjective} #{gem_pouch_noun} from my #{full_pouch_container}", '^You get ', '^What were you referring')
when /^You get /
case bput("appraise my #{gem_pouch_adjective} #{gem_pouch_noun} quick", 'Roundtime', /You.ll need to open the .* to examine its contents./)
when /You.ll need to open the .* to examine its contents./
bput("open my #{gem_pouch_adjective} #{gem_pouch_noun}", /You open your .* ./, /That is already open/)
bput("appraise my #{gem_pouch_adjective} #{gem_pouch_noun} quick", 'Roundtime')
bput("close my #{gem_pouch_adjective} #{gem_pouch_noun}", /You close your/, /That is already closed/)
end
waitrt?
bput("put my #{gem_pouch_adjective} #{gem_pouch_noun} in my #{full_pouch_container}", 'You put')
pause 1
else
break
end
break if DRSkill.getxp('Appraisal') >= 30
end
end
def appraise_item?(item)
@equipment_manager.get_item?(item)
bput("appraise #{item.short_name} quick", 'Roundtime')
waitrt?
pause 1
@equipment_manager.empty_hands
DRSkill.getxp('Appraisal') < 30
end
def assess_zills
if DRSkill.getrank('Appraisal') >= 250
echo "Your appraisal skill is above 250. You can remove 'zills' from appraisal_training"
return
end
case bput('remove my zill', 'You slide', 'Remove what')
when 'Remove what'
return
end
bput('assess my zill', 'you carefully look them over')
waitrt?
bput('wear my zill', 'You slide')
pause 1
end
def appraise_focus(item)
focus_concepts = ["defense", "arcane", "recall", "logic", "offense", "magic", "khri", "inner fire"]
if focus_concepts.include?(item)
focus_concept(item)
else
case bput("get my #{item}", "^You get.*#{item}", '^What were you referring', 'But that is already', 'You are already')
when 'But that is already', '^What were you referring'
echo "Cannot get the #{item} you are trying to focus upon. Exiting..."
exit
end
focus(item)
end
waitrt?
case bput('appraise focus check', 'You are currently', 'You have completed')
when 'You are currently'
waitfor('Breakthrough')
echo "You have completed focusing on your #{item} and now have increased learning!"
when 'You have completed'
echo 'You already have an active appraise focus boost. Wait a while before trying again.'
end
exit
end
def focus_concept(item)
waitrt?
case bput("appraise focus #{item}", 'You carefully', 'You are already', 'You currently feel', 'You can\'t seem', 'You cant seem', 'You will lose your progress')
when 'You carefully', 'You are already', 'You currently feel', 'You can\'t seem', 'You cant seem'
return
else
focus_concept(item)
end
end
def focus(item)
waitrt?
case bput("appraise focus my #{item}", 'You carefully', 'You are already', 'You currently feel', 'You can\'t seem', 'You cant seem', 'You will lose your progress')
when 'You carefully', 'You are already', 'You currently feel', 'You can\'t seem', 'You cant seem'
bput("stow my #{item}", "You put .*#{item}", 'You easily strap', "You don't seem to be able to move", 'You secure', 'is too small to hold that', 'You hang')
else
focus(item)
end
end
end
# Call this last to avoid the need for forward declarations
Appraisal.new