Results 1 to 16 of 16

Thread: out of range

  1. #1
    Join Date
    Aug 2008
    Location
    !!LOL!!
    Posts
    247
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Question out of range

    when i run this
    SCAR Code:
    Function CountingTiara: Integer;

    Var
      X, Y: Integer;

    Begin
      Result := 0;
      FFlag(0);
      If FindDTM(TiaraDTM, X, Y, MIX1, MIY1, MIX2, MIY2) Then
        Begin
          TiaraCount := TiaraCount + ItemAmount('inv', 'dtm', TiaraDTM, []);
          Result := TiaraCount;
          WriteLn('Tiaras := ' + IntToStr(Result) + '.');
          Exit;
        End;
      WriteLn('Did Not Find Any Tiaras.');
    End;
    it says:
    [Runtime Error] : Out Of Range in line 120 in script C:\Program Files\SCAR 3.20\includes\SRL/SRL/Core/Amount.scar

  2. #2
    Join Date
    Feb 2007
    Location
    Alberta,Canada
    Posts
    2,358
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    this error would best be posted on the scripts thread (as I have a feeling its from Stunts aircrafter) if its not however, I dont think you declared your dtms, or else you should look in amount.scar for your answer.
    “Ignorance, the root and the stem of every evil.”

  3. #3
    Join Date
    Aug 2008
    Location
    !!LOL!!
    Posts
    247
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    now this is my own but i did declare my dtms and how can i find my problem in amount.scar?

  4. #4
    Join Date
    Feb 2007
    Location
    Alberta,Canada
    Posts
    2,358
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    because your getting your out of range when calling countitem, meaning you either calling it wrong or something and in amount.scar it will tell you all about countitem.

    Alternativly can i see the full script you wrote?
    “Ignorance, the root and the stem of every evil.”

  5. #5
    Join Date
    Aug 2008
    Location
    !!LOL!!
    Posts
    247
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    program New;
    {.include SRL/SRL.scar}

    Var
      TiaraDTM, SilverBarDTM, SilverOreDTM, TiaraCount: Integer;

    Procedure LoadDTMs;
    Begin

      SilverOreDTM := DTMFromString('78DA63CC63626008646440062B576E651001D' +
           '220D1FF40C0980F54E383AA06220B23817416508D3F01352073C2' +
           '08A82906AA09C2AF060028A709F2');

      SilverBarDTM := DTMFromString('78DA63CC65626078C880023A3A26338800694' +
           '620FE0F048C8540356F19D000231209A4E3816A5E1050930D5473' +
           '9B809A4AA09AFB04D4A401D5BCC3AF0600F7D60DB6');

      TiaraDTM := DTMFromString('78DA63CC61626078CD8002162E5CCB2002A41' +
           '981F83F103082D4BC6540038C48249006A97944404D1250CD4B02' +
           '6A8A806A9E13A1E60D7E35003D1D0E1D');
    End;

    Procedure Freeing;
    Begin
      FreeDTM(SilverOreDTM);
      FreeDTM(SilverBarDTM);
      FreeDTM(TiaraDTM);
    End;

    Function CountingTiara: Integer;

    Var
      X, Y: Integer;

    Begin
      Result := 0;
      FFlag(0);
      If FindDTM(TiaraDTM, X, Y, MIX1, MIY1, MIX2, MIY2) Then
        Begin
          TiaraCount := TiaraCount + ItemAmount('inv', 'dtm', TiaraDTM, []);
          Result := TiaraCount;
          WriteLn('Tiaras := ' + IntToStr(Result) + '.');
          Exit;
        End;
      WriteLn('Did Not Find Any Tiaras.');
    End;


    begin
      SetupSRL;
      ActivateClient;
      Wait(250 + RandomRange(100, 500));
      LoadDTMs;
      CountingTiara;
      Freeing;
    End.

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

    Default

    runs without errors for me
    but it didn't find tiara cause i don't have any on my background ROFL

  7. #7
    Join Date
    Aug 2008
    Location
    !!LOL!!
    Posts
    247
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    well the error wont work unless u have a tiara lol

  8. #8
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    if (II < 0) then Exit;

    That is line 120 in my Amount.scar.
    Might differ depending on the repository you used.

    Umm there should be absolutely no problem with that.

    Did you try running it with no Tiaras in the inventory?

  9. #9
    Join Date
    Aug 2008
    Location
    !!LOL!!
    Posts
    247
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    my line was different i changed it to like urs but it said i had 2 tiaras wen i had 5 IT said:
    SCAR Code:
    if (II > 2) then Exit;

  10. #10
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Try changing it to if ii = 0 then exit;. I am not sure if that will work as I did not look at the function only the line because I am on my iPod.

  11. #11
    Join Date
    Aug 2008
    Location
    !!LOL!!
    Posts
    247
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    didnt work im on srl 32 hers the function in 120:
    SCAR Code:
    function GetAmount(ItemX, ItemY: Integer): Integer;
    var
      S: string;
      X, Y, Col, II: Integer;
      B: TBox;
      colPts: TPointArray;
      ATPA: T2DPointArray;
    begin
      if (FindColor(X, Y, 65536, ItemX - 10, ItemY - 10, ItemX + 10, ItemY + 10)) then
      begin
        Result := 1;
        for II := 2 downto 0 do
          if (FindColorsTolerance(colPts, 7575987 * II * II - 6796134 * II + 65535, ItemX - 20, ItemY - 30, ItemX + 20, ItemY + 10, 0)) then
            Break;
        if (II > 2) then Exit;
        ATPA := SplitTPAEx(colPts, 5, 5);
        SortATPASize(ATPA, True);
        colPts := ATPA[0];
        Col := 7575987 * II * II - 6796134 * II + 65535;
        B := GetTPABounds(colPts);
        S := Trim(GetTextAtEx(B.X1, B.Y1 - 1, 0, StatChars, False, False, 0, 1, Col, 5, True, tr_AllChars));
        Result := StrToIntDef(GetNumbers(S), 1);
        if (Pos('M', S) > 0) then Result := Result * 1000000;
        if (Pos('K', S) > 0) then Result := Result * 1000;
      end;
    end;

  12. #12
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    What is the URL of the repository that you are checking out from?

  13. #13
    Join Date
    Aug 2008
    Location
    !!LOL!!
    Posts
    247
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    how do i get that? im using svn+Scar v3.20

  14. #14
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    So you are clicking update SRL svn?

  15. #15
    Join Date
    Aug 2008
    Location
    !!LOL!!
    Posts
    247
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    yup

  16. #16
    Join Date
    Aug 2008
    Location
    !!LOL!!
    Posts
    247
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    sorry for double posting but could some1 help me here plz??

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
  •