So what I'm trying to achieve is for this script to execute only ONCE per every idle. At the moment it runs every five seconds UNLESS the msgbox is open in which case it doesn't run at all.
I'd like to somehow set a flag so that it doesn't even consider checking for idle again until it's had some stimuli from the user.
many thanks for any help! What a powerful tool.
Code: Select all
#NoEnv
#SingleInstance Force
#Persistent
SetTimer, Check, 5000;
return
SetMouseDelay, 10
Check:
If (A_TimeIdlePhysical>=5000)
{
if WinExist("ahk_exe Selling.exe")
WinActivate ;
sleep 2
if !A_IsAdmin
{
Run *RunAs "%A_ScriptFullPath%"
ExitApp
}
MouseClick, left, 1284, 82
sleep 2
MouseClick, left, 700,177
MsgBox You have been auto-logged out.
}
return