[AHK]每个半小时运行一次

此为脚本每隔半小时运行一次某动作。

; File encoding:UTF-8
/*
AutoHotkey 版本: 1.1.09.01
操作系统:Windows XP
作者:sunwind <1576157@qq.com>
博客:http://blog.csdn.net/liuyukuan
脚本说明:此为脚本每隔半小时运行一次某动作。
脚本版本: 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
}

鸣谢

本文章由“没钱上网的花大爷”收集于CSDN的liuyukuan作者的[AHK]每个半小时运行一次并对其解释标注;

更多精彩脚本与文章,请关注ahk官方中文网:www.autoahk.com

或者请加入我们:QQ群:

1.348016704(autohotkey高手群/RPA)此群付费但是内有众多高手,推荐加

2:3222783 (autohotkey高级群)

3:470710096(autohotkey终极群)

人已赞赏
AHKV1

test hyde

2020-3-10 22:27:40

AHKV1

test.

2020-3-10 22:37:33

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
搜索