# Stats Methods responsible for dealing with the stats tab. ```{figure} ../../images/stats.png ``` - - - ## ERSSkill ```pascal ERSSkill = enum( ATTACK, HITPOINTS, MINING, STRENGTH, AGILITY, SMITHING, DEFENCE, HERBLORE, FISHING, RANGED, THIEVING, COOKING, PRAYER, CRAFTING, FIREMAKING, MAGIC, FLETCHING, WOODCUTTING, RUNECRAFTING, SLAYER, FARMING, CONSTRUCTION, HUNTER, TOTAL ); ``` Enum representing all skills in oldschool runescape. - - - ## TRSSkillInfo Helper record to read skill information when you hover them in the {ref}`Stats` gametab. - - - ## TRSStats Main record used to interact with the {ref}`Stats` gametab. - - - ## Stats.SetupGameTab ```pascal procedure TRSStats.SetupGameTab(); ``` Internal method used to setup the {ref}`TRSStats` coordinates and internal values. This is automatically called for you on the {ref}`Stats variable`. - - - ## TRSStats.Skills ```pascal Skills: TBoxArray; ``` `TBoxes` for each of the {ref}`Stats` skills. Example: ```pascal ShowOnTarget(Stats.Skills); ``` ```{figure} ../../images/stats_skills.png ``` You can also access each skill box with an index or, more conveniently, with a {ref}`ERSSkill`. Example: ```pascal ShowOnTarget(Stats.Skills[ERSSkill.HERBLORE]); ``` ```{figure} ../../images/stats_skill.png ``` - - - ## Stats.IsOpen ```pascal function TRSStats.IsOpen(): Boolean; ``` Returns true/false if the stats gametab is open or not. Example: ```pascal WriteLn Stats.IsOpen(); ``` - - - ## Stats.Open ```pascal function TRSStats.Open(): Boolean; ``` Attempts to open the stats gametab. Example: ```pascal WriteLn Stats.Open(); ``` - - - ## Stats.Hover ```pascal function TRSStats.Hover(skill: ERSSkill): Boolean; ``` Moves the mouse over to a skill box. Example: ```pascal WriteLn Stats.Hover(ERSSkill.CONSTRUCTION); ``` - - - ## Stats.FindSkillInfo ```pascal function TRSStats.FindSkillInfo(skill: ERSSkill; out skillInfo: TRSSkillInfo): Boolean; ``` Find and return a TRSSkillInfo if it matches the one we are looking for. - - - ## Stats.GetSkillInfo ```pascal function TRSStats.GetSkillInfo(skill: ERSSkill; waitTime: Integer = 1000): TRSSkillInfo; ``` Get the skill information about a skill when you hover it. Example: ```pascal WriteLn Stats.GetSkillInfo(ERSSkill.CONSTRUCTION); ``` - - - ## Stats.GetLevel ```pascal function TRSStats.GetLevel(skill: ERSSkill; useCache: Boolean = True): Integer; ``` Get the level of the specified **skill**. By default uses the levels cached in the Stats.Levels array. When using the cached methods, it can be used to retrieve the level of a skill while the gametab is open assuming the level is already cached. Example: ```pascal WriteLn Stats.GetLevel(ERSSkill.HITPOINTS); ``` - - - ## Stats.CacheStats ```pascal procedure TRSStats.CacheStats(); ``` Method to update all cached levels. - - - ## Stats.IncrementCachedLevel ```pascal procedure TRSStats.IncrementCachedLevel(skill: ERSSkill); ``` Internal method to update cached levels. This is automatically called by Chat.LeveledUp(). Example: ```pascal WriteLn Stats.GetCurrentLevel(ERSSkill.PRAYER); Stats.IncrementLevel(ERSSkill.PRAYER); WriteLn Stats.GetCurrentLevel(ERSSkill.PRAYER); ``` - - - ## Stats variable Global {ref}`TRSStats` variable.