Results 1 to 3 of 3

Thread: Out of range error

  1. #1
    Join Date
    Oct 2010
    Location
    Under a bridge
    Posts
    648
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Out of range error

    Ok so i have been trying to make my first scirpt for the ... too many count ive try so many times and given up.
    I am new to everything coding but have come up with this and i belive i am using the arrays wrong. I get
    Code:
    Error: Out Of Range at line 164
    The following DTMs were not freed: [SRL - Lamp bitmap, 1]
    The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap]
    File[C:\Simba\Includes\SRL/logs/SRL log 15-02-11 0.txt] has not been freed in the script, freeing it now.
    Simba Code:
    Function MineRock:Boolean;
    Var TheRocks,Part1,Part2,Part3:TRSObjectArray;
        I,x,y :Integer;
        RockTest:TRSObject;
        XPoint :TPoint;
    Begin
      If Not LoggedIn Then Exit;

      Part1 := GetObjectsByID(5770,0,30);
      Part2 := GetObjectsByID(5771,0,30);
      Part3 := GetObjectsByID(5772,0,30);

      SetArrayLength(TheRocks,High(Part1));
      For I := 0 To High(Part1) Do
      TheRocks[I] := Part1[I];

      SetArrayLength(TheRocks,(High(TheRocks)+High(Part2)));
      For I := 0 To High(Part2) Do
      TheRocks[(I+High(Part1))] := Part2[I];

      SetArrayLength(TheRocks,(High(TheRocks)+High(Part3)));
      For I := 0 To High(Part3) Do
      TheRocks[(I+High(Part1)+High(Part2))] := Part3[I];

      SortObjects(TheRocks);

      For I := 0 To High(TheRocks) Do
      Begin
        If CheckRock(TheRocks[I].Tile) Then
          If Not TileOnMS(Therocks[I].Tile,0) Then
            If TileOnMM(TheRocks[I].Tile) Then
               WalkToTile(TheRocks[I].Tile,3,4); //failsafe bit
        If TileOnMS(Therocks[I].Tile,0) Then // just to check after walking
        Begin
          RockTest := GetObjectAt(TheRocks[I].Tile,0);
          If (RockTest.ID = 5770) Or (RockTest.ID = 5771) Or (RockTest.ID = 5772) Then
            XPoint := TileToPoint(RockTest.Tile);
            MMouse(XPoint.x,XPoint.y,3,3);
            If R_IsUpText('Mine Rocks') Then
            Begin
              GetMousePos(x,y);
              If (Random(100) = 5) Then
              Begin
                Mouse(x,y,0,0,False);
                R_ChooseOption('Mine Rocks');
                Wait(RandomRange(400,1200));
                If Not IsIdle Then
                Begin
                  Result := True
                  writeln('minning rock');
                  Exit;
                End;
              End Else Begin
                Mouse(X,Y,0,0,True);
                Wait(RandomRange(400,1200));
                If Not IsIdle Then
                Begin
                  Result := True
                  writeln('minning rock');
                  Exit;
                End;
              End
            End;
        End;
      End;
    End;
    and the line is
    Simba Code:
    TheRocks[I] := Part1[I];

    Thanks and sorry for posting so many questions and threads
    Quote Originally Posted by DD on IRC
    wanted to troll the troll

  2. #2
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    Just a guess, maybe you need to SetArrayLegth for Part1, Part2, and Part3?

  3. #3
    Join Date
    Oct 2010
    Location
    Under a bridge
    Posts
    648
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by YoHoJo View Post
    Just a guess, maybe you need to SetArrayLegth for Part1, Part2, and Part3?
    Tryed it and it didnt work

    Thanks though

    E: This is on run time, as i wanted to test it as its the first part of my scirpt. I am setting up srl and ref then calling this
    Quote Originally Posted by DD on IRC
    wanted to troll the troll

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
  •