King of Knives
2007-11-18 15:48:19
I've had this idea for some time, but I first got to executing it today. It's very simple, and not very perfect at all.
I've been looking at myself while playing legitly, and what I've noticed is, that the closer my mouse is to my target, the slower and more shaky I move it, so I won't miss it.
So, basicly, this script will find the point of the current mouse-position in a number of circles with different radius'es, revolving from the mouse-target.
Say, you want to move to 100,50, and your current mouse-position is 50, 50. Easy to calculate; Your target is 90 degrees angle in a circle from the current mouseposition, and the radius is 50.
So, basicly (good word), this will calculate the angle of the targetpoint in a circle, then move to radius 50 and same angle, and slow down from there.
I think it looks more humanlike, but I don't know. Maybe it's just because my hand is a little shaky by nature. The downside, though, is that calculating the angle and radius is damn slow. 2-3 seconds if not more, usually.
I can't really explain it any more, but if anybody would try this and then comment it, I'd be happy.
—
Code:
PS: Don't hold the mouse more than 600 pixels from the target. That will make the whole thing useless.
Ty,
-Knives
I've been looking at myself while playing legitly, and what I've noticed is, that the closer my mouse is to my target, the slower and more shaky I move it, so I won't miss it.
So, basicly, this script will find the point of the current mouse-position in a number of circles with different radius'es, revolving from the mouse-target.
Say, you want to move to 100,50, and your current mouse-position is 50, 50. Easy to calculate; Your target is 90 degrees angle in a circle from the current mouseposition, and the radius is 50.
So, basicly (good word), this will calculate the angle of the targetpoint in a circle, then move to radius 50 and same angle, and slow down from there.
I think it looks more humanlike, but I don't know. Maybe it's just because my hand is a little shaky by nature. The downside, though, is that calculating the angle and radius is damn slow. 2-3 seconds if not more, usually.
I can't really explain it any more, but if anybody would try this and then comment it, I'd be happy.
—
Code:
program New;
{.include SRL/SRL.scar}
Function FFSAngle(Px,Py,Ox,Oy: Integer; var Radius: Integer): Integer;
var Cpx,Cpy,R,I: Integer;
begin
for R:= 800 downto 1 do
begin
for I:= 0 to 359 do
begin
Cpx:= Round(R*Sin(Radians(I)))+Ox;
Cpy:= Round(-R*Cos(Radians(I)))+Oy;
if PointInBox(IntToPoint(Px,Py),IntToBox(Cpx-1,Cpy-1,Cpx+1,Cpy+1)) then
begin
Result:= I;
Radius:= R;
Exit;
end;
end;
end;
end;
Procedure TargetMMouse(ax,bx,rx,ry: Integer);
var x,y,a,b,R,Ang,Rad,TM,RCount,Cx,Cy: Integer;
begin
TM:= MouseSpeed;
GetMousePos(x,y)
A:= Ax+random(Rx)
B:= Bx+random(Ry)
Ang:= FFSAngle(x,y,a,b,R)
Writeln('Radius is '+IntToStr(R))
Writeln('Angle is '+IntToStr(Ang))
if (R < 51) then
begin
MMouse(a,b,0,0)
MouseSpeed:= Randomize(TM,2)
end else
begin
Rad:= Randomize(50,3)
MouseSpeed:= Randomize(8,1)
Cx:= Round(Rad*Sin(Radians(Ang)))+A;
Cy:= Round(-Rad*Cos(Radians(Ang)))+B;
MMouse(Cx,Cy,2,2)
RCount:= 40;
repeat
MouseSpeed:= Randomize((RCount/10)+3,1)
Rad:= Randomize(RCount,3)
Cx:= Round(Rad*Sin(Radians(Ang)))+A;
Cy:= Round(-Rad*Cos(Radians(Ang)))+B;
Writeln('Setting Mousespeed to '+IntToStr(MouseSpeed))
MMouse(Cx,Cy,2,2)
RCount:= RCount - 10;
until(RCount = 0)
MMouse(a,b,0,0)
MouseSpeed:= Randomize(TM,2)
end;
end;
begin
SetupSRL;
TargetMMouse(1073, 81,5,5)
end.PS: Don't hold the mouse more than 600 pixels from the target. That will make the whole thing useless.
Ty,
-Knives