Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- While 1
- {
- ;Capture the current A_TickCount time if you don't already have it
- if(currentTime = "")
- {
- currentTime := runTime()
- ;If no maxTime is set, add current + X amount of seconds to the trigger
- if(maxTime = "")
- {
- maxTime := currentTime + 05
- }
- }
- ;Capture the current A_TickCount time repeatedly until maxTime is hit
- elapsedTime := runTime()
- MsgBox MaxTime:%maxTime% and ElapsedTime:%elapsedTime%
- ;If elapsedTime is >= to your maxTime then
- if(elapsedTime >= maxTime)
- {
- ;Add your code here
- MsgBox check yo bot fool
- ;Increase your maxTime by X amount of seconds to when you wanna check again
- maxTime := maxTime + 5
- }
- }
- ; === FUNCTIONS ===
- runTime() {
- Global
- if !CounterBefore
- CounterBefore := A_TickCount
- Return toHHMMSS((A_TickCount - CounterBefore) / 1000)
- }
- toHHMMSS(sec) {
- oldFormat := A_FormatFloat
- SetFormat, Float, 02.0
- hrs := sec // 3600 / 1
- min := Mod(sec // 60, 60) / 1
- sec := Mod(sec, 60) / 1
- SetFormat, Float, % oldFormat
- Return (hrs ? hrs "" : "") (min ? min "" : "") sec ""
- }
- F12::ExitApp
Add Comment
Please, Sign In to add comment