SRL Archive - SRL Archives

2 Edited Functions.


Rich

2009-09-30 22:58:33

Noticed that Naum's MouseCircle didn't have left or right click so here it is:

{*******************************************************************************
procedure MouseCircle(MidX, MidY, Radius: Integer; Left : Boolean);
By: NaumanAkhlaQ, edited by R1ch
Description: Clicks a random point in the circle of midpoint
'MidX', 'MidY' and with a radius of 'Radius'. Clicks left/right
depending on Left.
*******************************************************************************}
procedure MouseCircle(MidX, MidY, Radius: Integer; Left : Boolean)
begin
MMouseCircle(MidX, MidY, Radius);
Wait(30 + Random(10));
GetMousePos(MidX, MidY);
Mouse(MidX, MidY, 0, 0, Left);
end;

Also, MMouseCircle:

{*******************************************************************************
procedure MMouseCircle(MidX, MidY, Radius: Integer);
By: From MouseCircle by NaumanAklaQ. This by R1ch
Description: Moves a random point in the circle of midpoint
'MidX', 'MidY' and with a radius of 'Radius'.
*******************************************************************************}
procedure MMouseCircle(MidX, MidY, Radius: Integer);
var
TP: TPoint;
Control : array [0..1] of Integer;
begin
Control[0] := Random(Radius) + 1;
Control[1] := Random(361);
TP := Point(Round(Control[0] * Sin(Control[1] * Pi / 180)) + MidX,
Round(-Control[0] * Cos(Control[1] * Pi / 180)) + MidY);
MMouse(TP.x, TP.y, 0, 0);
end;

Also, a change to ClickNorth due to MouseCircle. This would only work if MouseCircle was changed to the above.

{*******************************************************************************
procedure ClickNorth(AngleHigh : boolean);
By: R1ch
Description: Clicks the compass to make it perfect North. Will set angle at
highest or lowest depending on AngleHigh
*******************************************************************************}
procedure ClickNorth(AngleHigh: boolean);
begin
if Random(4) = 1 then
begin
MouseCircle(542, 24, 15, False);
WaitOptionMulti(['ace', 'orth'], 1200);
end else
MouseCircle(542, 24, 15, True);
Wait(RandomRange(500, 1250));
SetAngle(AngleHigh);
end;
end;

EDIT:

Another two:

{*******************************************************************************
function IsLoginStill : Boolean;
By: R1ch
Description: Returns true if the login page is still
*******************************************************************************}
function IsLoginStill : Boolean;
begin
if LoggedIn then Exit;
Result:= GetColor(16, 487) = 2302956;
end;

{*******************************************************************************
function MakeLoginStill(Still : Boolean) : Boolean;
By: R1ch
Description: Makes login page still or not, depending on Still
*******************************************************************************}
function MakeLoginStill(Still : Boolean) : Boolean;
begin
if LoggedIn then Exit;
if not (IsLoginStill xor Still) then
Mouse(16, 487, 7, 7, True);
Result:= True;
end;

Richard.

Rich

2009-09-30 23:22:12

Thanks Naum. I've changed all the things you said. Naum for Dev!

Naum

2009-10-01 19:52:09

Yeah umm, I gave it some thought. And decided that it was based on MouseBox(), so I could use one or two ideas from it:

{*******************************************************************************
procedure MouseCircle(MidX, MidY, Radius, ClickType : Integer);
By: NaumanAkhlaQ
Description: Clicks a random point in the circle of midpoint
'MidX', 'MidY' and with a radius of 'Radius'.
ClickType:
1 - Left Click
2 - Right Click
3 - Move Mouse
Same as MouseBox's one.
*******************************************************************************}

procedure MouseCircle(MidX, MidY, Radius, ClickType : Integer);
var
TP: TPoint;
Control : array [0..1] of Integer;
begin
Control[0] := Random(Radius) + 1;
Control[1] := Random(361);
TP := Point(Round(Control[0] * Sin(Control[1] * Pi / 180)) + MidX,
Round(-Control[0] * Cos(Control[1] * Pi / 180)) + MidY);
MouseBox(TP.x, TP.y, TP.x, TP.y, ClickType);
end;

It now uses mouse box on the 1x1px area. It's basically the same as a click, except you can use the 'ClickType' variable on it.

EDIT: 1 - Left Click
2 - Right Click
3 - Move

Hmm, that means MouseBox will have to be forwarded.. :/

Rich

2009-10-02 18:34:17

I personally prefer using the two separate (MouseCircle and MMouseCircle) as they are more like what is most commonly used (MMouse and Mouse). Also, what difference does using MouseBox make other than making it into one function?