dufran3 Posted March 30, 2011 Share Posted March 30, 2011 I'm trying to figure out how to write a script, that will look for user input...in some form...if none occurs after 10 consecutive minutes, then the script will send some sort of input that will reset the screen lock in windows, then wait again. I have no idea where to start with this. Any ideas? Link to comment Share on other sites More sharing options...
AppTux Posted March 30, 2011 Share Posted March 30, 2011 You could look for mouse movement with MouseGetPos() and look every second if the position is different. But I ever heard of a DllCall() function so Windows does everything for you. I really don't know again what it was.. I usually don't use the DllCall() function. PowerSlide2UnlockiPhone look-a-like program you can use to lock your pc, you can't access your desktop again until the password is entered and the slider slided to the right. (really proud of it)-- After a time AutoIt and Windows, I switched to Mac. Don't expect me to answer anymore. Link to comment Share on other sites More sharing options...
JohnOne Posted March 30, 2011 Share Posted March 30, 2011 If you just send some input regardless of whether there is user input, would that have the desired affect? I done it once just moving the mouse a pixel and back every few minutes, to save laptop dimming screen when watching a film on it. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 30, 2011 Moderators Share Posted March 30, 2011 dufran3,_Timer_GetIdleTime will tell you how long the user has been idle - then just move the mouse a bit as JohnOne suggested. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
dufran3 Posted March 30, 2011 Author Share Posted March 30, 2011 This is what I have so far, not sure how to move the mouse 1 pixel though.... #include <Timers.au3> ;Screen Timeout Countermeasure While 1 If @error = -1 Then ExitLoop $timer = _Timer_GetIdleTime() If $timer >900,000 Then MsgBox(0,'','Moving the Mouse') MouseMove(+1,0) EndIf Wend Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 30, 2011 Moderators Share Posted March 30, 2011 dufran3,Perhaps MouseGetPos and MouseMove might help here? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
dufran3 Posted March 30, 2011 Author Share Posted March 30, 2011 (edited) It always has to be you making me look dumb...lol.. this? #include <Timers.au3> ;Screen Timeout Countermeasure While 1 If @error = -1 Then ExitLoop $timer = _Timer_GetIdleTime() If $timer >900,000 Then MsgBox(0,'','Moving the Mouse') $MoPosition = MouseGetPos() $xPos = $MoPosition[0] $yPos = $MoPosition[1] MouseMove($xPos +1,$yPos +1) EndIf Wend Edited March 30, 2011 by dufran3 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 30, 2011 Moderators Share Posted March 30, 2011 dufran3,It always has to be you making me look dumbCertainly not my intention - only trying to help without giving the entire answer. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
dufran3 Posted March 30, 2011 Author Share Posted March 30, 2011 lol, yeh I realize, thanks for all the help! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 30, 2011 Moderators Share Posted March 30, 2011 dufran3, My pleasure! M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
JohnOne Posted March 30, 2011 Share Posted March 30, 2011 Probably best to move the mouse back to where you found it after moving +1, so it dosent end up somewhere it cannot move anymore. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
dufran3 Posted March 30, 2011 Author Share Posted March 30, 2011 Probably best to move the mouse back to where you found it after moving +1, so it dosent end up somewhere it cannot move anymore.hmmm...noted, I will look into doing that Link to comment Share on other sites More sharing options...
RichardL Posted March 30, 2011 Share Posted March 30, 2011 And you need some delay... EndIf Sleep(60000) Wend Richard. 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