PsaltyDS 39 Posted August 3, 2010 Some thoughts: 1. Monitor how long the console has been idle with _Timer_GetIdleTime() 2. Only twitch the mouse when you have to, if idle time is getting too high 3. Only twitch it a tiny amount (one, or a couple of pixels X/Y) 4. Immediately put the mouse back to the coordinate it was at before, saved with MouseGetPos() This may all be moot if there is a DLL trick to reset the idle timer (no twitching would be required), but I never looked for it, so I don't know if there is one or not. 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 this post Link to post Share on other sites
TonyP 0 Posted August 3, 2010 Does anyone have a quick little script to keep the screensaver from activating? I was just going to do some quick dumb script that moves the mouse every few seconds. But then i got to wondering if there was a better way to do it. Searching the forums didn't really turn anything up, but I can't help but think that someone has done this before and posted about it. Share this post Link to post Share on other sites
mlowery 1 Posted August 3, 2010 Here's one I've used while watching long online videos, almost exactly like PsaltyDS says. You can set the $idle_limit to anything as long as its less than the time you've set for a screensaver, and just hit BACKSPACE to disable it when you don't need it anymore. expandcollapse popup#include <Date.au3> ;=============================================================================== ; Description: Moves mouse periodically to prevent screen saver ;=============================================================================== $idle_limit = 2 * 60 * 1000; 2 minutes * 60 sec * 1000 msec (should set this to less than screensaver time) $offset = 1 ; how far to move the mouse ;=============================================================================== ; MAIN ;=============================================================================== HotKeySet("{BACKSPACE}", "done") While 1 If _Get_Idle_Ticks() > $idle_limit Then $mouse = MouseGetPos() MouseMove($mouse[0] + $offset, $mouse[1] + $offset) $offset = -$offset EndIf Sleep(100) WEnd ;=============================================================================== ; Description: ; Parameter(s): ; Requirement(s): None ; Return Value(s): ; Note(s): ;=============================================================================== Func done() HotKeySet("{BACKSPACE}") Send("{BACKSPACE}") ; Backspace is passed through in case user forgets to disable the script Exit EndFunc ;=============================================================================== ; Description: Returns number of ticks since system was idle (determined by mouse/key input) ; Parameter(s): None ; Requirement(s): None ; Return Value(s): Milliseconds since last user input (mouse/key) ; Note(s): ;=============================================================================== Func _Get_Idle_Ticks() Local $struct = DllStructCreate("uint;dword"); DllStructSetData($struct, 1, DllStructGetSize($struct)); DllCall("user32.dll", "int", "GetLastInputInfo", "ptr", DllStructGetPtr($struct)) Local $last_active = DllStructGetData($struct, 2) Return _Date_Time_GetTickCount() - $last_active EndFunc Share this post Link to post Share on other sites
60aside 0 Posted August 3, 2010 I use this to disable the screensaver with a registry entry. And prevent GPO from refreshing the policies until I have finished running a script. RegWrite("HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Control Panel\Desktop","ScreenSaveActive", "REG_SZ", "0") RegWrite("HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Control Panel\Desktop","ScreenSaverIsSecure", "REG_SZ", "0") RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Group Policy\{A2E30F80-D7DE-11d2-BBDE-00C04F86AE3B}","NoBackgroundPolicy", "REG_DWORD", "1") RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Group Policy\{A2E30F80-D7DE-11d2-BBDE-00C04F86AE3B}","NoGPOListChanges", "REG_DWORD", "1") Share this post Link to post Share on other sites
JBeardNC 0 Posted August 4, 2010 I did exactly what you suggested about a year ago and created a script that moves the cursor back and forth a couple of pixels every few minutes. May not be the most well written script you've ever seen but it works great for me. Even puts a little tray icon for you to pause it when needed. I run it all day. TraySetIcon ("Shell32.dll", 28) TraySetToolTip ("Screen Saver Terminator" & @CRLF & "Moves mouse every couple of minutes to prevent machine from going idle.") While 1 $x = MouseGetPos (0) sleep (120000) $Current = MouseGetPos (0) If $Current = $x Then $y = MouseGetPos (1) MouseMove ($Current + 20, $y, 5) MouseMove ($x, $y, 5) EndIf WEnd Share this post Link to post Share on other sites
Ascend4nt 131 Posted August 4, 2010 Just toggle it on and off. Heres a user's contribution: Setting Screen Saver My contributions:Performance Counters in Windows - Measure CPU, Disk, Network etc Performance | Network Interface Info, Statistics, and Traffic | CPU Multi-Processor Usage w/o Performance Counters | Disk and Device Read/Write Statistics | Atom Table Functions | Process, Thread, & DLL Functions UDFs | Process CPU Usage Trackers | PE File Overlay Extraction | A3X Script Extract | File + Process Imports/Exports Information | Windows Desktop Dimmer Shade | Spotlight + Focus GUI - Highlight and Dim for Eyestrain Relief | CrossHairs (FullScreen) | Rubber-Band Boxes using GUI's (_GUIBox) | GUI Fun! | IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) | Magnifier (Vista+) Functions UDF | _DLLStructDisplay (Debug!) | _EnumChildWindows (controls etc) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters | Screensaver, Sleep, Desktop Lock Disable | Full-Screen Crash RecoveryWrappers/Modifications of others' contributions:_DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity)UDF's added support/programming to:_ExplorerWinGetSelectedItems | MIDIEx UDF (original code: eynstyne)(All personal code/wrappers centrally located at Ascend4nt's AutoIT Code) Share this post Link to post Share on other sites
TonyP 0 Posted August 4, 2010 Thanks for all the tips guys. Much better than my mousemove stuff... Share this post Link to post Share on other sites