SRL Archive - Reflection Development

Level/XP Functions!


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…

turbobk

2008-08-04 06:38:57

Very Nice man!!!

I will be def using these! :)

Vampspiro

2008-08-05 20:39:19

awesome awesome script
but you can use calculators… :p

Method

2008-08-05 22:15:35

From: Vampsprio
awesome awesome script
but you can use calculators… :p


Calculators can't find the skill level or experience of skills without looking at the statistics tab like these functions can.

n3ss3s

2008-08-06 03:12:28

From: Vampsprio
awesome awesome script
but you can use calculators… :p


Go on and tell your script to go to draynor.net, insert your name and get the stats from the picture.

heliumbox

2008-08-08 02:45:23

"Description: Returns the max level of the skill Skill."
Apparently its just myself who doesn't understand this but what does this mean? From the other comments I assume it just gathers the information about your stats and experience levels like a calculator, just well… automatic? Sorry for the noob question

Method

2008-08-08 03:14:45

From: heliumbox
"Description: Returns the max level of the skill Skill."
Apparently its just myself who doesn't understand this but what does this mean? From the other comments I assume it just gathers the information about your stats and experience levels like a calculator, just well… automatic? Sorry for the noob question


Max level is the bottom number on your skill level. If you have 59/60 Mining, for example, the max level would be 60.

I Am Legend

2008-08-08 06:11:48

what does this function do ? like what stats does it get i mean wahts max stat

n3ss3s

2008-08-08 06:19:38

Read above! :mad:

If your prayer is 10/38 then 38 is the max stat.

heliumbox

2008-08-08 09:38:13

Ok that makes a little more sense i think…. I will just run it and figure out what I don't understand lol

Edit: ok well I'm new at scripts and it gives me "Line 18: [Error] (18:4): Unknown identifier 'InStrArrEx' in script " most likely not a scripting error, just probably my noobish fault, any ideas?

n3ss3s

2008-08-08 15:50:43

You didn't include SRL…

Bobarkinator

2008-08-13 22:15:18

Meh easy hook :p

iMelee

2008-12-18 19:13:52

This is amazing THANK YOU

NiCbaZ

2008-12-18 19:25:30

This so needs to be added to the Relfection include.

Method

2008-12-18 20:46:50

From: NiCbaZ
This so needs to be added to the Relfection include.


It's already in the TMe type and can be accessed when you call GetMe.

Shady?

2008-12-18 21:37:08

Oh nice, well, the max levels where already there, right? So the new stuff here is the Current level and the experience, nice functions. Def. going to use this, faster than the old-fashioned method where we used to hover the skill we want to get the xp :D.

Method

2008-12-18 21:37:53

From: Shady?
Oh nice, well, the max levels where already there, right? So the new stuff here is the Current level and the experience, nice functions. Def. going to use this, faster than the old-fashioned method where we used to hover the skill we want to get the xp :D.


This isn't new. This has been posted and probably in the reflection include for 4 months. :p