Results 1 to 10 of 10

Thread: GetAllLevels is broken

  1. #1
    Join Date
    Feb 2007
    Location
    Het ademt zwaar en moedeloos vannacht.
    Posts
    7,211
    Mentioned
    26 Post(s)
    Quoted
    72 Post(s)

    Default GetAllLevels is broken

    As title says, it is broken. Doesn't fill the array in.
    I made a new script, check it out!.

  2. #2
    Join Date
    Jul 2011
    Location
    /home/litoris
    Posts
    2,226
    Mentioned
    0 Post(s)
    Quoted
    159 Post(s)

    Default

    Check the code?
    Miner & Urn Crafter & 07 Chicken Killer
    SPS BlindWalk Tutorial

    Working on: Nothing

    teacher in every art, brought the fire that hath proved to mortals a means to mighty ends

  3. #3
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

    You probably didn't call your DeclarePlayers procedure or has CurrentPlayer set to undeclared Players[].

  4. #4
    Join Date
    Feb 2007
    Location
    Het ademt zwaar en moedeloos vannacht.
    Posts
    7,211
    Mentioned
    26 Post(s)
    Quoted
    72 Post(s)

    Default

    I did.
    I made a new script, check it out!.

  5. #5
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

    Quote Originally Posted by Markus View Post
    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?

  6. #6
    Join Date
    Feb 2007
    Location
    Het ademt zwaar en moedeloos vannacht.
    Posts
    7,211
    Mentioned
    26 Post(s)
    Quoted
    72 Post(s)

    Default

    Well I use it solely for the mining level, where it seems to return -1.
    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;
    It sets the angle correctly and switchtes to the right tab so I think we can assume the function gets called correctly.
    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
    I made a new script, check it out!.

  7. #7
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

    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?

  8. #8
    Join Date
    Feb 2012
    Location
    Wonderland
    Posts
    1,988
    Mentioned
    41 Post(s)
    Quoted
    272 Post(s)

    Default

    Quote Originally Posted by riwu View Post
    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?
    Default result in;
    Simba Code:
    function GetSkillInfo(Skill: Variant; Amount : Boolean): Integer;

  9. #9
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

    Quote Originally Posted by Le Jingle View Post
    Default result in;
    Simba Code:
    function GetSkillInfo(Skill: Variant; Amount : Boolean): Integer;
    Yeah but how did it fail grabbing the herblore level?

  10. #10
    Join Date
    Feb 2012
    Location
    Wonderland
    Posts
    1,988
    Mentioned
    41 Post(s)
    Quoted
    272 Post(s)

    Default

    Quote Originally Posted by riwu View Post
    Yeah but how did it fail grabbing the herblore level?
    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;
    Simba Code:
    Result := StrToIntDef(GetNumbers(GetTextAtEx(Box.x1 - 2, Box.y1 -1, 100,
        StatChars, False, True, 0, 3, 36095, 3, True, tr_Digits)), -1);
    but I could indeed be very wrong. :/ Good to see, thought, you figured out how to get the array of skills back correctly

    Cheers,
    Lj

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •