SRL Archive - SRL Suggestions

MouseCircle


Nebula

2012-03-20 22:17:38

MouseCircle(); doesn't work, I created a whole new procedure for it.

Clicks randomly within the circle whos midpoint is (midx, midy) and has a radius of Radius.

Procedure MouseCircle(midx, midy, Radius: integer; button: variant);
var
x, y: Variant;
begin
x := RandomRange((midx - Radius), (midx + Radius + 1));
case Random(2) of
0: y := Round(sqrt(sqr(Radius) - sqr(x-midx)) + midy);
1: y := midy + (midy - (Round(sqrt(sqr(Radius) - sqr(x-midx)) + midy)));
end;
y := RandomRange(midy, y+ 1);
Mouse(x, y, 0, 0, Button);
end;

Coh3n

2012-03-22 01:08:26

What about the current one doesn't work? Also, we have MouseOval, and if that works properly, should be used for MouseCircle.

E: Fixed in the next version. The parameters were completely off.

procedure MouseCircle(MidX, MidY, Radius, clickType: Integer);
begin
MouseOval(MidX, MidY, Radius, Radius, clickType);
end;