Results 1 to 2 of 2

Thread: FixGraphics not closing both windows fix

  1. #1
    Join Date
    Jun 2008
    Posts
    37
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default FixGraphics not closing both windows fix

    I've been having this issue and fixed it via:

    Code:
    FixGraphics;
    wait(300);
    closeWindow;
    If this isn't just affecting me I think adding the wait between the last two lines of the function in Gametab.scar would fix it. In other words from

    Code:
      closeWindow;
      closeWindow;
    end;
    
    //to
    
      closeWindow;
      wait(300);
      closeWindow;
    end;
    yes, I know my profile name is stupid =P

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

    Default

    Quote Originally Posted by mattman709 View Post
    I've been having this issue
    SCAR Code:
    {*******************************************************************************
    function CloseWindow: Boolean;
    By: NaumanAkhlaQ, Narcle, and Nava2
    Description: Closes any open windows.
    *******************************************************************************}

    function CloseWindow: Boolean;
    var
      Col: TIntegerArray;
      b: T2DPointArray;
      a: T2DPointArray;
      Pa: TBox;
      I, ii, {h,} l: Integer;
    begin
      Result := CloseBank;
      Col := [1118997,  1449250,  {Main typ 1}
              7976927,  4095140,  {Skill}
              6854059,  2902100,  {Quest}
              4282212, 2503226,  {Main typ 2}
              39423,    13567,    {Red X}
              1514271,  1580837,  {Deposit Box}
              1383457,  2107437];
      SetLength(b, 2);
      for I := 0 to 6 do
      begin
        FindColors(b[0], Col[i*2], MSCX, MSY1, MSX2, MSCY);
        FindColors(b[1], Col[i*2+1], MSCX, MSY1, MSX2, MSCY);
        l := (High(b[0]) + High(b[1]));
        //Writeln(IntToStr(i) + ' Col1: ' + IntToStr(High(b[0])) + ' Col2: ' + IntToStr(High(b[1])) + ' T: ' + IntToStr(l));
        if InRange(l, 6, 53) or InRange(l, 94, 250) then
        begin
          a := SplitTPA(CombineTPA(b[0], b[1]), 5);
          SortATPAFromFirstPoint(a, Point(507, 14));
          //DebugATPA(a, '');
          for ii := 0 to 0 do
          begin
            Pa := GetTPABounds(a[ii]);
            if ((Pa.x2 - Pa.x1) > 50) or ((Pa.y2 - Pa.y1) > 50) then Continue;
            MMouse(RandomRange(Pa.x1, Pa.x2), RandomRange(Pa.y1, Pa.y2), 0, 0);
            Result := (Pos('lose', GetUpText) > 0) or (Pos('ack', GetUpText) > 0);
            Pa.x2 := GetTimeRunning + 2000;
            while (not Result) and (GetTimeRunning < Pa.x2) do
            begin
              Wait(10);
              Result := (Pos('lose', GetUpText) > 0);
            end;
            Wait(Random(300));
            if Result then
            begin
              GetMousePos(Pa.x1, Pa.y1);
              Mouse(Pa.x1, Pa.y1, 0, 0, True);
              Result := True;
              //Writeln('Close Window Type ' + IntToStr(i));
              Exit;
            end;
          end;
        end;
      end;
    end;

    The closeWindow works as expected but has no wait at the end(and it shouldn't)
    So yes, Adding a wait inbetween the two closeWindow's would seem very logical. However, I would suggest using
    Wait(RandomRange(200, 400)); instead of Wait(300) that way the wait isn't static.
    Last edited by footballjds; 05-12-2011 at 03:53 PM.

Thread Information

Users Browsing this Thread

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

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •