Skip to content

Commit

Permalink
learned - revert prior change, also display 0 exp skills
Browse files Browse the repository at this point in the history
  • Loading branch information
mikejcook committed May 26, 2024
1 parent 4048cfb commit 0539eac
Showing 1 changed file with 6 additions and 21 deletions.
27 changes: 6 additions & 21 deletions learned.lic
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,10 @@ 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 @@ -78,25 +76,12 @@ class LearnedData
learning_time = ((Time.now - DRSkill.start_time) / 60.0 / 60)
columns = get_settings.learned_column_count

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
DRSkill.list
.select { |item| @skills_to_show.include?(item.name) }
.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

total = DRSkill.list
Expand Down

0 comments on commit 0539eac

Please sign in to comment.