dmegalo Posted May 20, 2006 Share Posted May 20, 2006 I wrote this little bit to keep machines from going on standby. It's short & sweet but I would rather launch a user prompt once the script is initiated that stays up until the user clicks OK. The point of the user prompt will be to click OK to exit the program (called mousemover.exe). Currently I set a hotkey to exit the program. Any help is or suggestions will be appreciated. Thank you. My script follows. ; Script Start HotKeySet("x", "_exit") While 1 MouseMove(10, 15, 25) MouseMove(15, 10, 25) Sleep(60000) MouseMove(10, 15, 25) MouseMove(15, 10, 25) WEnd Func _exit() Exit 1 EndFunc ; End Of Script Link to comment Share on other sites More sharing options...
ChrisL Posted May 20, 2006 Share Posted May 20, 2006 (edited) Hi Was bored so played with this a little. This has a GUI window which gets moved by the mouse every 30 seconds then possitions the mouse ready for you to click the button to kill it, it still kind of acts as a screen saver by moving the window. #include <GuiConstants.au3> opt ("GuiOnEventmode",1) GuiCreate("Staying Alive", 232, 95,-1, -1 , BitOR($DS_MODALFRAME, $WS_CAPTION )) $Button_1 = GuiCtrlCreateButton("Quit Mouse Mover", 20, 10, 190, 70) GUICtrlSetOnEvent(-1, "_exit") GuiSetState() WinSetOnTop ( "Staying Alive", "", 1 ) HotKeySet("x", "_exit") While 1 Sleep(30000) WinSetOnTop ( "Staying Alive", "", 1 ) $pos = WinGetPos ( "Staying Alive" ) $newX = Random ( 5, (@DesktopWidth - $pos[2]) - 5) $newY = Random ( 5, (@DesktopHeight - $pos[3]) -5) MouseClickDrag ( "Left", $pos[0]+ 5, $pos[1] + 5, $newX , $newY ) MouseMove ($newX + 115, $newY + 80) WEnd Func _exit() Exit 1 EndFunc Edited May 20, 2006 by ChrisL [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
dmegalo Posted May 20, 2006 Author Share Posted May 20, 2006 Thanks ChrisL. You hit this one on the nose. Exactly what I was looking for. Works like a charm. I'll post the final product (now called staying alive in tribute to you) in scripts and scraps. Muchas Gracias. Link to comment Share on other sites More sharing options...
ChrisL Posted May 20, 2006 Share Posted May 20, 2006 LOL no problem [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now