Results 1 to 7 of 7

Thread: Runtime Error

  1. #1
    Join Date
    Feb 2009
    Posts
    1,447
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default Runtime Error

    Im getting this runtime error:

    SCAR Code:
    [Runtime Error] : Exception: Can't allocate the DIB handle in line 95 in script C:\Program Files\SCAR 3.21\Scripts\My Scripts\Will Chop.scar

    Procedure:
    SCAR Code:
    procedure HandleChopping;
    var
      Area, CX, CY, Ti, RandomNumber: Integer;
    begin
      if (X < CentreX) and (Y < CentreY) then Area := 1;
      if (X > CentreX) and (Y > CentreY) then Area := 2;
      if (X > CentreX) and (Y > CentreY) then Area := 3;
      if (X < CentreX) and (Y > CentreY) then Area := 4;
      Wait(RandomRange(1000, 1500));
      MarkTime(Ti);
      RandomNumber := RandomRange(25000, 30000);
      repeat
        case Area of
          1: if (not FindColorTolerance(cx, cy, 4024409, TopLeft.x, TopLeft.y, CentreX, CentreY, 10)) or
             (not FindColorTolerance(cx, cy, 1653294, TopLeft.x, TopLeft.y, CentreX, CentreY, 10)) then
             Exit;
          2: if (not FindColorTolerance(cx, cy, 4024409, TopRight.x, CentreY, CentreX, TopRight.y , 10)) or
             (not FindColorTolerance(cx, cy, 1653294, TopRight.x, CentreY, CentreX, TopRight.y, 10)) then
             Exit;
          3: if (not FindColorTolerance(cx, cy, 4024409, CentreX, CentreY, BottomRight.x, BottomRight.y, 10)) or
             (not FindColorTolerance(cx, cy, 1653294, CentreX, CentreY, BottomRight.x, BottomRight.y, 10)) then
             Exit;
          4: if (not FindColorTolerance(cx, cy, 4024409, BottomLeft.y, CentreX, BottomLeft.x,CentreY, 10)) or //Line 95
             (not FindColorTolerance(cx, cy, 1653294, BottomLeft.y, CentreX, BottomLeft.x,CentreY, 10)) then
             Exit;
        end;
        if InvFull then
        begin
          DropAll;
          Exit;
        end;
        Wait(1000);
        if (TimeFromMark(Ti) >= RandomNumber) then Break;
      until false;
    end;
    Last edited by YoHoJo; 09-23-2009 at 11:34 AM.

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

    Default

    Ive gotten that a few times, restart scar and see.
    Also, wana tell us which line exactly is line 95?

  3. #3
    Join Date
    Feb 2009
    Posts
    1,447
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

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

    Default

    Make sure that " BottomLeft.y, CentreX, BottomLeft.x,CentreY"
    Are proper coordinates for a rectangle? Is all i can think of.

  5. #5
    Join Date
    Feb 2009
    Posts
    1,447
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Oh thanks so much!
    I found out that my coords didnt make a rectangle.

    Everything is now fixed. Off to scripting again

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

    Default

    Ha! Sweet i guessed and i was right! No problem dude, good luck scripting!
    Error should have said
    Code:
    [Runtime Error] : Exception: its not a fucking rectangle in line 95 in script C:\Program Files\SCAR 3.21\Scripts\My Scripts\Will Chop.scar !!!!!

  7. #7
    Join Date
    Feb 2009
    Posts
    1,447
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by YoHoJo View Post
    Ha! Sweet i guessed and i was right! No problem dude, good luck scripting!
    Error should have said
    Code:
    [Runtime Error] : Exception: its not a fucking rectangle in line 95 in script C:\Program Files\SCAR 3.21\Scripts\My Scripts\Will Chop.scar !!!!!
    I agree. That error would have saved me so much time

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
  •