n3ss3s
2008-08-04 06:04:59
{*******************************************************************
Function GetMaxLevel(Skill: String): Integer;
By: n3ss3s
Description: Returns the max level of the skill Skill.
********************************************************************}
Function GetMaxLevel(Skill: String): Integer;
Var
Index: Integer;
Skills: TStringArray;
Begin
Skills := ['Attack', 'Defense', 'Strength', 'Hitpoints', 'Range', 'Prayer',
'Magic', 'Cooking', 'Woodcutting', 'Fletching', 'Fishing',
'Firemaking', 'Crafting', 'Smithing', 'Mining', 'Herblore',
'Agility', 'Thieving', 'Slayer', 'Farming', 'Runecrafting',
'Hunter', 'Construction', 'Summoning'];
If InStrArrEx(Capitalize(Skill), Skills, Index) Then
Result := SmartGetFieldArrayInt(0, MaxLevels, Index)
Else
Writeln('GetMaxLevel: INVALID SKILL');
End;
{*******************************************************************
Function GetCurrentLevel(Skill: String): Integer;
By: n3ss3s
Description: Returns the current level of the skill Skill.
********************************************************************}
Function GetCurrentLevel(Skill: String): Integer;
Var
Index: Integer;
Skills: TStringArray;
Begin
Skills := ['Attack', 'Defense', 'Strength', 'Hitpoints', 'Range', 'Prayer',
'Magic', 'Cooking', 'Woodcutting', 'Fletching', 'Fishing',
'Firemaking', 'Crafting', 'Smithing', 'Mining', 'Herblore',
'Agility', 'Thieving', 'Slayer', 'Farming', 'Runecrafting',
'Hunter', 'Construction', 'Summoning'];
If InStrArrEx(Capitalize(Skill), Skills, Index) Then
Result := SmartGetFieldInt(0, CurrentLevels, Index)
Else
Writeln('GetCurrentLevel: INVALID SKILL');
End;
{*******************************************************************
Function GetExperience(Skill: String): Integer;
By: n3ss3s
Description: Returns the current experience of the skill Skill.
********************************************************************}
Function GetExperience(Skill: String): Integer;
Var
Index: Integer;
Skills: TStringArray;
Begin
Skills := ['Attack', 'Defense', 'Strength', 'Hitpoints', 'Range', 'Prayer',
'Magic', 'Cooking', 'Woodcutting', 'Fletching', 'Fishing',
'Firemaking', 'Crafting', 'Smithing', 'Mining', 'Herblore',
'Agility', 'Thieving', 'Slayer', 'Farming', 'Runecrafting',
'Hunter', 'Construction', 'Summoning'];
If InStrArrEx(Capitalize(Skill), Skills, Index) Then
Result := SmartGetFieldInt(0, Experiences, Index)
Else
Writeln('GetExperience: INVALID SKILL');
End;Enjoy ;)
Sorry, I had a lil' mistake there, I didn't try to compile it before releasing…