Rich
2008-12-07 14:06:52
//function Connection : Boolean;
//By: R1ch
//Description: Checks to see if you have connection or not.
//Example: if Connection then...
function Connection : Boolean;
begin
result:= not(FindText(x, y 'ost onnection', CHARS, MSX1, MSY1, MSX2, MSY2));
end;I've noticed that when running scripts, lately I've been losing connection quite a bit, so I came up with this very simple function. Simple, but it does the job.
Used like:
procedure CheckConnection;
var
Timer : Integer;;
begin
if Connection then
//code
else
begin
MarkTime(Timer);
While(not(Connection) do
Wait(10);
if (TimeFromMark(Timer) = 20000) then Exit;
end;
end;Any comments?EDIT: What font/chars would this be?