Log in

View Full Version : Find current level



DeSnob
05-16-2010, 04:14 PM
How would I make the script check if it has the correct level in that certain skill?

Example, You need 76 fishing to fish sharks; and 73 with fishing potions. How would i find out if the players fishing level was 76/73 so that if it is lower such as 75/73 , 74/73, OR 73/73 it would drink a fishing potion?

Naum
05-16-2010, 04:14 PM
{************************************************* ******************************
Function GetSkillLevel(skill: Variant): Integer;
By: Raymond
Description: Gets the max level for a particular skill.
************************************************** *****************************}


And:

{************************************************* ******************************
function GetSkillInfo(Skill: Variant; Amount : Boolean): Integer;
By: Raymond
Description: Gets the amount / level of a skill.
E.G.
0/15
Amount = True will return 0.
Amount = False will return 15 (The actual level).
Returns -1 if the level couln't be grabbed succesfully
************************************************** *****************************}

DeSnob
05-16-2010, 04:21 PM
{************************************************* ******************************
Function GetSkillLevel(skill: Variant): Integer;
By: Raymond
Description: Gets the max level for a particular skill.
************************************************** *****************************}


And:

{************************************************* ******************************
function GetSkillInfo(Skill: Variant; Amount : Boolean): Integer;
By: Raymond
Description: Gets the amount / level of a skill.
E.G.
0/15
Amount = True will return 0.
Amount = False will return 15 (The actual level).
Returns -1 if the level couln't be grabbed succesfully
************************************************** *****************************}


But wouldn't that always find out your current fishing level, and not 78/76? If not, than how would I set it up?

EDIT: nevermind, i know how to set it up :)

if GetSkillInfo('fishing', True) < 76 then drinkfishingpot; <<Is that right?

Coh3n
05-16-2010, 04:24 PM
But wouldn't that always find out your current fishing level, and not 78/76? If not, than how would I set it up?
I think that GetSkillLevel returns the numerator. So it would return the 78 if the fishing level was 78/76.

DeSnob
05-16-2010, 04:27 PM
I think that GetSkillLevel returns the numerator. So it would return the 78 if the fishing level was 78/76.

Actually it doesn't, it returns the level :)

function GetSkillLevel(Skill: Variant): Integer;
begin
Result := GetSkillInfo(Skill, False);
end;
False = return level

Coh3n
05-16-2010, 04:30 PM
Actually it doesn't, it returns the level :)

function GetSkillLevel(Skill: Variant): Integer;
begin
Result := GetSkillInfo(Skill, False);
end;
False = return level
Ah okay. Then he can just use GetSkillInfo('fishing', True); :p