westkevin12
2013-05-01 01:18:12
thanks problem solved!
2013-05-01 01:18:12
2013-05-01 01:52:24
//Like FindColorsTolerance but with CT2
function FindACA(Col, Tol: Integer; Hue, Sat: Extended; Uptext: TStringArray; x1, y1, x2, y2, Dist: Integer): Boolean;
var
i, TPAL, tmpCTS: integer;
P: TPoint;
TPA: TPointArray;
ATPA: T2DPointArray;
TVA: TVariantArray;
begin
if CheckLogin then Exit;
Result := False;
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(Hue, Sat);
WriteDebug('Color: ' + IntToStr(Col));
WriteDebug('Tol: ' + IntToStr(Tol));
WriteDebug('Hue: ' + FloatToStr(Hue));
WriteDebug('Sat: ' + FloatToStr(Sat));
WriteDebug('Box: (' + IntToStr(x1) +', ' + IntToStr(y1) +', ' + IntToStr(x2) +', ' + IntToStr(y2) +')' );
if Debug then SMART_DrawBox(IntToBox(x1, y1, x2, y2));
if not FindColorsTolerance(TPA, Col, x1, y1, x2, y2, Tol) then
begin
WriteDebug('Failed to find color');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
SMART_ClearCanvas;
Exit;
end;
WriteDebug('Drawing on found colors');
if Debug then SMART_DrawDotsEx(False, TPA, clRed);
ATPA := TPAToATPA(TPA, Dist); //Overlaps
//ATPA := SplitTPA(TPA, 1); //Dose not overlap
SortATPAFrom(ATPA, Point(MSCX, MSCY));
SortATPAFromFirstPoint(ATPA, Point(MSCX, MSCY));
if Debug then SMART_DebugATPA(false, ATPA);
if DebugWait then
begin
WriteDebug('Waiting 2sec');
wait(2000);
end;
TPAL := High(ATPA);
for i := 0 to TPAL do
begin
P := MiddleTPA(ATPA[i]);
MMouse(P.x, P.y, 2, 2);
TVA := [Uptext]
if WaitFuncEx('FindTextAdv', TVA, RandomRange(100,150),RandomRange(900,1000)) then
begin;
Result := True;
Break;
end else WriteDebug('Didn''t find uptext: ' + Uptext[0]);
if Debug then PaintCross(P.x, P.y, clRed);
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if Debug then SMART_ClearCanvas;
end;
2013-05-01 03:03:00
2013-05-01 03:11:46
From: bud_wis_er_420
Try this
TPAL := High(ATPA);
for i := 0 to TPAL do
and next time make a new post. Your Lucky, I don't usually reread a post and I just realized you edited your first post with new code and asked a new question.