首页 > 其他分享 >[AHK]每个半小时运行一次

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

时间:2023-04-25 13:08:19浏览次数:36  
标签:脚本 12 每个 半小时 AHK TargetTime 版本 TimeUntilTarget


更新时间: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

相关文章

  • [ahk]让TC 识别已经打开的路径tab,若已存在则仅激活不重复打开。
    #SingleInstance,force;FileName:OpenInTC.ahk;Fileencoding:UTF-8BOM/*AutoHotkey版本:1.1.9.0操作系统:WindowsXP/Vista/7作者:sunwind设计目的:[ahk]让TC识别已经打开的路径tab,若已存在则仅激活不重复打开。设计思路:先保存当前配置,再检测其是否存......
  • 用热键win+字母激活任务栏上的按钮[ahk]
    ;bug:热键请自行修改,发现按win+dwin+l等和系统热键冲突,可以改成空格键或Capslock键+字母;Fileencoding:UTF-8AutoHotkey版本:1.0.9.1操作系统:WindowsXP脚本说明:QuicktaskswitchingwithWin+[a,b,...,z]脚本版本:v1.0Timestamp:2012-12-2014:12:56*......
  • [ahk]右键菜单打开文件所在文件夹(快捷方式也适用)
    功能:能打开文件所在路径并定位到文件上,能正确解析lnk所指文件的目录。 copypath.ahk 文件如下: #NoTrayIconClipboard=%1% openpath.ahk文件如下:#NoTrayIconClipboard=%1%Run,%"Explorer.exe/select,"Clipboard说明一:剪贴板内容被置为文件路径了。说明二:需要注册到......
  • [AHK]热键获取TC当前的路径
    原创部分:热键alt+shif+c复制当前tc窗口中的路径。#IfWinActiveahk_classTTOTAL_CMD!+c::PostMessage1075,2029,0,,ahk_classTTOTAL_CMD;复制完整路径return#IfWinActive2010年04月11日星期日17:07一故事的开始,寻找TotalCommander(以下简称TC)的快捷键--“在下已经严重鼠......
  • 用自己指定的模板创建ahk脚本
    在windows右键弹出菜单的新建菜单中加入“AutoHotkey脚本” 1.首先写好模板文件,随便保存在一个地方,比如我是“X:\AutoHotkey\AutoHotkey\SHELLNEW\Template.ahk”;2.打开注册表(regedit),找到[HKEY_CLASSES_ROOT]->[.ahk](没有的话,自己新建项.ahk);3.在[.ahk]下新建项[ShellN......
  • [ahk]获取文华财经全自动运行模组信号记录
    #Persistent#SingleInstanceForceDetectHiddenWindows,OnControl:="SysListView323"WinTitle:="全自动运行模组ahk_class#32770"WinText:="List1"ControlClick,Button26,%WinTitle% ControlGet,......
  • [AHK]倒计时牌(高考还有多少天这类的)
    ;DaysLeft.ahk;Authorsnwind/*[config]DateTarget=20151204000000DateFrom=20151106000000*/;~#SingleInstance,force;~ListLines,OnFormatTime,today,,yyyyMMddIniRead,DateTarget,%A_ScriptFullPath%,config,DateTarge......
  • [ahk]读取excel文件实例
    EXCEL内容如下:AutoHotkey代码如下:#Persistent#SingleInstance,force;2015年1月4日;sunwind;读取excel实例excel:=ComObjActive("Excel.Application")filepath:=A_ScriptDir."\循环读取.xlsx";自动运行、初始化Runnotepadxls:=Check(fil......
  • [AHK]精确计时到秒
    DllCall("QueryPerformanceFrequency","Int64*",QuadPart)DllCall("QueryPerformanceCounter","Int64*",CounterBefore)Sleep1000DllCall("QueryPerformanceCounter","Int64*",CounterAfter)MsgBox%......
  • 【ahk】为QQ增加激活主面板的热键
    本脚本只是实现了热键激活不在前台的QQ主面板,并不是热键打开主面板。使用方法:先手动打开QQ主面板,并且不要最小化,然后运行本脚本,此脚本会探测到主面板的id,然后绑定热键win+z来用于激活动作。/*为QQ增加热键这个脚本前提是,你要激活的窗口需要事先打开的(且主面板不能最小化)。然后......