Skip to content

Commit

Permalink
Merge pull request #6769 from MahtraDR/almanac_lowest_mindstate
Browse files Browse the repository at this point in the history
[scripts][almanac] Expand pick-a-nack functionality
  • Loading branch information
MahtraDR authored Feb 17, 2024
2 parents d375263 + 0e475bb commit 1a77d06
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion almanac.lic
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,20 @@ class Almanac
.min_by { |skill| [DRSkill.getxp(skill), DRSkill.getrank(skill)] }
end

def skill_with_lowest_mindstate
list = []
DRSkill.list
.map { |skill| [skill.name, skill.exp] }
.select { |element| element[1] }
.reject { |skill, _exp| skill == "Mechanical Lore" }
.select { |skill, exp| list.append [skill, exp] }
skill = list.sort_by(&:last).first[0].sub(/(Lunar|Life|Arcane|Holy|Elemental)\s/, '')
return skill
end

def use_almanac
unless @almanac_skills.empty?
training_skill = almanac_sort_by_rate_then_rank(@priority_skills) || almanac_sort_by_rate_then_rank(@almanac_skills)
training_skill = almanac_sort_by_rate_then_rank(@priority_skills) || almanac_sort_by_rate_then_rank(@almanac_skills) || skill_with_lowest_mindstate
echo("training skill is #{training_skill}")
return unless training_skill
end
Expand Down

0 comments on commit 1a77d06

Please sign in to comment.