BrianYong Posted February 3 Share Posted February 3 Hi Everyone, is there any code that will click at one point at one specific time? Code below is the code that ChatGPT gave, it will click at the X Y point, but it would't follow the time. It will click as soon as I execute it #include <MsgBoxConstants.au3> #include <Date.au3> Local $iX = 99 Local $iY = 766 Local $sTimeToClick = "18:55:00" While 1 If _NowTime() >= $sTimeToClick Then MouseClick("left", $iX, $iY, 1, 0) ExitLoop EndIf Sleep(1000) ; Check every second WEnd Link to comment Share on other sites More sharing options...
Developers Jos Posted February 3 Developers Share Posted February 3 (edited) 21 minutes ago, BrianYong said: It will click as soon as I execute it Correct as that is what the code does, so try to understand the code an fix it as we do not run a forum to correct chatgpt code and only help members that re willing to learn and think for themselves. What is this for anyways? Edited February 3 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Musashi Posted February 3 Share Posted February 3 With this you can analyze what is going on : #include <Date.au3> HotKeySet("{ESC}", "Terminate") ; just to terminate the script by the user Local $iX = 99 Local $iY = 766 Local $sTimeToClick = "13:59:00" While 1 If _NowTime(5) >= $sTimeToClick Then ConsoleWrite("Click" & @CRLF) ; *** just info MouseClick("left", $iX, $iY, 1, 0) ExitLoop EndIf ConsoleWrite("NowTime = " & _NowTime(5) & " TimeToClick = " & $sTimeToClick & @CRLF) ; *** just info Sleep(1000) ; Check every second WEnd Func Terminate() Exit EndFunc ;==>Terminate "In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." 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