SRL Archive - SRL Archives

MouseMM


Bad Boy JH

2010-02-21 00:20:58


procedure MouseMM(x, y, randX, randY: Integer);
var
p: TPoint;
begin
if not rs_OnMinimap(x, y) then
exit;

p := RotatePoint(Point(x, y), 2 * pi - rs_GetCompassAngleRadians, MMCX, MMCY);
Mouse(p.x, p.y, randX, randY, True);
end;
It wouldn't work before, does now…

Gu3st...

2010-02-21 03:23:19

Tested and confirmed. Bad Boy's version is much more accurate :)

mixster

2010-02-21 10:37:05

It was supposed to be (0 - rs_GetCompassAngleRadians) which would have the same effect as ((2 * pi) - rs_GetCompassAngleRadians) as per this post by RM on the original thread but it seems it was lost when actually adding it to the include. Either way, WizzyPlugin auto increments things below 0, so either 0 - or 2*pi - would be the same, but should be added.

Bad Boy JH

2010-02-22 05:20:04

I was just thinking, perhaps we should take into account clicking in the area (ie RandX, RanY)
ie

procedure MouseMM(x, y, randX, randY: Integer);
var
p, p2: TPoint;
begin
if not rs_OnMinimap(x, y) then
exit;

p := RotatePoint(Point(x, y), 2 * pi - rs_GetCompassAngleRadians, MMCX, MMCY);
p2 := RotatePoint(Point(x+RandX, y+RandY), 2 * pi - rs_GetCompassAngleRadians, MMCX, MMCY);
Mouse(RandomRange(P.x, P2.x), RandomRange(p.y, P2.y), 0, 0, True);
end;

Quickmarch

2010-02-22 08:09:15

I remember sending a PM to Rasta Magician about this but he said it was fine. :unsure:

Bad Boy JH

2010-02-22 20:52:34

heh?

i luffs yeww

2010-03-22 02:57:50

Sorry for the bump, but the MouseMM in SRL doesn't even work. :p It goes the opposite way.


procedure MouseMM(x, y, randX, randY: Integer);
var
p: TPoint;
begin
if not rs_OnMinimap(x, y) then
Exit;

p := RotatePoint(Point(x, y), 2 * pi - rs_GetCompassAngleRadians, MMCX, MMCY);
Mouse(p.x, p.y, randX, randY, True);
end;

Works the best. :)