SRL Archive - Help

Find current level


DeSnob

2010-05-16 12:14:03

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

2010-05-16 12:14:39

{*******************************************************************************
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

2010-05-16 12:21:04

From: Naum
{*******************************************************************************
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

2010-05-16 12:24:02

From: DeSnob
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

2010-05-16 12:27:34

From: Coh3n
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

2010-05-16 12:30:00

From: DeSnob
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