I need a script that will left mouse click at a specific time of day.

Get help with using AutoHotkey and its commands and hotkeys
yeto
Posts: 33
Joined: 03 Dec 2017, 07:21

I need a script that will left mouse click at a specific time of day.

26 Jun 2019, 01:50

I need a script that will left mouse click at a specific time of day. I found the following (see link)which is working but was wondering if there is now simpler code that will do the same? I will be at the computer and can position the mouse so I won't need x, y coordinates. Any help will be greatly appreciated.

https://autohotkey.com/board/topic/485-need-to-program-a-left-mouse-click-to-run-at-a-certain-time/

Code: Select all

#persistent

TargetTime = 1800

 

StringLeft, TargetDateTime, A_Now, 8   ; Put just YYYYMMDD into the variable.
TargetDateTime = %TargetDateTime%%TargetTime%
TimeUntilTarget = %TargetDateTime%
TimeUntilTarget -= %A_Now%, seconds
if TimeUntilTarget < 0
{
     MsgBox The target time is already past!
     return
}
TimeUntilTarget *= 1000 ; Convert to milliseconds.
TimeUntilTarget -= 1000
SetTimer, ClickTimer, %TimeUntilTarget%
return

ClickTimer:
SetTimer, ClickTimer, off  ; i.e. do only one click
MouseClick, left

Return to “Ask For Help”

Who is online

Users browsing this forum: Albireo, omar, Spikea and 201 guests