Results 1 to 18 of 18

Thread: Need some help

  1. #1
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default Need some help

    OK, Everyone who runs my script keeps getting an error.

    Code:
    [Runtime Error] : Out Of Range in line 120 in script C:\Program Files\SCAR 3.20\includes\SRL/SRL/Core/Amount.scar
    Does anyone know what this is and how I can fix it?

    T~M

  2. #2
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Where do you get this error at runtime or not?
    nvm.
    It doesn't gives me an error.
    Move plugins, devs rev, no?
    What's at that line, I might can find our where it points to.?
    ~Hermen

  3. #3
    Join Date
    Feb 2007
    Location
    South East England
    Posts
    2,906
    Mentioned
    2 Post(s)
    Quoted
    8 Post(s)

    Default

    When I hit play it works. Ill run it now.
    Jus' Lurkin'

  4. #4
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    It works for me, but as other people say it after like 1 minute running, they get the error, i think it to do with my countlogs.

    T~M

  5. #5
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Post the line.
    Lazy bum.
    ~Hermen

  6. #6
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

  7. #7
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    The line before?(post the whole procedure)
    ~Hermen

  8. #8
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    Maybe MY countlogs is wrong, maybe I dont put it in loop properly or something, I dont know lol

    T~M

  9. #9
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Don't lol me if you want answer, LoL, post the lines here; you're the one that wants help
    ~Hermen

  10. #10
    Join Date
    Feb 2007
    Location
    South East England
    Posts
    2,906
    Mentioned
    2 Post(s)
    Quoted
    8 Post(s)

    Default

    Quote Originally Posted by Hermen View Post
    Don't lol me if you want answer, LoL, post the lines here; you're the one that wants help
    He wasnt lol'ing at you. Dont be so harsh. And look at his code, he has attatched it.
    Jus' Lurkin'

  11. #11
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    Sorry I replied to the post before yours wasnt loaded by the time
    Umm the whole procedure in Amount.scar is:
    SCAR Code:
    {*******************************************************************************
    function GetAmount(ItemX, ItemY: Integer): Integer;
    By: ZephyrsFury
    Description: Returns the amount of an item at coordinates (ItemX, ItemY).
      Returns approximate values for 'K' and 'M'.
    *******************************************************************************}


    function GetAmount(ItemX, ItemY: Integer): Integer;
    var
      S: string;
      Col, II: Integer;
      B: TBox;
      TPA: TPointArray;
      ATPA: T2DPointArray;
    begin
      if (FindColorsTolerance(TPA, 65536, ItemX - 50, ItemY - 50, ItemX + 50, ItemY + 50, 0)) then
      begin
        SortTPAFrom(TPA, Point(ItemX, ItemY));
        ATPA := SplitTPAEx(TPA, 5, 5);
        B := GetTPABounds(ATPA[0]);
        if (Length(ATPA[0]) < 15) or (B.X2 - B.X1 < 5) or (B.Y2 - B.Y1 < 5) then Exit;
        Result := 1;
        for II := 2 downto 0 do
          if (FindColorsTolerance(TPA, 7575987 * II * II - 6796134 * II + 65535, B.X1 - 10, B.Y1 - 10, B.X2 + 10, B.Y2 + 10, 0)) then
            Break;
        if (II < 0) then Exit;
        SortTPAFrom(TPA, Point((B.X1 + B.X2) shr 1, (B.Y1 + B.Y2) shr 1));
        ATPA := SplitTPAEx(TPA, 5, 5);
        TPA := ATPA[0];
        Col := 7575987 * II * II - 6796134 * II + 65535;
        B := GetTPABounds(TPA);
        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 else
        if (Pos('K', S) > 0) then Result := Result * 1000;
      end;
    end;
    And my countlogs is:
    SCAR Code:
    Procedure CountTheLogs;
    var
    WillowsDTM, LogsInTheInv: Integer;
    begin
    if not LoggedIn then Exit;
    GameTab(4);
    WillowsDTM := DTMFromString('78DA637461626078C680027C5D6518F881342' +
                 '310FF07024613A09A270C6880118904D23640351F09A80900AA79' +
                 '45408D1750CD4DFC6A001E780A9E');
    LogsInTheInv := ItemAmount('inv', 'dtm', WillowsDTM, []);
    InventoryWillows := InventoryWillows+LogsInTheInv;
    FreeDTM(WillowsDTM);
    writeln(inventorywillows);
    end;
    And my chopping loop is:
    SCAR Code:
    function ChoppingLoop: Boolean;
    var
      T, x, y, i: Integer;
      Colour: Integer;
    begin
      repeat
      begin
        AntiRandom;
        MarkTime(T);
        if FindWillow(x, y) then
        begin
          Mouse(x, y, 3, 3, False);
          Wait(100+random(200));
          if ChooseOption('hop') then
          begin
            Colour := GetColor(x, y - 5);
            Wait(1000+random(2000));
            while (SimilarColors(Colour, GetColor(x, y - 5), 4) and not(InvFull)) do
            begin
              MakeCompass('N');
              Result := True;
              CountTheLogs;
              i:=random(30);
              if i = 1 then
              begin
                AntiBanage;
                Wait(randomrange(100,250));
              end;
              Wait(100);
              AntiRandom;
              SleepAndMoveMouse(2500+random(100));
              if TimeFromMark(T) >= 20000 then Break;
            end;
          end;
        end;
      end;
      until(InvFull);
    end;

    hope this helps

    T~M

  12. #12
    Join Date
    Oct 2007
    Location
    Denmark
    Posts
    409
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    writeln(inventorywillows);
    Isn't that an Int?

  13. #13
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    What ya mean?
    What should it be?

    T~M

  14. #14
    Join Date
    Oct 2007
    Location
    http://ushort.us/oqmd65
    Posts
    2,605
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    scar 3.20 + doesn't have to be inttostr if thats what your getting at.
    I do visit every 2-6 months

  15. #15
    Join Date
    Oct 2006
    Location
    ithurtsithurtsithurtsithurts
    Posts
    2,930
    Mentioned
    7 Post(s)
    Quoted
    135 Post(s)

    Default

    Quote Originally Posted by Frt View Post
    SCAR Code:
    writeln(inventorywillows);
    Isn't that an Int?
    He's using 3.20d, I assume. With 3.20 and up, you no longer have to do IntToStr or anything like that, since SCAR does it for you.

    Edit: Ninja'd by zasz. Curse you zasz!

  16. #16
    Join Date
    Oct 2007
    Location
    Denmark
    Posts
    409
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by zasz View Post
    scar 3.20 + doesn't have to be inttostr if thats what your getting at.
    And I've been doing that for ages with 3.20..

  17. #17
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

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

    Default

    Quote Originally Posted by Frt View Post
    And I've been doing that for ages with 3.20..
    A little backwards compatibility doesn't help . I do that as well.

    Also, you can only do that when you are only writing that to debug. So this:
    SCAR Code:
    program New;
    var
      i : integer;
    begin
      i := 1337;
      writeln('Number is: ' + i);
    end.
    Would not work while this:
    SCAR Code:
    program New;
    var
      i : integer;
    begin
      i := 1337;
      writeln('Number is: ' + IntToStr(i));
    end.
    would work .

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
  •