Maybe? I'm not sure what you're after:
Code: Select all
#NoEnv
target_time = 1100
; for testing
target_time = %A_Now% ; current date-time
EnvAdd, target_time, 5, Minutes ; add 5 minutes
StringMid, target_time, target_time, 9, 4 ; get the HH24MI part of the date-time stamp
; end of test code
target = %A_YYYY%%A_MM%%A_DD%%target_time%00
Loop
{
loop_target = %target%
StringMid, loop_time, loop_target, 9, 4 ; for testing (see above)
EnvSub, loop_target, %A_Now%, Seconds
If loop_target <= 0
break
sleep_time := loop_target * 1000 + 25000 ; milliseconds + delay
ToolTip, loop_time:`n%loop_time%`nloop_target:`n%loop_target%`nsleep_time:`n%sleep_time% ; for testing
Sleep, %sleep_time%
; ... do what you want after the sleep
EnvAdd, target, 5, Minutes
}
MsgBox, Exit!