Sign in to follow this  
Followers 0
SaruzzU

Move Mouse on Circle

5 posts in this topic

I have created a script for move the mouse, i don't want linear move.

Is possible insert a different move or insert the disturb on movement?

Another question, is possible generate a movement circular?

Share this post


Link to post
Share on other sites



Look here

Share this post


Link to post
Share on other sites

And here is my version:

#include <Math.au3>

moveMouseCircle(@DesktopWidth / 2, @DesktopHeight / 2, 100, 0, 90, 10, 1)

moveMouseCircle(@DesktopWidth / 2, @DesktopHeight / 2, 100, 1, 90, 10, 5)

Func moveMouseCircle($h, $k, $radius, $direction = 0, $startangle = 0, $delay = 10, $step = 1)
    ;h = Center X
    ;k = Center Y
    ;radius in pixels
    ;direction: 0 = clockwise (default), 1 = counter-clockwise
    ;start angle in degrees (0-360): default is 0
    ;delay in milliseconds: default 10
    ;step in degrees: default 0
    
    $pi = 3.14159265358979
    
    If $direction Then
        $startangle = 360 - $startangle
    EndIf
    
    $start = $startangle
    $end = 360    
    
    For $Z = 1 to 2
        For $A = $start to $end Step $step
            If $direction Then
                $X = $h - sin(_Radian($A)) * $radius        
            Else
                $X = $h + sin(_Radian($A)) * $radius    
            EndIf
            $Y = $k - cos(_Radian($A)) * $radius
            MouseMove ( $X, $Y, 0)
            Sleep($delay)
        Next
        $start = 0
        $end = $startangle        
    Next
    
EndFunc

Share this post


Link to post
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
Sign in to follow this  
Followers 0