-
Notifications
You must be signed in to change notification settings - Fork 177
/
faskinner.lic
103 lines (88 loc) · 3.66 KB
/
faskinner.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
=begin
Elanthipedia: https://elanthipedia.play.net/Lich_script_repository#faskinner
# trainer noun should match exactly
fa_skinning_trainer: crocodile
# Options: First Aid, Skinning, Both or leave blank for whichever happens first
fa_skinning_priority: Skinning
=end
custom_require.call(%w[common events drinfomon equipmanager common-arcana])
class FaSkinner
def initialize
@settings = get_settings
@training_spells = @settings.crafting_training_spells
@priority = @settings.fa_skinning_priority
@trainer = @settings.fa_skinning_trainer
@trainer_container = @settings.fa_skinning_trainer_container
@knife = @settings.fa_skinning_knife
@knife_container = @settings.fa_skinning_knife_container
@target_mindstate = @settings.fa_skinning_mindstate_target
EquipmentManager.new.empty_hands
get_item(@trainer, @trainer_container) if @trainer
get_item(@knife, @knife_container) if @knife
if @priority == 'First Aid' && DRSkill.getxp('First Aid') < @target_mindstate
until DRSkill.getxp('First Aid') >= @target_mindstate
train_skills
end
echo("Exiting because First Aid locked!")
elsif @priority == 'Skinning' && DRSkill.getxp('Skinning') < @target_mindstate
until DRSkill.getxp('Skinning') >= @target_mindstate
train_skills
end
echo("Exiting because Skinning target reached!")
elsif @priority == 'Both' || @priority == 'both'
until DRSkill.getxp('First Aid') >= @target_mindstate && DRSkill.getxp('Skinning') >= @target_mindstate
train_skills
end
echo("Exiting because First Aid AND Skinning target reached!")
else
until DRSkill.getxp('First Aid') >= @target_mindstate || DRSkill.getxp('Skinning') >= @target_mindstate
train_skills
end
echo("Exiting because First Aid OR Skinning target reached!")
end
do_exit
end
def do_exit
DRCI.put_away_item?(@trainer, @trainer_container) if @trainer
DRCI.put_away_item?(@knife, @knife_container) if @knife
magic_cleanup
exit
end
def train_skills
DRCA.crafting_magic_routine(@settings)
case DRC.bput("skin my #{@trainer}", 'You skillfully', 'A small blue-belly crocodile with prominently', 'You must be holding', 'The leather looks frayed', 'A small fuzzy caracal with tufted ears', 'need to have a bladed instrument')
when /You must be holding/
get_item(@trainer, @trainer_container)
when /The leather looks frayed/
DRC.message("No Charges! Try again later.")
do_exit
when /need to have a bladed instrument/
DRC.message("You need to either wear a skinning knife or hold a bladed weapon")
do_exit
end
DRCA.crafting_magic_routine(@settings)
case DRC.bput("repair my #{@trainer}", 'With some needle and thread', 'A small blue-belly crocodile with prominently', 'You must be holding', 'The leather looks frayed', 'A small fuzzy caracal with tufted ears')
when /You must be holding/
get_item(@trainer, @trainer_container)
when /The leather looks frayed/
DRC.message("No Charges! Try again later.")
do_exit
end
end
def magic_cleanup
return if @training_spells.empty?
DRC.bput('release spell', 'You let your concentration lapse', "You aren't preparing a spell")
DRC.bput('release mana', 'You release all', "You aren't harnessing any mana")
# Do not release symbiosis as it may release the symbiosis research instead of a prepared symbioisis cast.
end
def get_item(item, container = nil)
unless DRCI.get_item_if_not_held?(item, container)
DRC.message("Could not get '#{item}'!")
do_exit
end
end
end
before_dying do
EquipmentManager.new.empty_hands
end
FaSkinner.new