更新时间:2020年2月12日22:57:14
源代码:
; File encoding:UTF-8
/*
AutoHotkey 版本: 1.1.09.01
操作系统:Windows XP
作者:sunwind
脚本说明:此为脚本每隔半小时运行一次某动作。
脚本版本: v1.0
Timestamp:2012-12-20 11:40
*/
#Persistent
#SingleInstance,force
start:
TargetTime:= addMinutes(30)
SplashTextOn,300,, 执行下一次动作时间是:%TargetTime%
Sleep, 3000
SplashTextOff
TimeUntilTarget:=TargetTime
TimeUntilTarget -= %A_Now%, Seconds
If TimeUntilTarget <=0
{
MsgBox The target time is alReady past!
ExitApp
}
TimeUntilTarget *= 1000 ; Convert to milliSeconds.
SetTimer, Timer1, %TimeUntilTarget%
Return
Timer1:
SetTimer, Timer1, off ; i.e. perform this subroutine only once.
; In case you want to be warned before it happens, in case it changes the
; active window or otherwise disrupts what the user is working on:
SplashTextOn,,, %TargetTime%到了,It's about to happen.
Sleep, 3000
SplashTextOff
; And here perform whatever action you wanted scheduled:
; ...
Gosub start
Return
addMinutes(minutes=0)
{
sTime+=minutes,Minutes
Return sTime
}
标签:脚本,12,每个,半小时,AHK,TargetTime,版本,TimeUntilTarget From: https://blog.51cto.com/u_15408625/6223745