forked from elanthia-online/dr-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
discern.lic
42 lines (31 loc) · 1006 Bytes
/
discern.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
=begin
Documentation: https://elanthipedia.play.net/Lich_script_repository#discern
=end
custom_require.call(%w[common-arcana])
class Discern
def initialize
arg_definitions = [
[
{ name: 'reset', regex: /^reset$/i, optional: true, description: 'Delete existing discern data and re-discern spells.' },
]
]
args = parse_args(arg_definitions)
UserVars.discerns = {} if args.reset
settings = get_settings
spells = []
spells << settings.offensive_spells
spells << settings.buff_spells.values
spells << settings.combat_spell_training.values
spells << settings.training_spells.values
spells << settings.crafting_training_spells.values
spells << settings.waggle_sets.values.map(&:values)
spells.flatten!
discern_spells(spells, settings)
end
def discern_spells(spells, settings)
spells
.select { |spell| spell['use_auto_mana'] }
.each { |spell| DRCA.check_discern(spell, settings) }
end
end
Discern.new