ASync

Simple functions that run in the background.

procedure ThisIsCalledWhenFinished(constref Result: TASyncHTTPResult);
begin
  WriteLn(Result.Response);
  WriteLn(Result.Data);
end;

begin
  ASync.HTTPGet('httpbin.org/get', @ThisIsCalledWhenFinished);

  Sleep(5000); // give some time to complete
end;

ASync.HTTPGet

procedure ASync.HTTPGet(URL: String; OnFinish: TASyncHTTPFinishEvent; OnProgress: TASyncHTTPProgressEvent = nil); static;
procedure ASync.HTTPGet(URL: String; RequestHeaders: TStringArray; OnFinish: TASyncHTTPFinishEvent; OnProgress: TASyncHTTPProgressEvent = nil); static;

ASync.HTTPGetFile

procedure ASync.HTTPGetFile(URL: String; DestFile: String; OnFinish: TASyncHTTPFinishEvent; OnProgress: TASyncHTTPProgressEvent = nil); static;
procedure ASync.HTTPGetFile(URL: String; RequestHeaders: TStringArray; DestFile: String; OnFinish: TASyncHTTPFinishEvent; OnProgress: TASyncHTTPProgressEvent = nil); static;

ASync.HTTPPost

procedure ASync.HTTPPost(URL, Data: String; OnFinish: TASyncHTTPFinishEvent); static;
procedure ASync.HTTPPost(URL: String; RequestHeaders: TStringArray; Data: String; RequestHeaders: TStringArray; OnFinish: TASyncHTTPFinishEvent); static;

ASync.MouseMove

procedure ASync.MouseMove(Target: TTarget; Dest: TPoint; Accuracy: Double = 1);
procedure ASync.MouseMove(Dest: TPoint; Accuracy: Double = 1);

Moves the mouse on another thread, so the script can do other things such as updating the destination.


ASync.MouseChangeDest

procedure ASync.MouseChangeDest(Dest: TPoint);

ASync.MouseMoving

property ASync.MouseMoving: Boolean;

ASync.MouseWaitMoving

procedure ASync.MouseWaitMoving;

ASync.MouseStop

procedure ASync.MouseStop;

ASync.FileUnzip

procedure ASync.FileUnzip(ZipFile, DestPath: String; OnFinish: TASyncUnzipFinishEvent; OnProgress: TASyncUnzipProgressEvent = nil); static;

ASync.Schedules

function ASync.Schedules: TStringArray; static;

Returns all running schedules.


ASync.ScheduleEvery

function ASync.ScheduleEvery(Name: String; Method: procedure of object; Interval: Integer); static;

Schedule a method to be called every interval (in milliseconds).


ASync.ScheduleEvery

function ASync.ScheduleEvery(Name: String; Method: procedure(Params: TPointerArray) of object; Params: TPointerArray; Interval: Integer); static;

ScheduleEvery with passing parameters to the method (as TPointerArray).


ASync.ScheduleStop

procedure ASync.ScheduleStop(Name: String); static;

Stop a scheduled method.