Results 1 to 9 of 9

Thread: Out Of Range Error

  1. #1
    Join Date
    Dec 2007
    Posts
    44
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Out Of Range Error

    I'm getting an out of range error on the FindTalk; function in AntiRandoms.scar any idea why?
    This is the line its happening on.
    SCAR Code:
    if FindTPAinTPA(Players[CurrentPlayer].NickTPA,TPA,Matches) then  //Length check inside the function ;)
    Here is how I declared my player. (just one for now)
    SCAR Code:
    const  
       StartPlayer = 0;
       NumOfPlayers = 1;   // Number of users.

    Procedure DeclarePlayers;

    Begin
      HowManyPlayers  := NumOfPlayers;
      NumberOfPlayers( HowManyPlayers );
      CurrentPlayer := StartPlayer;

      Players[0].Name :='myun';
      Players[0].Pass :='mypw';
      Players[0].Nick :='nick';
      Players[0].Active:=True;
    End;

  2. #2
    Join Date
    Jul 2007
    Location
    Norway.
    Posts
    1,938
    Mentioned
    3 Post(s)
    Quoted
    0 Post(s)

    Default

    Try this:

    SCAR Code:
    const  
       StartPlayer = 0;
       NumOfPlayers = 1;   // Number of users.
     
    Procedure DeclarePlayers;
     
    Begin
      HowManyPlayers  := NumOfPlayers;
      NumberOfPlayers( HowManyPlayers );
      CurrentPlayer := StartPlayer;
     
      Players[0].Name :='myun';
      Players[0].Pass :='mypw';
      Players[0].Nick :='nick';
      Players[0].Active:=True;
      SetPlayerNameTPAs; // <--
    End;

  3. #3
    Join Date
    Dec 2007
    Posts
    44
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I tried that, it didn't work. Possibly any other solutions?

  4. #4
    Join Date
    Jul 2007
    Location
    Norway.
    Posts
    1,938
    Mentioned
    3 Post(s)
    Quoted
    0 Post(s)

    Default

    Could you please post the entire script you're using?

    But, firstly, delete your SRL folder and checkout again, that might solve the problem.

  5. #5
    Join Date
    Dec 2007
    Posts
    44
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Most of this is Wizzup?'s code, but I'm just trying to make it work right now, there are no credits in it yet. Thanks guys. The error happens in Fish; at FindNormalRandoms;
    SCAR Code:
    program Fisher;
    {.include SRL/SRL.scar}

    var t : integer;

    const
      SpotColorMid = 10392974;
      SpotColorLow = 11050390;
     
       StartPlayer = 0;
       NumOfPlayers = 1;   // Number of users.

    Procedure DeclarePlayers;

    Begin
      HowManyPlayers  := NumOfPlayers;
      NumberOfPlayers( HowManyPlayers );
      CurrentPlayer := StartPlayer;

      Players[0].Name :='myun';
      Players[0].Pass :='mypw';
      Players[0].Nick :='nick';
      Players[0].Active:=True;
      SetPlayerNameTPAs;
    End;


    procedure CheckLoggedIn;
    begin
      if not LoggedIn then
      begin
        Writeln('Not logged in.. terminating script.');
        TerminateScript;
      end;
    end;

    procedure WalkToDock;
    begin
      if t < 5 then
      begin
        wait(1000+random(1000));
          if RadialWalk(11324 , 61, 78, 60, 0, 1)then
          begin
            Flag;
            exit;
          end else
            t := t + 1;
            wait(500+random(100));
            MakeCompass('N');
            wait(500+random(100));
            WalkToDock;
      end else
        Writeln('Could not find dock.. terminating script.');
        Logout;
        wait(3000+random(1000));
        TerminateScript;
    end;

    procedure WalkToBank;
    begin
      if t < 5 then
      begin
        wait(1000+random(1000));
        if RadialWalk( 3821414, 264, 254, 50, 0, 1)then
        begin
          Flag;
          exit;
        end else
          t := t + 1;
          wait(500+random(100));
          MakeCompass('N');
          wait(500+random(100));
          WalkToBank;
      end else
        Writeln('Could not find bank.. terminating script.');
        Logout;
        wait(3000+random(1000));
        TerminateScript;
    end;

    procedure Bank;
    begin
      wait(250 + random(167));
      if OpenBankQuiet('vwb') then
      begin
        Flag;
        FixBank;
        wait(445 + random(265));
        Deposit(2,28,True);
        wait(227 + random(258));
        CloseBank;
        wait(127 + random(258));
        exit;
      end else
        Writeln('Could not open bank.. terminating script.');
        Logout;
        wait(3000+random(1000));
        TerminateScript;
    end;

    Function FindFishingSpots: TPointArray;

    Var
      Fish: TPointArray;
      Fishes: T2DPointArray;
      I , cts: Integer;

    begin
      If Not LoggedIn Then Exit;
        SetLength(Result, 0);
        cts := GetColorToleranceSpeed;
        ColorToleranceSpeed(2);
        FindColorsSpiralTolerance(MSCX, MSCY, Fish, SpotColorMid, MSX1, MSY1, MSX2, MSY2, 40)
        Fishes := TPAtoATPA(Fish, 25)
        SetLength(Fish, 0)
        SetLength(Result, Length(Fishes));
        For I := 0 to High(Fishes) Do
        begin
          If Length(Fishes[i]) < 5 Then
            Continue;
          Result[I] := MiddleTPA(Fishes[I]);
        end;
        SetLength(Fishes, 0);
        ColorToleranceSpeed(cts);
    end;



    Function FindFishingSpot(Var x, y: Integer): Boolean;

    Var
      Fish: TPointArray;
      I : Integer;

    Begin
      If Not LoggedIn Then Exit;
      Result := False;
      Fish := FindFishingSpots;
      For I := 0 to length(Fish) - 1 Do
      Begin
        MMouse(Fish[I].X, Fish[I].Y, 0, 0);
        Wait(150 + Random(50));
        If IsUpText('age') Then
          begin
            Result := True;
            x := Fish[I].X;
            y := Fish[I].Y;
            Exit;
          end;
       end;
    end;

    Function FollowSpot(Var x, y: Integer): Boolean;

    Var
       FishP, FishP1, FishP2: TPointArray;
       P: TPoint;
       z: Integer;
    Begin
      Result := False;
      If Not LoggedIn Then
        Exit;
      z := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      FindColorsTolerance(FishP1, SpotColorLow, x - 20, y - 20, x + 20,  y + 20, 40);
      FindColorsTolerance(FishP2, SpotColorMid, x - 20, y - 20, x + 20,  y + 20, 40);
      FishP := CombineTPA(FishP1, FishP2);
      If Length(FishP) > 3 Then
      Begin
        Result := True;
        P := MiddleTPA(FishP);
        x := P.X;
        y := P.Y;
      End;
      ColorToleranceSpeed(z);
    End;


    Function FindWhirlPool(x, y: integer): Boolean;

    Var
       FishPoints: TPointArray;
       cts: Integer;

    Begin
      If Not LoggedIn Then Exit;
      cts := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      FindColorsTolerance(FishPoints, 13947343, x - 20, y - 20, x + 20, y + 20, 40)
      If Length(FishPoints) > Round(230 * 1) Then
      Begin
        WhirlPools := Whirlpools + 1;
        WriteLn(FloatToStr(Length(FishPoints) / 1600.0)+ '% Change');
        Result := True;
      End;
      ColorToleranceSpeed(cts);
    End;


    Procedure HandleFight;
    Begin
      MakeCompass('N');
      WalkToBank;
      Wait(4000);
      WalkToDock;
      MakeCompass('N');
    End;


    function Fish: Boolean;
    Var
       x, y, RotateNum: Integer;

    begin
      If Not LoggedIn Then Exit;
      t := 0
      FindNormalRandoms;
      If FindFishingSpot(x, y) Then
      Begin
        RotateNum := 15000 + Random(20000);
        If Not FindWhirlPool(x, y) Then
        Begin
          Mouse(x, y, 0, 0, True);
          Result := True;
          Wait(500+random(250));
          Repeat
            If FindWhirlpool(x, y) Then
            Begin
              Mouse(648, 84, 4, 4, True);
              Wait(100);
              WriteLn('Whirlpool found.');
              Inc(Whirlpools);
              Break;
            End;

            If Not FollowSpot(x, y) Then
              Break;
              Wait(200);
            If InvFull Then
              Break;
              Wait(100);
            If FindFight Then
              HandleFight;
              Wait(15);
          Until False;
        end;
      end;
    end;

    begin
      SetupSRL;
      ActivateClient;
      wait(500+random(500));
      CheckLoggedIn;
      WalkToDock;
      Fish;
      WalkToBank;
      Bank;
    end.

  6. #6
    Join Date
    May 2007
    Location
    England
    Posts
    4,140
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default

    I'm getting that same error in my autotalker that I'm currently working on. I had anti-randoms included, got the error, so I took them out. However, I'm still getting the error even without anti-randoms. Can anyone advise us? I've re-downloaded SCAR and SRL, but still no luck. Help please?

    Thanks,
    R1ch4
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

  7. #7
    Join Date
    Oct 2006
    Location
    finland, helsinki
    Posts
    2,501
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    add declareplayers to ur loop and it works -.-

    Code:
    • Narcle: I recall Jukka releasing a bunch of scripts like this before... Its how he rolls I think. rofl
    • Solarwind: Dude, you are like... t3h s3x.
    • Hy71194: JuKKa you're a machine! You released 3 scripts in 10 minutes! :O
    • benjaa: woah.... Jukka is the man Guildminer pwns all
    • NaumanAkhlaQ: And JuKKa Is my Her0!

  8. #8
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    First: You have to declare always the players array.
    Second: to use AntiRandom you always need the Players Array Declared
    ~Hermen

  9. #9
    Join Date
    Mar 2006
    Posts
    795
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    i had a simmilar error liek this and its because i declared the player after te procedure which used (Players[CurrentPlayer]...



    Dont Steal..

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Out of Range Error
    By Torrent of Flame in forum OSR Help
    Replies: 7
    Last Post: 12-20-2008, 09:24 PM
  2. Out of range error still...=(
    By oakley123 in forum OSR Help
    Replies: 2
    Last Post: 10-22-2008, 05:48 AM
  3. Odd out of range error..
    By JAD in forum OSR Help
    Replies: 7
    Last Post: 05-09-2007, 09:28 PM

Posting Permissions

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