SRL Archive - SRL Suggestions

WaitDTM


Sin

2012-02-10 10:21:52


(*
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;

Mat

2012-02-10 10:55:24

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

masterBB

2012-02-10 11:11:05

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;

footballjds

2012-02-10 11:31:24

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.

masterBB

2012-02-10 11:38:57

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:p

Coh3n

2012-02-11 15:05:38

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

Sin

2012-02-11 15:11:44

NOOOOO NOOB :(
Y me no get creds???

Coh3n

2012-02-11 19:25:12

From: Sin
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.

Sin

2012-02-11 19:34:57

Lol it was a trolll :P