Infantry001
2006-11-07 13:54:49
How should i go about making a mouse movement? If you could list steps, i would be thankful. Please no "Use math combined with movemousesmoothex", cuz that doesnt help at all lol.
2006-11-07 13:54:49
2006-11-07 14:09:11
{*******************************************************************************
function MMouse(dx, dy, RandX, RandY: Integer): Boolean;
By: BenLand100/Mutant Squirrle
Description: Moves the mouse along a spline to (dx, dy) with an ending randomness of RandX and RandY (If BenMouse=True (Default))
Global var BenMouse determines the behaviour of MMouse.
If an error occures the return value is false insted of crashing your script
*******************************************************************************}2006-11-07 14:41:57
2006-11-07 14:49:05
{Sine wave, use in paint with pencil}
Program New;
{.include SRL/SRL.scar}
Type
CoArray = Record
x, y : Integer;
End;
Function MakePath() : Array Of CoArray;
Var
NArray : Array Of CoArray;
i : Integer;
Begin
i := 0;
SetArrayLength(NArray, 100);
Repeat
NArray[i].x := i*15 + Random(10);
NArray[i].y := Round(Sin((i/2)*1) *50) + Random(1);
i := i + 1;
Until(i =40)
Result := NArray;
End;
Var
myarray : Array of CoArray;
i : Integer;
Begin
SetupSRL;
SetArrayLength(myarray, 100000)
//mousespeed:=30;
myarray := MakePath();
MMouse(50, 200, 0, 0);
holdmouse(50,200,true);
Sleep(10) Repeat
//repeat
// wait(4);
//until isfkeydown(11);
MMouse(myarray[i].x + 50, myarray[i].y + 200, 0, 0);
i := i + 1;
Sleep(5);
Until((i = 40) or isfkeydown(12)) ;
getmousepos(x,y);
releasemouse(x,y,true);
End.
2006-11-07 15:04:14
2006-11-07 15:29:12
2006-11-07 15:45:25
2006-11-07 17:22:30
2006-11-07 18:47:03
2006-11-07 20:50:34
NArray[i].x :=
NArray[i].y := so that i is the number of degrees, and the x and y are figured out with the trig stuff I was talking about. Also add a paramter for radius, and change the array length etc.2006-11-07 21:43:52
2006-11-07 21:47:04
2006-11-07 22:01:58
2006-11-07 22:08:05
2006-11-07 22:10:43
2006-11-07 22:17:24
2006-11-07 22:42:45
{draws circle, set target on paint, put mouse above paint, press f9 to start f12 to stop
}
Program New;
{.include SRL/SRL.scar}
Type
CoArray = Record
x, y : Integer;
End;
const r=50; //radius
randy=1; //1 for randomness, 51 for none
Function MakePath(radius:integer) : Array Of CoArray;
Var
NArray : Array Of CoArray;
i ,rany,ranx,ranradx,ranrady: Integer;
Begin
i :=0;
SetArrayLength(NArray, 361);
Repeat
if random(50)=randy then
rany:=random(3);
if random(50)=randy then
ranx:=random(3);
ranradx:=radius;
if random(50)=randy then
ranradx:= ((radius-1)+random(1));
ranrady:=radius;
if random(50)=randy then
ranrady:= ((radius-1)+random(1));
i := i + 1;
NArray[i].y := round(sin(radians(i))*ranrady)+rany;
NArray[i].x := round(cos(radians(i))*ranradx)+ranx;
Until(i =360)
Result := NArray;
End;
Var
myarray : Array of CoArray;
i : Integer;
Begin
SetupSRL;
SetArrayLength(myarray, 100000)
//mousespeed:=30;
getmousepos(x,y);
mouse(x,y,0,0,true);
mmouse(x+r,y,0,0)
holdmouse(x+r,y,true);
repeat
i:=0;Sleep(10)
myarray := MakePath(r);
Repeat
//repeat
// wait(4);
//until isfkeydown(11);
i := i + 1;
MMouse(myarray[i].x + x, myarray[i].y + y, 0, 0);
Sleep(3);
Until((i = 360) or isfkeydown(12)) ;
until isfkeydown(12);
getmousepos(x,y);
releasemouse(x,y,true);
End.
2006-11-08 00:28:51
2006-11-08 00:46:00
From: Pyro
I learnt sine and cos WAVES in my second to last year at school. And for triangles i learnt it one year before. Actually the more i think about it the more a sine and cosine waves eem logical. Just adding co effiecents everywhere slightly to make it random. hm i may try it out.
2006-11-08 16:18:47
2006-11-08 17:33:08
2006-11-08 19:30:29
2006-11-08 20:09:03
2006-11-08 21:26:50