From e16a3691cabec03789dc70f3b603836c13d5a68c Mon Sep 17 00:00:00 2001 From: MahtraDR <93822896+MahtraDR@users.noreply.github.com> Date: Sat, 17 Feb 2024 18:29:34 +1300 Subject: [PATCH 1/2] [scripts][almanac] Expand pick-a-nack functionality Introduces a feature whereby if neither priority, nor almanac skills are under 18 mindstates, it'll train lowest mindstate skill overall. Takes into account the various magic types too. --- almanac.lic | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/almanac.lic b/almanac.lic index 4a818b8f0a..1779e842e2 100644 --- a/almanac.lic +++ b/almanac.lic @@ -33,9 +33,21 @@ 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" } + # .reject { |_skill, exp| exp.to_i > 18 } + .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 From 0e475bb99832860a13581de635c0c29d1e9bf491 Mon Sep 17 00:00:00 2001 From: MahtraDR <93822896+MahtraDR@users.noreply.github.com> Date: Sat, 17 Feb 2024 18:42:29 +1300 Subject: [PATCH 2/2] Update almanac.lic --- almanac.lic | 1 - 1 file changed, 1 deletion(-) diff --git a/almanac.lic b/almanac.lic index 1779e842e2..965670ef33 100644 --- a/almanac.lic +++ b/almanac.lic @@ -39,7 +39,6 @@ class Almanac .map { |skill| [skill.name, skill.exp] } .select { |element| element[1] } .reject { |skill, _exp| skill == "Mechanical Lore" } - # .reject { |_skill, exp| exp.to_i > 18 } .select { |skill, exp| list.append [skill, exp] } skill = list.sort_by(&:last).first[0].sub(/(Lunar|Life|Arcane|Holy|Elemental)\s/, '') return skill