Results 1 to 6 of 6

Thread: Out of Range.

  1. #1
    Join Date
    Aug 2007
    Location
    Georgia, U.S.
    Posts
    890
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Out of Range.

    I think this has something to do with my array, i get this error when i run the script.

    [Runtime Error] : Out Of Range in line 203 in script

    SCAR Code:
    procedure ChopTheOaks;
    begin
      if WhichTreeToChop = 'Oak' then
      begin
        OakTreeColor[0] := 6464409;
        OakTreeColor[1] := 2195310;
        OakTreeColor[2] := 1715244;
        OakTreeColor[3] := 11818;
        repeat
          if not Loggedin then Exit;
          for i := 0 to 3 do
            if(FindEnt(fx, fy, false))then break;
            if (FindObjCustom(X, Y, ['ak', 'Oak'], [OakTreeColor[i]], 3)) then // this is the line
            begin
              Mouse(x, y, 3, 3, True);
              FFlag(0);
              GameTab(4);
              FindNormalRandoms;
              MyAntiBannage;
              Wait(5000);
            end;
        until (invfull);
      end;
    end;

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    2,984
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    Well can your OakTreeColor array handle 4 values ?
    Administrator's Warning:


  3. #3
    Join Date
    Aug 2007
    Location
    Georgia, U.S.
    Posts
    890
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i think so

    OakTreeColor: array[0..3] of Integer;

  4. #4
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    2,984
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    Ah no nevermind about the length of your array ...

    See for loops work like this, they add and add until it surpassed the statement value.

    when you do

    Code:
    for i := 0 to 2 do
    then after the for loop i will be 3.

    Now in your script you do the for loop on :

    Code:
          for i := 0 to 3 do
            if(FindEnt(fx, fy, false))then break;
    Since there are no begins and ends it will only loop that line. After it is done with the loop i is 4, then it calls
    Code:
            if (FindObjCustom(X, Y, ['ak', 'Oak'], [OakTreeColor[i]], 3)) then // this is the line
            begin
    and OakTreeColor[4] errors..

    I'm assuming you want this :

    Code:
    procedure ChopTheOaks;
    begin
      if WhichTreeToChop = 'Oak' then
      begin
        OakTreeColor[0] := 6464409;
        OakTreeColor[1] := 2195310;
        OakTreeColor[2] := 1715244;
        OakTreeColor[3] := 11818;
        repeat
          if not Loggedin then Exit;
          for i := 0 to 3 do
          begin
            if(FindEnt(fx, fy, false))then break;
            if (FindObjCustom(X, Y, ['ak', 'Oak'], [OakTreeColor[i]], 3)) then // this is the line
            begin
              Mouse(x, y, 3, 3, True);
              FFlag(0);
              GameTab(4);
              FindNormalRandoms;
              MyAntiBannage;
              Wait(5000);
            end;
          end;
        until (invfull);
      end;
    end;
    Administrator's Warning:


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

    Default

    huh

  6. #6
    Join Date
    Aug 2007
    Location
    Georgia, U.S.
    Posts
    890
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ya, thats what i wanted, thanks.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. 71-99 range?
    By isjusme in forum RuneScape News and General
    Replies: 16
    Last Post: 06-02-2008, 03:45 PM
  2. 70 range
    By isjusme in forum RuneScape News and General
    Replies: 6
    Last Post: 04-27-2008, 05:37 PM
  3. out of range
    By nik999389 in forum OSR Help
    Replies: 4
    Last Post: 10-29-2007, 09:43 AM
  4. Out of range
    By rotflmfwao in forum OSR Help
    Replies: 3
    Last Post: 08-22-2007, 02:29 AM
  5. Eh... Out of Range...
    By Pancakes in forum OSR Help
    Replies: 4
    Last Post: 07-03-2007, 11:41 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
  •