Results 1 to 9 of 9

Thread: WaitDTM

  1. #1
    Join Date
    Dec 2011
    Location
    Toronto, Ontario
    Posts
    6,424
    Mentioned
    84 Post(s)
    Quoted
    863 Post(s)

    Default WaitDTM

    Simba Code:
    (*
    WaitDTM~~~~~~~~~~

    .. code-block:: pascal


        function WaitDTM(DTM,x,y,x1,y1,x2,y2,HowLong):Boolean;


    Waits for the specified DTM to arrive in the specified time and stores values in variables for later use.

    .. note::

    x1,y1,x2,y2 are MSX1,MSY1, etc.

    Author: Sin

    Example:

    .. code-block:: pascal


        Result := FindDTM(DTM,x,y,x1,y1,x2,y2);

    *)



    function WaitDTM(DTM,x,y,x1,y1,x2,y2,HowLong:Integer):Boolean;
    var
      t:Integer;
    begin
    MarkTime(t);
    repeat
      wait(100);
    until(FindDTM(DTM,x,y,x1,y1,x2,y2) or (TimeFromMark(t) > HowLong));

    Result := FindDTM(DTM,x,y,x1,y1,x2,y2);
    GetMousePos(x,y);
    end;

  2. #2
    Join Date
    Nov 2011
    Posts
    1,589
    Mentioned
    9 Post(s)
    Quoted
    17 Post(s)

    Default

    I like it would come in useful you could also use it for Bitmaps.
    Mat



    ^^

  3. #3
    Join Date
    Oct 2006
    Location
    Netherlands
    Posts
    3,285
    Mentioned
    105 Post(s)
    Quoted
    494 Post(s)

    Default

    Simba Code:
    function WaitDTM(DTM,var x, var y,x1,y1,x2,y2,HowLong:Integer):Boolean;
    var
      t:Integer;
    begin
    MarkTime(t);
    repeat
      wait(100+random(10));
      Result := FindDTM(DTM,x,y,x1,y1,x2,y2);
    until(Result or (TimeFromMark(t) > HowLong));
    end;
    Last edited by masterBB; 02-10-2012 at 04:23 PM.
    Working on: Tithe Farmer

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

    Default

    It's a nice little function however, I don't think it'd be used enough to make up for adding it into SRL. Often time's we can't just use find dtm and have to use dtm rotated.

  5. #5
    Join Date
    Oct 2006
    Location
    Netherlands
    Posts
    3,285
    Mentioned
    105 Post(s)
    Quoted
    494 Post(s)

    Default

    Simba Code:
    function WaitDTM(DTM,var x, var y,x1,y1,x2,y2,HowLong:Integer):Boolean;
    var
      t:Integer;
    begin
      Result := FindDTM(DTM,x,y,x1,y1,x2,y2);
      MarkTime(t);
      while(not(Result) or (TimeFromMark(t) > HowLong))
      begin
        wait(100+random(10));
        Result := FindDTM(DTM,x,y,x1,y1,x2,y2);
      end;
    end;

    Now all mistakes are fixed.. I think
    Working on: Tithe Farmer

  6. #6
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    I've actually already added this in the new randoms system, so it will be added to the include when the system it added.

  7. #7
    Join Date
    Dec 2011
    Location
    Toronto, Ontario
    Posts
    6,424
    Mentioned
    84 Post(s)
    Quoted
    863 Post(s)

    Default

    NOOOOO NOOB
    Y me no get creds???

  8. #8
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Quote Originally Posted by Sin View Post
    NOOOOO NOOB
    Y me no get creds???
    I can't tell if you're serious or not, but it's because you didn't write it. It's not even in SRL yet.

  9. #9
    Join Date
    Dec 2011
    Location
    Toronto, Ontario
    Posts
    6,424
    Mentioned
    84 Post(s)
    Quoted
    863 Post(s)

    Default

    Lol it was a trolll :P

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
  •