As title says, it is broken. Doesn't fill the array in.
Printable View
As title says, it is broken. Doesn't fill the array in.
Check the code?
You probably didn't call your DeclarePlayers procedure or has CurrentPlayer set to undeclared Players[].
I did.
Well that's strange, works fine for me.
Simba Code:program new;
{$DEFINE SMART}
{$I SRL/SRL.simba}
begin
SetupSRL;
NumberOfPlayers(1);
GetAllLevels;
writeln(Players[CurrentPlayer].Level);
end.
Returns:
[7, 7, 1 1, 1, 3, 4, 1, 3, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1] (changed some numbers for security)
The order stated in the description is wrong though, refer to the 'GameTab 2 Related Functions' for the actual one.
What did your debug write?
Well I use it solely for the mining level, where it seems to return -1.
It sets the angle correctly and switchtes to the right tab so I think we can assume the function gets called correctly.Simba Code:Procedure InitPlayer;
Begin
GetAllLevels; //Doesnt seem to work?
SetChat('on',1);
SetChat('friends',2);
SetChat('on',3);
SetAngle(SRL_ANGLE_HIGH);
FindNormalRandoms;
End;
The level gets writeln'd in the progress report:
Simba Code:WriteLn((IntToStr(I)) + ' : ' + Players[I].Nick + ' = ' +
Active + '; ' + Players[I].Loc + rand + '; B: ' + IntToStr(Players[I].Integers[0])
+ ' Essence;'+ ' M : ' + IntToStr(Players[I].Level[15])); //mining level doesnt seem accurate
Script: http://villavu.com/forum/showthread.php?t=73746
If you are just getting one skill level call GetSkillLevel(SKILL_MINING) directly.
Like i said in previous post the description for GetAllLevels is wrong, SKILL_MINING = 14 (not 15), because the array starts from 0. Although it would return the skill level of herblore instead, not sure why it returns -1?
I think in the result that's supposed to return a level may be to blame, however I'm in no position to fully fledged my accusation towards that (late night).
^ I was thinking of, within the function I mentioned before;
but I could indeed be very wrong. :/ Good to see, thought, you figured out how to get the array of skills back correctly :)Simba Code:Result := StrToIntDef(GetNumbers(GetTextAtEx(Box.x1 - 2, Box.y1 -1, 100,
StatChars, False, True, 0, 3, 36095, 3, True, tr_Digits)), -1);
Cheers,
Lj