i think one way could be to ThreadSafeCall the procedure, it doesnt have to be called that way but its the only way you can let the scripter specify the procedure, something like this
Code:
procedure MouseProcedure(x,y,rx,ry:integer; proname:string; args:TVariantArray;)
begin
//...
//...
repeat
movemouse(.....
threadsafecall(procname,args)
until( MouseIsAtDestination );
end;
it would be used like this
Code:
var p: TVariantArray;
begin
setarraylength(p,6);
p[0] := bmpRock; //the bitmap of a rock
p[1] := x; //the variable x
p[2] := y;
p[3] := 5;//the parimieters x1,y1,x2,y2
p[4] := 6;
p[7] := 454;
p[8] := 553;
MouseProcedure(x,y,5,5,'FindBitmapIn',p);
that wouldnt acctualy work, what would the procedure do if it finds the bitmap, but it shows how it might work