# Stats Methods responsible for dealing with the stats tab. - - - ## ERSSkill ```pascal ERSSkill = (ATTACK, HITPOINTS, MINING, STRENGTH, AGILITY, SMITHING, DEFENCE, HERBLORE, FISHING, RANGE, THIEVING, COOKING, PRAYER, CRAFTING, FIREMAKING, MAGIC, FLETCHING, WOODCUTTING, RUNECRAFTING, SLAYER, FARMING, CONSTRUCTION, HUNTER, TOTAL); ``` - - - ## Stats.Setup() ```pascal procedure TRSStats.Setup(); override; ``` Internal method automatically called by SRL.Setup() - - - ## Stats.SetupAlignment() ```pascal procedure TRSStats.SetupAlignment(Mode: ERSClientMode); override; ``` Internal method automatically called by RSClient.ClientModeChanged() - - - ## Stats.GetSkillBoxes ```pascal function TRSStats.GetSkillBoxes(): TBoxArray; ``` Internal method used to retrieve the skill boxes. Example: ```pascal Debug(Stats.GetSkillBoxes()); ``` - - - ## Stats.GetSkillBox ```pascal function TRSStats.GetSkillBox(skill: ERSSkill): TBox; ``` Method used to retrieve a skill box. Example: ```pascal Debug(Stats.GetSkillBox(ERSSkill.AGILITY)); ``` - - - ## Stats.IsOpen ```pascal function TRSStats.IsOpen(): Boolean; ``` Returns true/false if the gametab is open or not. Example: ```pascal WriteLn Stats.IsOpen(); ``` - - - ## Stats.Open ```pascal function TRSStats.Open(): Boolean; ``` Attempts to open the gametab. Example: ```pascal WriteLn Stats.Open(); ``` - - - ## Stats.MouseOver ```pascal function TRSStats.MouseOver(skill: ERSSkill): Boolean; ``` Moves the mouse over to a skill box. Example: ```pascal WriteLn Stats.MouseOver(ERSSkill.CONSTRUCTION); ``` - - - ## Stats.GetSkillInfo ```pascal function TRSStats.GetSkillInfo(skill: ERSSkill; waitTime: Int32 = 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): Int32; ``` 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.CacheAll ```pascal procedure TRSStats.CacheAll(); ``` 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); ``` - - - ## Chat.LeveledUp() override ```pascal function TRSChat.LeveledUp(): Boolean; override; ``` Returns true if we have the level up message on the chat box and attempts to update Stats.Levels Example: ```pascal if Chat.LeveledUp() then Chat.ClickContinue(True); ```