AutoIt: Извършване на действие през определено време/точен час

Публикувано: 14.01.14, 20:05:22 | Автор: ArMeN | Видяна: 529 | Редактирано: 19.07.16, 21:08:02

Формат HH:MM:SS:
#include <Date.au3>
$Time = '0:00:00|1:00:00|2:00:00|3:00:00|4:00:00|5:00:00|6:00:00|7:00:00|8:00:00|9:00:00|10:00:00|11:00:00|12:00:00|'
$Time &= '13:00:00|14:00:00|15:00:00|16:00:00|17:00:00|18:00:00|19:00:00|20:00:00|21:00:00|22:00:00|23:00:00'
$Split = StringSplit($Time, '|')

While 1
For $i = 1 to $Split[0]
If _NowTime() = $Split[$i] Then MsgBox(0, 'Time', 'Hello')
Next
WEnd

Формат HH:MM:
#include <Date.au3>
$Time = '0:00|1:00|2:00|3:00|4:00|5:00|6:00|7:00|8:00|9:00|10:00|11:00|12:00|13:00|14:00|15:00|16:00|17:00|18:00|19:00|20:00|21:00|22:00|23:00'
$Split = StringSplit($Time, '|')

While 1
For $i = 1 to $Split[0]
If _NowTime(4) = $Split[$i] Then MsgBox(0, 'Time', 'Hello')
Next
WEnd

Източник
_Sleep(15) ; Таймер на 15 секунд
MsgBox(0,"Пауза...","Время вышло :)")

Func _Sleep($iSec,$iX=10,$iY=10)

Local $hTimer = TimerInit(), $iTimer = 0

Do
$iTimer = Round(TimerDiff($hTimer)/1000,0)
ToolTip("Прошло "&$iTimer&" из "&$iSec&" секунд...",$iX,$iY,"Пауза...")
Sleep(250)
Until $iTimer >= $iSec

ToolTip("")

EndFunc

Dim $Time, $Time_H, $Time_M, $Time_C

While 1
Sleep(1000)
$Time += 1
$Time_H = Floor($Time / 3600)
$Time_M = Floor(($Time - ($Time_H * 3600)) / 60)
$Time_C = ($Time - ($Time_H * 3600)) - ($Time_M * 60)
ToolTip($Time_H & ":" & $Time_M & ":" & $Time_C & @CRLF)
If $Time_M = 1 Then
MsgBox(0, "Сообщение!", $Time_M & " минутный период таймера закончен!")
ExitLoop
EndIf
WEnd


Източник
Dim $Time

While 1
Sleep(100)
$Time += 1
ToolTip($Time)
If $Time = 100 Then
MsgBox(0, "Сообщение!", "aaa")
$Time = 0
ExitLoop
EndIf
WEnd

Не сте влезли в акаунта си за да коментирате.


 

Няма коментари.