Results 1 to 9 of 9

Thread: Out of range error [Maybe to do with MultiPlayer]

  1. #1
    Join Date
    Feb 2007
    Location
    Access Violation at 0x00000000
    Posts
    2,865
    Mentioned
    3 Post(s)
    Quoted
    18 Post(s)

    Default Out of range error [Maybe to do with MultiPlayer]

    Simple script i made, but when its somewhere between AntiBan/Going to click spot again, i get

    Code:
    [Runtime Error] : Out Of Range in line 1234 in script C:\Program Files\SCAR 3.12\includes\SRL/SRL/Core/AntiRandoms/AntiRandoms.scar
    Wich is this function:
    SCAR Code:
    {*******************************************************************************
    function FindTalk: Boolean;
    by: MastaRaymond and little bit of help from Wizzup?
    Description: Searches screen for NickName and handles ALL Talking Randoms.
    *******************************************************************************}


    Function FindTalk: Boolean;
    var
      TPA,Matches : TPointArray;
      TempATPA : TPointArrayArray;
      I,CTS,x,y : integer;
      Box  : TBox;
      RawMenuText : String;
    begin;
      CTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(1);
      FindColorsTolerance(TPA, 65535, 3, 3, 515, 336, 0);
      if FindTPAinTPA(Players[CurrentPlayer].NickTPA,TPA,Matches) then  // THIS IS THE ONE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!@@@@
      For I := 0 to High(Matches) do
      begin;
        FindColorsTolerance(TPA,65535,3, Matches[I].y - 1,516,Matches[I].y + 14,0);
        if High(TPA) < 0 then
          Continue;
        TempATPA := FindGapsTPA(TPA,10);
        if Length(TempATPA) > 1 then
        begin;
          SetLength(TPA,Length(TempATPA));
          For x := 0 to High(TempATPA) do
          begin;
            Box := GetTPABounds(TempATPA[x]);
            TPA[x] := Point((Box.x2 + Box.x1) shr 1, Box.y2);
          end;
          SortTPAFrom(TPA,Point(Matches[I].x,Matches[I].y));
          x := TPA[0].x;
          y := TPA[0].y;
        end else
        begin;
          Box := GetTPABounds(TempATPA[0]);
          x := (Box.x2 + Box.x1) shr 1;
          y := Box.y2;
        end;
        y := y + 8;
        MMouse(x, y, 0, 0);
        Wait(100 + Random(50));
        if IsUpTextMultiCustom(['Talk','lk-to','uard']) then
        begin
          GetMousePos(x, y);
          Mouse(x, y, 0, 0, False);
          Wait(450 + Random(125));
          if ChooseOptiongetMenuText(RawMenuText, x, y, 'Talk') then
          begin
            WriteLn('******** FOUND TALKING RANDOM TEXT********: ' + RawMenuText);
            WriteFileString(TheFile, '******** FOUND TALKING RANDOM TEXT********: ' + RawMenuText +Chr(13))
            Talks := Talks + 1;
            FFlag(0);
            Wait(1337 + Random(500));
            SolveTalkingRandom(RawMenuText);
            Result := True;
            Exit;
          end;
        end;
      end;
      ColorToleranceSpeed(CTS);
    end;

    SCAR Code:
    program PowerNetter;

    {.include SRL\SRL.scar}

    var x, y, loads : Integer;

    const
    LoadsToDo = 10; //How much loads?

    procedure FailSafe;
    begin
     if (not(LoggedIn)) then Exit;
    end;

    procedure Drop;
    var I : Integer;
    begin
      for I := 2 to 28 do
       DropItem(i);
       end;

    procedure CheckNet;
    begin
    FailSafe;
     if (FindColor(x, y, 3753557, 0, 0, 1280, 1024)) and IsUpTextMulti('Sma', 'mall', 'ish') then
     begin
      Writeln('Fishing net found, starting to fish!');
     end;
    end;

    procedure AntiBan;
    begin
    FailSafe;
      case random(5) of
        0: RandomRClick;
        1: BoredHuman;
        2: HoverSkill('fishing', False);
        3: AlmostLogout;
        4: SleepAndMoveMouse(2337+random(667));
      end;
    Wait(5000+random(2000+random(500)));
    end;


    procedure FindSpotAndFish;
    begin
    FailSafe;
      if (FindObj(x, y, 'ish', 15920361, 25)) or FindObj(x, y, 'ish', 13216659, 25) then
      begin
       Mouse(x, y, 5, 5, true);
       Loads := Loads + 1;
       SleepAndMoveMouse(2500+random(1337));
      end;
    end;

    begin
    SetUpSRL;
    ActivateClient;
     CheckNet;
     Repeat
    Repeat
     FindSpotAndFish;
      AntiBan;
     Until(InvFull);
    Drop;
    Until(Loads = LoadsToDo);
    end.

    Maybe its to do with the fact that i dont have MultiPlayer in it..
    The Line 1234 i commented
    Ce ne sont que des gueux


  2. #2
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    a) You can't use the other "codes" inside SCAR tags
    b) Bold is [b*] boldhere [/b*] without the *'s.

    I think you don't have remembered to call your DeclarePlayers.

  3. #3
    Join Date
    Feb 2007
    Location
    Access Violation at 0x00000000
    Posts
    2,865
    Mentioned
    3 Post(s)
    Quoted
    18 Post(s)

    Default

    I dont have any players yet!

    Did you look througt the script?
    And, i found out my BBCode didnt work, so i changed it
    Ce ne sont que des gueux


  4. #4
    Join Date
    Feb 2007
    Location
    PA, USA
    Posts
    5,240
    Mentioned
    36 Post(s)
    Quoted
    496 Post(s)

    Default

    you need to have declare players, but make a declare players first! because it needs a nickname to look for

  5. #5
    Join Date
    Feb 2007
    Location
    Access Violation at 0x00000000
    Posts
    2,865
    Mentioned
    3 Post(s)
    Quoted
    18 Post(s)

    Default

    So a script w/o declareplayers is not possible?
    Ce ne sont que des gueux


  6. #6
    Join Date
    Mar 2007
    Location
    Netherlands->Amersfoort.
    Posts
    1,615
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    as long as you don't call findnormalrandoms it does work. but its easyer to just declare you're players.

  7. #7
    Join Date
    Feb 2007
    Location
    Access Violation at 0x00000000
    Posts
    2,865
    Mentioned
    3 Post(s)
    Quoted
    18 Post(s)

    Default

    But.. I didnt call the randoms..
    Ce ne sont que des gueux


  8. #8
    Join Date
    Dec 2007
    Posts
    103
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by floor66
    But.. I didnt call the randoms..
    You didn't but SRL did. FindNormalRandoms is called during the BoredHuman-procedure (check AntiBan.scar to see what I'm talking about).
    This sentence is false.

  9. #9
    Join Date
    Feb 2007
    Location
    PA, USA
    Posts
    5,240
    Mentioned
    36 Post(s)
    Quoted
    496 Post(s)

    Default

    Quote Originally Posted by Gumleren View Post
    You didn't but SRL did. FindNormalRandoms is called during the BoredHuman-procedure (check AntiBan.scar to see what I'm talking about).
    gumleren is right, srl calls it. so just add:
    SCAR Code:
    procedure PlayerSetup;
    begin
      NumberOfPlayers(1);
      Players[0].Nick        := 'nick';          //Nick Name
      Players[0].Active      := True;         //Use This Player [ True / False ]
    end;
    or you can just add set player nickname TPA if you know how

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. Out Of Range Error
    By decide in forum OSR Help
    Replies: 8
    Last Post: 08-02-2008, 10:29 AM

Posting Permissions

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