Right now the times are set intentionally low so you can see how it works.
Code: Select all
#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%
#SingleInstance Force
SetFormat, float, 0.0
MinPlayTime := 10000
MaxPlayTime := 20000
MinBioTime := 3000
MaxBioTime := 5000
Play:
PlayTime := Rnd(MinPlayTime, MaxPlayTime)
SetTimer, BioBreak, %PlayTime%
PlayTimeSeconds := (PlayTime/1000)
MsgBox,,,Playing for %PlayTimeSeconds% seconds,2
Loop
ToolTip Playing
Return
BioBreak:
SetTimer, BioBreak, Off
BioTime := Rnd(MinBioTime, MaxBioTime)
BioTimeSeconds := (BioTime/1000)
MsgBox,,,BioBreak for %BioTimeSeconds% seconds,2
ToolTip BioBreak
Sleep %BioTime%
GoTo Play
Return
; FROM: http://www.autohotkey.com/forum/viewtopic.php?t=54713&postdays=0&postorder=asc&start=0
/* RANDOM FUNCTION
Rnd() ; - A random float between 0.0 and 1.0 (many uses)
Rnd(6) ; - A random integer between 1 and 6 (die roll)
Rnd("") ; - New random seed (selected randomly)
Rnd("", 12345) ; - New random seed (set explicitly)
Rnd(50, 100) ; - Random integer between 50 and 100 (typical use)
*/
Rnd(a=0.0,b=1) {
IfEqual,a,,Random,,% r := b = 1 ? Rnd(0,0xFFFFFFFF) : b ;%
Else Random,r,a,b
Return r
}
*$Esc:: ExitApp
!$p:: Pause ; Alt+P
Pause:: Pause
F12:: Reload
F11:: ListVars