# How to make my mouse move in a complete circle continuously

## Recommended Posts

Hi, I wanted to write a script to do this. I am sure this must have been done before? Anyone care to give me the link.. or if this is not attempted before then can any1 give a puch in the right direction.. How would I go about doing this?

Edited by Manjish

[font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com

##### Share on other sites

Writing the script again is easier than searching for it. Learn some math(s)!

```HotKeySet("{ESC}", "_exit")

\$centerX = @DesktopWidth / 2
\$centerY = @DesktopHeight / 2
\$i = 0
While 1
MouseMove(\$centerX + (\$radius * Cos(\$i)), \$centerY + (\$radius * Sin(\$i)),0)
\$i += 0.05
Sleep(10)
WEnd

Func _exit()
Exit
EndFunc```

##### Share on other sites

I'd be careful with that script. The joke potential is pretty high here....

##### Share on other sites

I don't care about sharing potential joke scripts as long as any idiot could potentially write it. Beside that, it was posted a number of times before.

##### Share on other sites

Learn some math(s)!

I'm trying... how about spirals?
```HotKeySet("{ESC}", "_exit")

\$pi = 4 * ATan(1)
\$centerX = @DesktopWidth / 2
\$centerY = @DesktopHeight / 2
\$RMax = @DesktopHeight / 2
\$R = 0
While 1
For \$i = 0 To 2 * \$pi Step 0.03125
MouseMove(\$centerX + (\$R * Cos(\$i)), \$centerY + (\$R * Sin(\$i)), 0)
\$R += 0.5
If \$R > \$RMax Then \$R = 0
Sleep(10)
Next
WEnd

Func _exit()
Exit
EndFunc   ;==>_exit```

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

##### Share on other sites

Breathing spirals..

```HotKeySet("{ESC}", "_exit")

\$pi = 4 * ATan(1)
\$centerX = @DesktopWidth / 2
\$centerY = @DesktopHeight / 2
\$RMax = @DesktopHeight / 2
\$R = 0
\$S = 0.03125
\$g = 0
While 1
For \$i = 0 To 2 * \$pi Step \$s
If \$g = 0 then
MouseMove(\$centerX + (\$R * Cos(\$i)), \$centerY + (\$R * Sin(\$i)), 0)
\$R += 0.5
If \$R > \$RMax Then \$g = 1
endif
If \$g = 1 then
MouseMove(\$centerX + (\$R * Cos(\$i)), \$centerY + (\$R * Sin(\$i)), 0)
\$R -= 0.5
If \$R < 0 Then \$g = 0
endif
Sleep(10)
Next
WEnd

Func _exit()
Exit
EndFunc   ;==>_exit```

How about someone do a figure 8?

Edit: turn mouse trails on...

Edited by Volly

##### Share on other sites

Figure 8 is easy.

```HotKeySet("{ESC}", "_exit")

\$pi = 4 * ATan(1)
\$centerX = @DesktopWidth / 2
\$centerY = @DesktopHeight / 2
\$R = 100
While 1
For \$i = 0 To 2 * \$pi Step \$pi / 20
MouseMove(\$centerX - 100 + (\$R * Cos(\$i)), \$centerY + (\$R * Sin(\$i)), 0)
Sleep(10)
Next
For \$i = 3 * \$pi To \$pi Step \$pi / -20
MouseMove(\$centerX + 100 + (\$R * Cos(\$i)), \$centerY + (\$R * Sin(\$i)), 0)
Sleep(10)
Next
WEnd

Func _exit()
Exit
EndFunc   ;==>_exit```

I dare someone to do a four leaf clover!

##### Share on other sites

Figure 8 is easy.

```HotKeySet("{ESC}", "_exit")

\$pi = 4 * ATan(1)
\$centerX = @DesktopWidth / 2
\$centerY = @DesktopHeight / 2
\$R = 100
While 1
For \$i = 0 To 2 * \$pi Step \$pi / 20
MouseMove(\$centerX - 100 + (\$R * Cos(\$i)), \$centerY + (\$R * Sin(\$i)), 0)
Sleep(10)
Next
For \$i = 3 * \$pi To \$pi Step \$pi / -20
MouseMove(\$centerX + 100 + (\$R * Cos(\$i)), \$centerY + (\$R * Sin(\$i)), 0)
Sleep(10)
Next
WEnd

Func _exit()
Exit
EndFunc   ;==>_exit```

I dare someone to do a four leaf clover!

Not very much like a four leaf clover but I'm a terrible artist.

```#include <windowsconstants.au3>
HotKeySet("{ESC}", "_exit")
\$pi = 4 * ATan(1)
\$centerX = @DesktopWidth / 2
\$centerY = @DesktopHeight / 2
\$R = 100
\$beta = 2*\$pi / 9;half the angle for a leaf
;\$beta = \$pi/4;no gap between leaves
\$L = \$R / Cos(\$beta)
\$e = \$R * Tan(\$beta)
\$straightstep = 10;smaller = slower
\$curvestep = \$pi/15;smaller = slower
\$Dots = 140;
\$dotn=0
Dim \$G[\$Dots]
for \$q = 0 to \$Dots - 1
\$G[\$q] = GUICreate("",5,5,\$centerX, \$centerY,\$WS_POPUP)
GUISetState()
GUISetBkColor(0x4444FF)
next
While 1
For \$i = 0 To 3 * \$pi/2 Step \$pi / 2
\$Bx = \$L * Sin(\$i)
\$By = \$L * Cos(\$i)

For \$j = 0 To \$R Step \$straightstep
;MouseMove(\$centerX + \$j * cos(\$i - \$beta), \$centerY + \$j * sin(\$i - \$beta), 0)
makedot(\$centerX + \$j * cos(\$i - \$beta), \$centerY + \$j * sin(\$i - \$beta),\$dotn)
Sleep(5)
Next
\$ax = \$L * Cos(\$i)+\$centerX
\$ay = \$L * Sin(\$i)+\$centerY
For \$k = -\$pi / 2 - \$beta + \$i To \$pi / 2 + \$beta + \$i Step \$curvestep
;MouseMove(\$ax + \$e * cos(\$k), \$ay + \$e * sin(\$k), 0)
makedot(\$ax + \$e * cos(\$k), \$ay + \$e * sin(\$k),\$dotn)
Sleep(5)
Next
for \$m = \$R to 0 step -\$straightstep
;MouseMove(\$centerX + \$m * cos(\$i + \$beta), \$centerY + \$m * sin(\$i + \$beta), 0)
makedot(\$centerX + \$m * cos(\$i + \$beta), \$centerY + \$m * sin(\$i + \$beta),\$dotn)
Sleep(5)
Next

Next

WEnd

Func makedot(\$dx,\$dy,ByRef \$di)

winmove(\$G[\$di],"",\$dx,\$dy)

#cs
for \$f = \$di to 0
winsettrans(\$g[\$f],"",255-200/\$Dots)
Next
#ce
\$di += 1
if \$di > \$Dots - 1 then \$di = 0

EndFunc

Func _exit()
Exit
EndFunc   ;==>_exit```
Edited by martin

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

##### Share on other sites

I wrote a function for this ages ago:

http://www.autoitscript.com/forum/index.php?showtopic=56337&view=findpost&p=427527

##### Share on other sites

Thanks all for replying.. I am an Engineer.. So I know my maths very well, thank you!!

But then I was a bit lazy!! And I have bigger things to work on.. This is just a part of it.. So, wouldn't mind some readymade script to do this..

BTW, the four leaf clover thing was amazing..

[font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com

##### Share on other sites

Thanks all for replying.. I am an Engineer.. So I know my maths very well, thank you!!

But then I was a bit lazy!! And I have bigger things to work on.. This is just a part of it.. So, wouldn't mind some readymade script to do this..

BTW, the four leaf clover thing was amazing..

It's part of your script, I find that funny.

oh my school starts to day, okay it's an open house, it start tomorrow. (A-Level first year)

##### Share on other sites

It's part of your script, I find that funny.

oh my school starts to day, okay it's an open house, it start tomorrow. (A-Level first year)

What's funny in that?

[font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com

##### Share on other sites

What's funny in that?

Can't remember what is your original script is, I replied to that. That's all I remember.

##### Share on other sites

There is no original script. Do you have some kind of attention deficit syndrome?

##### Share on other sites

@WolfWorld

Ah, don't worry man, I am wroking on multiple projects.. And I am sure you have answered me on multiple ocassions.. so I too don't remember..

Ok, the script I am talking abt is for another guy..

If you remember.. I was helping a guy 2-3 weeks back called "Simolokid" workup a lock program here

In his script he has given a hotkey for a function called Mouseover().. I wanted to put this mouse moving in a circle in that function, just for fun sake..

Edited by Manjish

[font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com

##### Share on other sites

There is no original script. Do you have some kind of attention deficit syndrome?

Nop, I mean post. It's very very late here. May be some body here have one

## Create an account or sign in to comment

You need to be a member in order to leave a comment

## Create an account

Sign up for a new account in our community. It's easy!

Register a new account

×

• Wiki

• Back

• Git

## Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.