Results 1 to 5 of 5

Thread: Getting out of range error

  1. #1
    Join Date
    Dec 2011
    Posts
    124
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Getting out of range error

    Getting the error on the red line here:
    Simba Code:
    procedure SetTrap;
    Var
      i : Integer;
      T : TPoint;
      TPA : TPointArray;
      ATPA : T2DPointArray;
    begin
     [COLOR="Red"] FindColorsTolerance(ATPA[i], treeColor, MSX1, MSY1, MSX2, MSY2, 3);[/COLOR]
      TPA := MergeATPA(ATPA);
      ATPA := SplitTPA(TPA, 6);
      SortATPASize(ATPA, True);
      T := MiddleTPA(ATPA[0]);
      MMouse(T.x, T.y, 2, 2);
      wait(RandomRange(300,400));
      if(isUpText('oung tree')) then
      begin
        Mouse(T.x, T.y, 0, 0, mouse_right);
        Inc(trapsSet);
        players[CurrentPlayer].Loc := 'CheckTrap';
      end;
    end;

    Uploaded full script below if that's any help.

    Thanks,
    TsterT

  2. #2
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    FindColorsTolerance(ATPA, treeColor, MSX1, MSY1, MSX2, MSY2, 3);

    ^ That should do it.
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  3. #3
    Join Date
    Dec 2011
    Posts
    124
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Then I get a type mismatch error ^^.

  4. #4
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    Meh, sorry, replace the ATPA with TPA in the FindColor function. Then take out the TPA := MergeATPA(); line, since you don't need it.
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  5. #5
    Join Date
    Dec 2011
    Posts
    124
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    That did it, thanks!


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
  •