Nexz
2012-10-30 17:42:36
This one finds the GE Banker and draws a green square around and then banks. It also paints the GE Clerk so you can correct the cords more easily.
The table of numbers is in OpenBankGE is like that because it allows you to easily correct and store (copy paste) the cords.
It hope it has no errors because I had to change it a bit :/
The table of numbers is in OpenBankGE is like that because it allows you to easily correct and store (copy paste) the cords.
It hope it has no errors because I had to change it a bit :/
var
XFound, YFound: Integer;
function Find(XStart, YStart, ArrayLenght, Color, Tol: Integer; HMod, SMod: Extended): Boolean;
begin
Result:= False
CTS:= GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(HMod, SMod);
if FindColorsSpiralTolerance(XStart, YStart, TPA, Color, MSX1, MSY1, MSX2, MSY2, Tol) then
Result:= True;
ColorToleranceSpeed(CTS);
SetArrayLength(TPA, ArrayLenght);
MiddleTPAEx(TPA, XFound, YFound);
end;
procedure OpenBankGE;
var
XStart, YStart, TPALenght, Color, Tol, XBegin, ,YBegin, XEnd, YEnd, A, B, C, D: Integer;
HMod, SMod: Extended;
begin
XStart := 270
YStart := 120
TPALenght := 100
Color := 3416615
Tol := 14 // used to be 6 but didnt work anymore after weeks, 14 is still way accurate anough it seems
HMod := 0.16
SMod := 0.29
A := -65
B := 14
C := 13
D := 26
SMART_ClearCanvas;
if not Find(XStart, YStart, TPALenght, Color, Tol, HMod, SMod) then
Stop('openbankge');
SMART_DrawDotsEx(False, TPA, clRed); // draw tpa ge clerk
SMART_DrawBoxEx(False, True, IntToBox(XStart-1, YStart-1, XStart+1, YStart+1), clBlue); // startpoint of findcolorsspiral
SMART_DrawBoxEx(False, True, IntToBox(XFound-1, YFound-1, XFound+1, YFound+1), clAqua); // mark middle tpa ge clerk
SMART_DrawBoxEx(False, False, IntToBox(XBegin+A, YBegin+B, XBegin+C, YBegin+D), clGreen); // draw a box around ge banker
MouseBox(XBegin+A, YBegin+B, XBegin+C, YBegin+D, 2); // left click click banker
Option(1, ['k B']);
// SMART_ClearCanvas; // uncomment if you want
end;