SRL Archive - SRL Suggestions

MouseBoxEx


**BANNED The Man

2011-02-11 18:17:25

Added HoldMouse to ClickType, just more functionality.

{*******************************************************************************
procedure MouseBoxEx(x1, y1, x2, y2: Integer; Dist,ClickType: Integer);
By: Raymond (Dynamite added HoldMouse)
Description: Does mouse stuff (ClickType), and uses a point that is within Dist from
the closest point between mouse and the box.
*******************************************************************************}
procedure MouseBoxEx(x1, y1, x2, y2: Integer; Dist,ClickType: Integer);
var
PT : TPoint;
begin
GetMousePos(pt.x,pt.y);
PT := RandomPointBoxEx(pt,inttobox(x1,y1,x2,y2),Dist);
case ClickType of
1 : Mouse(pt.x, pt.y, 0, 0, True);
2 : Mouse(pt.x, pt.y, 0, 0, False);
3 : MMouse(pt.x, pt.y, 0, 0);
4 : HoldMouse(pt.x, pt.y, True);
else
srl_Warn('MouseBox', 'ClickType is NOT a valid number!', warn_AllVersions);
end;
end;

Sir R. M8gic1an

2011-02-11 18:32:22


{ RM --------------------------------------------------------------------------]
[ Makes a box of BoxSize with center SPoint, within the MS ]
[------------------------------------------------------------------------------}
function MakeMSBox(SPoint: TPoint; BoxSize: integer): TBox;
begin
Result.x1 := Max(SPoint.x - BoxSize, MSX1);
Result.x2 := Min(SPoint.x + BoxSize, MSX2);
Result.y1 := Max(SPoint.y - BoxSize, MSY1);
Result.y2 := Min(SPoint.y + BoxSize, MSY2);
end;

{ RM --------------------------------------------------------------------------]
[ FindColorsTolerance in a TBox ]
[------------------------------------------------------------------------------}
function FindColorsToleranceBox(var TPA: TPointArray; Color, Tolerance: Integer; Box: TBox): boolean;
begin
Result := FindColorsTolerance(
TPA,
Color,
Box.x1,
Box.y1,
Box.x2,
Box.y2,
Tolerance
);
end;

-S-RM