Page 1 of 1

How can i puase settimer when my game is paused

Posted: 07 Mar 2019, 03:07
by dsr07715
What i am doing is making a bot to remind when clock hits 1:45,1:53(repeat every 1 min), 2:00 (repeat every 2 mins) ,5 mins(repeat every 5 mins)
but when game is paused by me or any other player i need to set up a hot key to puase/unpuase it or basically maunlly input my game time(starts from 0:00 to game ends) and start the script from there)


CoordMode, ToolTip, Screen
toggle = 0
#MaxThreadsPerHotkey 20

F6::
Toggle := !Toggle

if Toggle {
ToolTip,
(Join LTrim
==============`n
== Starting Game ==`n
==============
), 620, 890
SetTimer, RemoveToolTip, -5000
SetTimer, StartRuneTimer, -300000
SetTimer, StartStackReadyTimer, -105000
SetTimer, StartStackNowTimer, -111000
SetTimer, StartPowerRuneTimer, -120000

} else {
ToolTip,
(Join LTrim
==============`n
== Ending Game ==`n
==============
), 620, 890
SetTimer, RemoveToolTip, -3000
}
return

RemoveToolTip:
ToolTip
return

StartRuneTimer:
if Toggle {
ToolTip,
(Join LTrim
=============`n
=== GOLDIES ===`n
=============
), 620, 890
SetTimer, RemoveToolTip, -30000
SetTimer, StartRuneTimer, -300000
}
return

StartStackReadyTimer:
if Toggle {
ToolTip,
(Join LTrim
=============`n
=== get ready to stack ===`n
=============
), 620, 890
SetTimer, RemoveToolTip, -5000
SetTimer, StartStackReadyTimer, -120000
}
return

StartStackNowTimer:
if Toggle {
ToolTip,
(Join LTrim
=============`n
=== STACK NOW!! ===`n
=============
), 620, 890
SetTimer, RemoveToolTip, -4000
SetTimer, StartStackNowTimer, -120000
}
return

StartPowerRuneTimer:
if Toggle {
ToolTip,
(Join LTrim
=============`n
=== Power runes ===`n
=============
), 620, 890
SetTimer, RemoveToolTip, -10000
SetTimer, StartPowerRuneTimer, -120000
}
return

Re: How can i puase settimer when my game is paused

Posted: 28 Mar 2019, 03:19
by divanebaba
Hello and welcome to the AHK-forum.

You can stop a timer by using

Code: Select all

F6::
SetTimer, StartRuneTimer, off
SetTimer, StartStackReadyTimer, off
SetTimer, StartStackNowTimer, off
return
You can add more lines with SetTimer, NAMEOFYOURTIMER, off similar to stop more than one timer with same keypress.
To start again with prior defined intervalls, use SetTimer, NAMEOFYOURTIMER, on.

Code: Select all

F7::
SetTimer, StartRuneTimer, on
SetTimer, StartStackReadyTimer, on
SetTimer, StartStackNowTimer, on
return
Just look into most useful tutorial.

Re: How can i puase settimer when my game is paused

Posted: 28 Mar 2019, 03:32
by Blue Kodiak
Or:

Code: Select all

F6:: Pause, Toggle
Pressing F6 will then toggle all timers on/off