Sign in to follow this  
Followers 0
Skrip

AFK

6 posts in this topic

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]

Share this post


Link to post
Share on other sites



$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)


NEWHeader1.png

Share this post


Link to post
Share on other sites

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]

Share this post


Link to post
Share on other sites

that's "psuedo" code, look in the helpfile for functions that sound like that

:o

~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!

Share this post


Link to post
Share on other sites

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)


NEWHeader1.png

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

that's "psuedo" code, look in the helpfile for functions that sound like that

;)

~cdkid

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

If $dif > $How_long then

$pos2 = mouse get position

Please explain further

Was "pseudo" post for:

I don't feel like reading up on that, could you just write it out for me :o

Edit:

Ugh... How did I know Val would!! :geek:

Edited by SmOke_N

[center]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.[/center]

Share this post


Link to post
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
Sign in to follow this  
Followers 0