Rich
2009-07-04 19:23:39
What they do:
MouseColorUptext:
If it find colour Col at X, Y, it moves the mouse there with Rx, Ry randomness. If the uptext Uptxt is found, it performs Action, and returns true. The correct choices for Action are:
- 0 = Nothing
- 1 = Left click
- 2 = Right click
WaitFindColorSpiral:
Exactly like WaitFindColor except that it uses FindColorSpiralTolerance instead of FindColorTolerance.
Comments?
EDIT: Some credits to Richard for improving and shortening.
MouseColorUptext:
If it find colour Col at X, Y, it moves the mouse there with Rx, Ry randomness. If the uptext Uptxt is found, it performs Action, and returns true. The correct choices for Action are:
- 0 = Nothing
- 1 = Left click
- 2 = Right click
WaitFindColorSpiral:
Exactly like WaitFindColor except that it uses FindColorSpiralTolerance instead of FindColorTolerance.
Comments?
{*******************************************************************************
function MouseColorUptext(X, Y, Rx, Ry : Integer; Cx1, Cy1, Cx2, Cy2, Col, Tol, MaxTime, Action : Integer; UpTxt : string) : Boolean;
By: R1ch
Description: Waits for a color at X, Y with tolerance Tol, then checks for uptext.
If uptext is found, then performs Action. 0 = Nothing
1 = Left click
2 = Right click
Returns true if Action is performed
*******************************************************************************}
function MouseColorUptext(X, Y, Rx, Ry : Integer; Cx1, Cy1, Cx2, Cy2, Col, Tol, MaxTime, Action : Integer; UpTxt : string) : Boolean;
begin
if not InRange(Action, 0, 2) then
begin
SRL_Warn('MouseColorUptext', 'Incorrect action: ' + IntToStr(Action), warn_AllVersions);
Exit;
end;
if WaitFindColor(X, Y, Cx1, Cy1, Cx2, Cy2, Col, Tol, MaxTime) then
begin
MMouse(X, Y, Rx, Ry);
if WaitUptext(Uptext, MaxTime) then
begin
GetMousePos(X, Y);
if Action > 0 then
1, 2 : Mouse(X, Y, 0, 0, Action = 1);
Result := True;
end;
end;
end;
{*******************************************************************************
function WaitFindColorSpiral(X1, Y1, X2, Y2, Col, Tol, MaxTime: Integer) : Boolean;
By: R1ch
Description: Waits for a color spiraling with tolerance Tol, returns true if found
*******************************************************************************}
function WaitFindColorSpiral(X1, Y1, X2, Y2, Col, Tol, MaxTime: Integer) : Boolean;
var
Time: Integer;
begin
Time := GetSystemTime + MaxTime;
while GetSystemTime < Time do
Begin
Result := FindColorSpiralTolerance(MSCX, MSCY, Col, X1, Y1, X2, Y2, Tol);
If Result then Exit;
end;
end;EDIT: Some credits to Richard for improving and shortening.