Skip to content

Conversation

@BaldPRs
Copy link
Contributor

@BaldPRs BaldPRs commented Dec 23, 2025

Fix early exit if not in FindSkillInfo

Problem

Currently TRSStats.FindSkillInfo attempts to perform string comparison of the passed ERSSkill against the first line of lines. ToStr(skill).Capitalize() turns into Ersskill.crafting but lines[0] is something along the lines of: Crafting XP: 1,337,420

Solution

By modifying this if statement to strip off Ersskill it properly evaluates lines[0] against the desired skill.

Testing

Code testing with the following snippet and corresponding debug output

Test Snippet

{$I WaspLib/osrs.simba}
begin
  WriteLn(""); 
  WriteLn("CRAFTING: ", Stats.GetSkillInfo(ERSSkill.CRAFTING));
  WriteLn("HERBLORE: ", Stats.GetSkillInfo(ERSSkill.HERBLORE));
  WriteLn("MAGIC: ", Stats.GetSkillInfo(ERSSkill.MAGIC));
  WriteLn("AGILITY: ", Stats.GetSkillInfo(ERSSkill.AGILITY));
end. 

Debug Before

CRAFTING: {LEVEL = 0, XP = 0, NEXT = 0, REMAINDER = 0}
HERBLORE: {LEVEL = 0, XP = 0, NEXT = 0, REMAINDER = 0}
MAGIC: {LEVEL = 0, XP = 0, NEXT = 0, REMAINDER = 0}
AGILITY: {LEVEL = 0, XP = 0, NEXT = 0, REMAINDER = 0} 

Debug After

CRAFTING: {LEVEL = 69, XP = 1111111, NEXT = 1111111, REMAINDER = 696969}
HERBLORE: {LEVEL = 69, XP = 1111111, NEXT = 1111111, REMAINDER = 696969}
MAGIC: {LEVEL = 69, XP = 1111111, NEXT = 1111111, REMAINDER = 696969}
AGILITY: {LEVEL = 69, XP = 1111111, NEXT = 1111111, REMAINDER = 696969}     

@Torwent Torwent merged commit 1f18f0e into WaspScripts:main Dec 23, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants