SRL Archive - OSR Help

Checking level


Brid Mayhem

2013-03-09 01:42:59

Well, i'd like to add something that checks the level started, and the current level.


Is there already a method to get the level?

King

2013-03-09 01:50:19

From: Brid Mayhem
Well, i'd like to add something that checks the level started, and the current level.


Is there already a method to get the level?

EOC or 07Scape? I think there are both, GetLevel(); and P07_GetLevel();

Brid Mayhem

2013-03-09 02:03:25

From: SRLKing
EOC or 07Scape? I think there are both, GetLevel(); and P07_GetLevel();


It's for 07, sorry. That didn't work :(

Brid Mayhem

2013-03-09 21:04:16

Bump :(

The Mayor

2013-03-09 21:16:06

From: Brid Mayhem
Bump :(


Pretty sure it's GetSkillLevel('mining'); not sure for '07 as I don't play. Maybe P07_GetSkillLevel('mining')?

Le Jingle

2013-03-09 21:20:32

I'd recommend using SRL-OSR includes for up to date skills-related calls.

For example, calling

Writeln(GetSkillLevel('hunt'));

works correctly when I just now tested it.
Thus, You can expand this idea by calling this and storing the result to a variable. Then later on in your script, call the same function again, to compare/update/etc.

:ninja:'d

Brid Mayhem

2013-03-09 21:44:04

From: Le Jingle
I'd recommend using SRL-OSR includes for up to date skills-related calls.

For example, calling

Writeln(GetSkillLevel('hunt'));

works correctly when I just now tested it.
Thus, You can expand this idea by calling this and storing the result to a variable. Then later on in your script, call the same function again, to compare/update/etc.

:ninja:'d



Exactly what I needed! <333

DannyRS

2013-03-09 21:47:00

From: SRLKing
EOC or 07Scape? I think there are both, GetLevel(); and P07_GetLevel();


From: The Mayor
Pretty sure it's GetSkillLevel('mining'); not sure for '07 as I don't play. Maybe P07_GetSkillLevel('mining')?


I never added it to my personal Include sorry :p, as it's low priority progress releated stuff, but ironically the one in SRL-OSR was written by me (at least at the time of this post) :/ that one works as far as I know (and Le Jingle confirms this above?)


From: Le Jingle

For example, calling

Writeln(GetSkillLevel('hunt'));

works correctly when I just now tested it.


Lies! That returns an integer so you'd need

WriteLn(IntToStr(GetSkillLevel('mining')));

Unless I missed something :p

Brid Mayhem

2013-03-09 22:14:24

From: DannyRS
I never added it to my personal Include sorry :p, as it's low priority progress releated stuff, but ironically the one in SRL-OSR was written by me (at least at the time of this post) :/ that one works as far as I know (and Le Jingle confirms this above?)




Lies! That returns an integer so you'd need

WriteLn(IntToStr(GetSkillLevel('mining')));

Unless I missed something :p


Edit: Uhm, I couldn't find where the id's are. Like What you type in.
i.e. hunt = hunter

DannyRS

2013-03-09 23:12:04

From: Brid Mayhem
Edit: Uhm, I couldn't find where the id's are. Like What you type in.
i.e. hunt = hunter


Should work for the global integer constants such as skill_mining or as any full skill string name such as 'mining'

Brid Mayhem

2013-03-09 23:15:58

From: DannyRS
Should work for the global integer constants such as skill_mining or as any full skill string name such as 'mining'


All it posts is my level as -1 D:

I tried 'str', 'Strength' and 'strength'

i'll try Skill_Strength, ect and i'll post back in a few minutes.

Brid Mayhem

2013-03-09 23:24:19

From: DannyRS
Should work for the global integer constants such as skill_mining or as any full skill string name such as 'mining'


Tried all of those, nothing seems to be working.

Here's what i've tried:
writeln('Current level: ' +IntToStr(GetSkillLevel('SKILL_PRAYER'))+'!');
writeln('Current level: ' +IntToStr(GetSkillLevel('Prayer'))+'!');
writeln('Current level: ' +IntToStr(GetSkillLevel('pray'))+'!');

DannyRS

2013-03-09 23:33:22

From: Brid Mayhem
Tried all of those, nothing seems to be working.

Here's what i've tried:
writeln('Current level: ' +IntToStr(GetSkillLevel('SKILL_PRAYER'))+'!');
writeln('Current level: ' +IntToStr(GetSkillLevel('Prayer'))+'!');
writeln('Current level: ' +IntToStr(GetSkillLevel('pray'))+'!');


Hmm weird, is this with the Oldschool Include installed and do you have the fonts? Or are you using the main SRL one?

Brid Mayhem

2013-03-09 23:35:48

From: DannyRS
Hmm weird, is this with the Oldschool Include installed and do you have the fonts? Or are you using the main SRL one?


I have your 07Include installed, I have it setup correctly, i've done 2 scripts so far. This is the only kunundrum I've hit.

DannyRS

2013-03-09 23:45:45

From: Brid Mayhem
I have your 07Include installed, I have it setup correctly, i've done 2 scripts so far. This is the only kunundrum I've hit.


Ah, it's not my include you need for this, it's the alpha development release of SRL-OSR: https://github.com/SRL/SRL-OSR

Tho it's not easy to setup atm and the font's are not posted publicly I don't think yet, I'd upload for you but I'm on my phone atm

Brid Mayhem

2013-03-09 23:50:58

From: DannyRS
Ah, it's not my include you need for this, it's the alpha development release of SRL-OSR: https://github.com/SRL/SRL-OSR

Tho it's not easy to setup atm and the font's are not posted publicly I don't think yet, I'd upload for you but I'm on my phone atm


I also have that O.o. But wouldn't it say it can't recognize it instead of it saying -1?

DannyRS

2013-03-10 09:16:40

From: Brid Mayhem
I also have that O.o. But wouldn't it say it can't recognize it instead of it saying -1?


That is it's way of saying it can't recognise ;)

Did you include the OSR by doing something like {$I SRL-OSR/SRL.Simba}

Brid Mayhem

2013-03-10 16:37:46

From: DannyRS
That is it's way of saying it can't recognise ;)

Did you include the OSR by doing something like {$I SRL-OSR/SRL.Simba}

Tried that at got an error in a random class:(