我需要一个自动热键脚本,该脚本会在一天中的特定时间点单击鼠标

时间:2019-06-26 15:22:58

标签: autohotkey

我需要一个脚本,该脚本将在一天的特定时间单击鼠标。我发现以下内容(请参阅链接)正在运行,但想知道现在是否有更简单的代码(此代码为old)可以做到吗?我将坐在电脑前,可以定位鼠标,因此不需要x,y坐标。任何帮助将不胜感激。

我从这里复制了代码:

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

代码:

#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

0 个答案:

没有答案