Results 1 to 3 of 3

Thread: Timing.scar fix

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

    Default Timing.scar fix

    About a month ago I noticed that some functions did not work so I posted them here. Evil Chicken said that he commited what I posted but he only changed one thing that I fixed. I tryed to use one of the functions but it didnt work. All of the other functions are working though so thats good.

    The function is WaitColor.

    The problem is... while (Time < GetSystemTime) do
    it should be while (Time > GetSystemTime) do

    Here is the function all fixed up:

    SCAR Code:
    {*******************************************************************************
    Function WaitColor(x, y, Color, Tol, MaxTime: integer): Boolean;
    By: Rasta Magician, fixed by TRiLeZ
    Description: Waits for a color at (x, y) with tolerance Tol, returns true if found
    *******************************************************************************}

    Function WaitColor(X, Y, Color, Tol, MaxTime: Integer): Boolean;
    var
      Time: Integer;
    begin
      Result := False;
      Time := GetSystemTime + MaxTime;
      while (Time > GetSystemTime) do
      begin
        if SimilarColors(GetColor(X, Y), Color, Tol) then
        begin
          Result := True;
          Exit;
        end;
        Wait(5 + Random(6));
      end;
    end;

  2. #2
    Join Date
    Jul 2007
    Location
    Norway.
    Posts
    1,938
    Mentioned
    3 Post(s)
    Quoted
    0 Post(s)

  3. #3
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default

    /me Slaps nava. that was his edit.

    ~RM

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

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
  •