Skrip Posted February 23, 2006 Posted February 23, 2006 Is there any way for autoit to detect if the mouse doesn't move for X amount of time a script will activate? (Just like the screen saver does) [left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]
Valuater Posted February 23, 2006 Posted February 23, 2006 $pos1 = mouse get position $Time = timer Initiate while 1 $dif = time dif If $dif > $How_long then $pos2 = mouse get position if $$pos1 = $pos2 then run( program) endif endif Sleep(20) Wend 8)
Skrip Posted February 23, 2006 Author Posted February 23, 2006 Sorry, i'm not sure how to use that I really havn't used gthe get corrdinates or uh this part. $dif = time dif If $dif > $How_long then $pos2 = mouse get position Please explain further [left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]
cdkid Posted February 23, 2006 Posted February 23, 2006 that's "psuedo" code, look in the helpfile for functions that sound like that ~cdkid AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!
Valuater Posted February 23, 2006 Posted February 23, 2006 Sleep (2000); set your mouse ( dont move it ) Sleeper() Func Sleeper() $How_long = 5000 $pos1 = MouseGetPos() $Time = TimerInit() While 1 $dif = TimerDiff($Time) If $dif > $How_long Then $pos2 = MouseGetPos() If $pos1[0] = $pos2[0] Then Run("notepad.exe") Return EndIf EndIf Sleep(20) WEnd EndFunc 8)
Moderators SmOke_N Posted February 23, 2006 Moderators Posted February 23, 2006 (edited) that's "psuedo" code, look in the helpfile for functions that sound like that~cdkidYeah ... But I think this:Sorry, i'm not sure how to use that I really havn't used gthe get corrdinates or uh this part. $dif = time difIf $dif > $How_long then$pos2 = mouse get positionPlease explain furtherWas "pseudo" post for: I don't feel like reading up on that, could you just write it out for me Edit:Ugh... How did I know Val would!! Edited February 23, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
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