Jump to content

[Mouse] sleepMotion during sleep


YopSolo
 Share

Recommended Posts

Here is a contribution, don't hesitate to correct my script if something wrong i am fresh new to autoIt ^^
 
replace boring sleep() with fun :P
 
Usage 

sleepMotion(8000, 100)

 
effect
your mouse is centered on screen and move along a circular motion of 100 px during 8 sec

 

 

Func sleepMotion($delay, $radius = 50)   
   
 Local $start = TimerInit();
 Local $waiting = True;   
 Local $angle = 0;
   
 While $waiting
   $pos = MouseGetPos();
   MouseMove( (@DesktopWidth * .5) + (Cos($angle) * $radius) ,(@DesktopHeight * .5) + (Sin($angle) * $radius), 1 );
   $angle = $angle + .01;
   if TimerDiff($start) >= $delay  Then
     $waiting = False;
   EndIf
 WEnd   
   
EndFunc

ps : sorry i put ';' at eol i know this is useless in autoit script but ... i am sure that you understand ;)

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...