Skip to content

Commit

Permalink
[script] learned - add arg for skills with zero exp
Browse files Browse the repository at this point in the history
Added a new 'zero' argument to the learned script that I've found useful primarily when working with newer characters to ensure that all of the skills are moving
  • Loading branch information
mikejcook committed May 23, 2024
1 parent 4e12039 commit 4048cfb
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions learned.lic
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ class LearnedData
[{ name: 'lore', regex: /lore/, description: 'Show exp gained in lore skills.' }],
[{ name: 'guild', regex: /guild/, description: 'Show exp gained in your guild skill.' }],
[{ name: 'reset', regex: /reset/, description: 'Reset learned experience' }],
[{ name: 'zero', regex: /zero/, description: 'Show only skills with nothing learned' }],
[]
]

args = parse_args(arg_definitions)
@zero = args.zero ? true : false

survival_skills = ['Evasion', 'Athletics', 'Perception', 'Stealth', 'Locksmithing', 'Thievery', 'First Aid', 'Outdoorsmanship', 'Skinning']
lore_skills = ['Alchemy', 'Appraisal', 'Enchanting', 'Forging', 'Mechanical Lore', 'Performance', 'Scholarship', 'Tactics', 'Outfitting', 'Engineering']
Expand Down Expand Up @@ -76,13 +78,25 @@ class LearnedData
learning_time = ((Time.now - DRSkill.start_time) / 60.0 / 60)
columns = get_settings.learned_column_count

DRSkill.list
.select { |item| @skills_to_show.include?(item.name) }
.select { |item| item.current - item.baseline > 0 }
.sort_by { |item| item.current - item.baseline }
.reverse.each_slice(columns) do |skills|
output = skills.map { |skill| format_skill_data(skill, learning_time) }.join
respond(output)
if @zero
DRSkill.list
.select { |item| @skills_to_show.include?(item.name) }
.select { |item| item.current - item.baseline == 0 }
.sort_by { |item| item.current - item.baseline }
.reverse.each_slice(columns) do |skills|
output = skills.map { |skill| format_skill_data(skill, learning_time) }.join
respond(output)
end
exit
else
DRSkill.list
.select { |item| @skills_to_show.include?(item.name) }
.select { |item| item.current - item.baseline > 0 }
.sort_by { |item| item.current - item.baseline }
.reverse.each_slice(columns) do |skills|
output = skills.map { |skill| format_skill_data(skill, learning_time) }.join
respond(output)
end
end

total = DRSkill.list
Expand Down

0 comments on commit 4048cfb

Please sign in to comment.