forked from elanthia-online/dr-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathattunement.lic
More file actions
44 lines (37 loc) · 1.29 KB
/
attunement.lic
File metadata and controls
44 lines (37 loc) · 1.29 KB
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
=begin
Documentation: https://elanthipedia.play.net/Lich_script_repository#attunement
=end
custom_require.call(%w[common common-arcana common-travel drinfomon])
class Attunement
include DRC
include DRCA
include DRCT
def initialize
settings = get_settings
@stationary_skills_only = settings.crossing_training_stationary_skills_only
@hometown = settings.hometown
@attunement_rooms = settings.attunement_rooms
cast_spells(settings.waggle_sets['attunement'], settings)
train_attunement
end
def train_attunement
command = DRStats.moon_mage? ? 'perc mana' : 'perc'
room_list = if @stationary_skills_only || DRStats.moon_mage?
[Room.current.id]
elsif !@attunement_rooms.nil? && !@attunement_rooms.empty?
# TODO: Nil check isn't necessary after everyone has restarted dependency
@attunement_rooms
else
get_data('town')[@hometown]['attunement_rooms']
end
start_timer = Time.now
room_list.each do |room_id|
walk_to(room_id)
bput(command, 'You reach out')
waitrt?
break if DRSkill.getxp('Attunement') >= 30 || start_timer - Time.now > 90
end
end
end
# Call this last to avoid the need for forward declarations
Attunement.new