Jump to content

How to make my mouse move in a complete circle continuously


Manjish
 Share

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? :D

Edited by Manjish
[font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com
Link to comment
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
$radius = 300
$i = 0
While 1
    MouseMove($centerX + ($radius * Cos($i)), $centerY + ($radius * Sin($i)),0)
    $i += 0.05
    Sleep(10)
WEnd

Func _exit()
    Exit
EndFunc
Link to comment
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

:D

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
Link to comment
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
Link to comment
Share on other sites

Figure 8 is easy. :D

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!

Edited by Manadar
Link to comment
Share on other sites

Figure 8 is easy. :D

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.
Link to comment
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
Link to comment
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)

Link to comment
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
Link to comment
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.. :D

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
Link to comment
Share on other sites

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

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...