forked from elanthia-online/dr-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
first-aid.lic
66 lines (57 loc) · 1.93 KB
/
first-aid.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
=begin
Documentation: https://elanthipedia.play.net/Lich_script_repository#first-aid
=end
custom_require.call(%w(common common-travel drinfomon equipmanager))
class FirstAid
include DRC
include DRCT
def initialize
settings = get_settings
@chart_data = get_data('anatomy-charts').first_aid_charts
if settings.bleed_bot
walk_to(settings.bleed_bot_room)
start_script('tendother', [settings.bleed_bot])
pause 10
stop_script('tendother')
return
end
if settings.textbook
@booktype = settings.textbook_type
textbook_charts
else
@booktype = 'compendium'
compendium_charts
end
EquipmentManager.new.empty_hands
end
def compendium_charts
bput('get my compendium', 'You get')
bput('look my compendium', '^The compendium lies open to the section on .* physiology')
pause
compendium_charts = reget(40).grep(/^ .+$/).map(&:strip)
charts_to_read = @chart_data.select { |name, _info| compendium_charts.include?(name) }
study_charts(charts_to_read)
end
def textbook_charts
bput("get my #{@booktype}", 'You get')
study_charts(@chart_data)
end
def study_charts(charts_to_read)
charts_to_read
.map { |_name, info| info }
.select { |info| info['scholarship'] <= DRSkill.getrank('Scholarship') }
.sort_by { |info| info['scholarship'] }
.reverse
.take(20)
.each do |info|
case bput("turn my #{@booktype} to #{info['index']}", 'You turn', 'That section does not exist', 'Turn what?')
when 'You turn'
bput("study my #{@booktype}", 'you begin to study', 'you begin studying', 'With a sudden moment of', 'In a sudden moment of clarity', '^Why ', 'you continue to study', 'you attempt', 'you continue studying')
waitrt?
break if DRSkill.getxp('First Aid') >= 30
end
end
end
end
# Call this last to avoid the need for forward declarations
FirstAid.new