SRL Archive - Research & Development Lounge

Appa Include [Core Functions]


Home

2011-05-22 17:05:14

Appa Include



Functions:

function appa_NavigateTo(URL: string; TimeOut: Integer): Boolean;
procedure appa_UpdateBitmap;
function appa_GetColor(x, y: Integer): Integer;
function appa_FindColorTolerance(var x, y: Integer; color, xs, ys, xe, ye: Integer; Tolerance: Integer): Boolean;
function appa_FindColor(var x, y: Integer; color, xs, ys, xe, ye: Integer): Boolean;
function appa_FindColorSpiralTolerance(var x, y: Integer; color, x1, y1, x2, y2, Tolerance: Integer): Boolean;
function appa_CountColorTolerance(Color, x1, y1, x2, y2, Tolerance: Integer): Integer;
function appa_CountColor(Color, x1, y1, x2, y2: Integer): Integer;
function appa_FindDTM(DTM: Integer; var x, y: Integer; x1, y1, x2, y2: Integer): Boolean;
function appa_FindBitmapIn(Bitmap: Integer; var x, y: Integer; x1, y1, x2, y2: Integer): Boolean;
function appa_FindBitmapMaskTolerance(Mask: Integer; var x, y: Integer; x1, y1, x2, y2, Tolerance, ContourTolerance: Integer): Boolean;
function appa_FindDeformedBitmapToleranceIn(Bitmap: Integer; var x, y: Integer; x1, y1, x2, y2, tolerance, range: Integer; AllowPartialAccuracy: Boolean; accuracy: Extended): Boolean;
procedure appa_Mouse(x, y, rx, ry: Integer; Left: Boolean);

Note:
These Functions / Procedures are extremely simple but still very useful.
I hope that you will post suggestions if any.
Have fun!

Credits: Everyone Who Contributes Functions / Procedures.
And of course Niels!

~Home

Shuttleu

2011-05-22 17:13:31

yay!
also, are you supposed to update the bitmap on the FindDTM?

~shut

Home

2011-05-22 17:15:36

From: Shuttleu
yay!
also, are you supposed to update the bitmap on the FindDTM?

~shut


Sorry my bad. :) I Upped the fixed one. Sorry again.

Shuttleu

2011-05-22 17:34:34

based on your DTM
function appa_FindBitmapIn(Bitmap: Integer; var x, y: Integer; x1, y1, x2, y2: Integer): Boolean;
begin
appa_UpdateBitmap;
Result := FindBitmapIn(Bitmap, x, y, Client.x1 + x1, Client.y1 + y1, Client.x1 + x2, Client.y1 + y2);
end;

~shut

tom99

2011-05-22 17:48:52

Wow, well done! +rep

Shuttleu

2011-05-22 18:03:21

yea, rep+ as two of yours is now used in my Woo Hoo Bingo script

~shut

Flight

2011-05-22 20:52:10

Are you still planning to develop this include and add more functions over time?

Home

2011-05-23 01:54:40

Yes. I would like to see people post own made Fnctions in this thread what would be usefull. After that i will put them to Include (Will add your Findbitmap) Thanks Shutt!


~Home

tom99

2011-05-24 03:16:50

woud be nice if you could also add this: FindBitmapMaskTolerance, findcolorspiraltolerance, and FindDeformedBitmapToleranceIn

Shuttleu

2011-05-24 05:44:06

From: tom99
woud be nice if you could also add this: FindBitmapMaskTolerance, findcolorspiraltolerance, and FindDeformedBitmapToleranceIn


function appa_FindBitmapMaskTolerance(mask: Integer; var x, y: Integer; x1, y1, x2, y2, Tolerance, ContourTolerance: Integer): Boolean;
begin
appa_UpdateBitmap;
Result := FindBitmapMaskTolerance(mask, x, y, Client.x1 + x1, Client.y1 + y1, Client.x1 + x2, Client.y1 + y2, Tolerance, ContourTolerance);
end;

function appa_findcolorspiraltolerance(var x, y: Integer; color, x1, y1, x2, y2, Tolerance: Integer): Boolean;
begin
appa_UpdateBitmap;
Result := findcolorspiraltolerance(x, y, color, Client.x1 + x1, Client.y1 + y1, Client.x1 + x2, Client.y1 + y2, Tolerance);
end;

function appa_FindDeformedBitmapToleranceIn(bitmap: Integer; var x, y: Integer; x1, y1, x2, y2, tolerance, range: Integer; AllowPartialAccuracy: Boolean; accuracy: Extended): Boolean;
begin
appa_UpdateBitmap;
Result := FindDeformedBitmapToleranceIn(bitmap, x, y, Client.x1 + x1, Client.y1 + y1, Client.x1 + x2, Client.y1 + y2, tolerance, range, AllowPartialAccuracy, accuracy);
end;

~shut

Home

2011-05-24 06:01:56

Yep like Shuttleu does. Just follow how we converted those Functions, so you can pretty much convert any Function :)


EDIT:

Updated Include:
Added all above Functions.

~Home