Jump to content

Running 32 timers - with start on click


kthuis
 Share

Recommended Posts

I have a problem: I want to have a script that can run 32 timers, but I want to run them all individual with a start and a stop timer... This will be a very long script i think, but can someone give me a start of 2 timers for example!?!?!

If the problem isn't clear, please post!

Krijn Thuis

Link to comment
Share on other sites

I have a problem: I want to have a script that can run 32 timers, but I want to run them all individual with a start and a stop timer... This will be a very long script i think, but can someone give me a start of 2 timers for example!?!?!

If the problem isn't clear, please post!

Krijn Thuis

Try this. It works, but you may need to play with it.

#cs
1. current issues: The urgency level input field in each timer needs to have 
a way of seeing if the correct information has been input. 
2. I need to have it so it can be minumized and restored with a hotsetkey
3. it needs to be tied with quickpaste and a options using the tray icon
#ce


#include <GUIConstants.au3>
#include <Constants.au3>
#include <Date.au3>

AutoItSetOption ("TrayIconDebug", 1)
;TAB A
Dim $Header_A = "   Ticket"
Dim $NameA, $TotalTimeA, $UnitA, $countA = 32
Dim $TimerActiveA_[50], $LabelA_[50], $TButtonA_[50], $SButtonA_[50], $InputA_[50], $CButtonA_[50]
Dim $TimeA_[50], $TimerA_[50], $sTimeA_[50], $xkA, $ckA, $LeftA = 0, $TopA = 20, $XA
Dim $InputA1_[50], $InputA2_[50]
;TAB B
Dim $Header_B = "   Ticket"
Dim $NameB, $TotalTimeB, $UnitB, $countB = 32
Dim $TimerActiveB_[50], $LabelB_[50], $TButtonB_[50], $SButtonB_[50], $InputB_[50] , $CButtonB_[50]
Dim $TimeB_[50], $TimerB_[50], $sTimeB_[50], $xkB, $ckB, $LeftB = 0, $TopB = 20, $XB
Dim $InputB1_[50], $InputB2_[50]
;TAB C
Dim $Header_C = "   Ticket"
Dim $NameC, $TotalTimeC, $UnitC, $countC = 32
Dim $TimerActiveC_[50], $LabelC_[50], $TButtonC_[50], $SButtonC_[50], $InputC_[50] , $CButtonC_[50]
Dim $TimeC_[50], $TimerC_[50], $sTimeC_[50], $xkC, $ckC, $LeftC = 0, $TopC = 20, $XC
Dim $InputC1_[50], $InputC2_[50]
;TAB D
Dim $Header_D = "   Ticket"
Dim $NameD, $TotalTimeD, $UnitD, $countD = 32
Dim $TimerActiveD_[50], $LabelD_[50], $TButtonD_[50], $SButtonD_[50], $InputD_[50] , $CButtonD_[50]
Dim $TimeD_[50], $TimerD_[50], $sTimeD_[50], $xkD, $ckD, $LeftD = 0, $TopD = 20, $XD
Dim $InputD1_[50], $InputD2_[50]
Global $TimerReseta = 0,$TimerResetb = 0,$TimerResetc = 0,$TimerResetd = 0, $Label_4
Global $Secs, $Mins, $Hour, $Time

AdlibEnable("AllTimers", 500)
;options tab reminder timer
 Dim $Timer1Active = 0
 Dim $Timer2Active = 0
 Dim $count = "01"
 Dim $lable4

GUICreate("   T(egg) Timer", 871, 558,-1 ,-1, $WS_DLGFRAME )
GUICtrlSetState(-1,$GUI_DISABLE)
GUICtrlSetCursor(-1, 0)
$h_tab = GUICtrlCreateTab (-1, -1, 895,540)

;FIRST TAB GUI------------------------------------------------------------------------------- 
GUICtrlCreateTabItem("Tickets 1-32")
GUICtrlCreateLabel($Header_A & "s 1 - 32", -20, 23, 890, 18, $SS_CENTER, $WS_EX_STATICEDGE)
GUICtrlSetFont(-1, 12, 700)
GUICtrlSetBkColor(-1, 0xCEFFCE)

For $XA = 1 To 8
; row 1
   GUICtrlCreateLabel($Header_A & " " & $XA, $LeftA + 18, $TopA + 25, 60, 20, $SS_CENTER); ticket lable ex: ticket 1
   $LabelA_[$XA] = GUICtrlCreateLabel("", $LeftA, $TopA + 43, 100, 30, 0x00800000 + 0x0001)
   $InputA1_[$XA] = GUICtrlCreateInput("", $LeftA + 80, $TopA + 23, 20, 18, 0x1000 + 0x2000)   
   GUICtrlSetFont($LabelA_[$XA], 16)
   GUICtrlSetData($LabelA_[$XA], "00:00:00")
   $CButtonA_[$XA] = GUICtrlCreateButton("ok", $LeftA, $TopA + 23, 18, 18)
   $TButtonA_[$XA] = GUICtrlCreateButton("Start", $LeftA, $TopA + 73, 50, 20)
   $SButtonA_[$XA] = GUICtrlCreateButton("Stop", $LeftA + 50, $TopA + 73, 50, 20)
   $InputA_[$XA] = GUICtrlCreateInput("", $LeftA, $TopA + 93, 100, 20,0x2000 + 0x1000 + 0x0002)
   $InputA2_[$XA] = GUICtrlCreateInput("", $LeftA, $TopA + 116, 100, 20, 0x1000 + 0x0002) 
    
   ;msgbox(0, $InputA1_[$XA], "5 seconds")   
    
; row 2
   GUICtrlCreateLabel($Header_A & " " & $XA + 8, $LeftA + 18, $TopA + 150, 60, 20, $SS_CENTER)
   $LabelA_[$XA + 8] = GUICtrlCreateLabel("", $LeftA, $TopA + 170, 100, 30, 0x00800000 + 0x0001)
   $InputA1_[$XA +8] = GUICtrlCreateInput("", $LeftA + 80, $TopA + 150, 20, 18, 0x1000+ 0x2000)
   GUICtrlSetFont($LabelA_[$XA + 8], 16)
   GUICtrlSetData($LabelA_[$XA + 8], "00:00:00")
   $CButtonA_[$XA + 8] = GUICtrlCreateButton("ok", $LeftA, $TopA + 150, 18, 18)
   $TButtonA_[$XA + 8] = GUICtrlCreateButton("Start", $LeftA, $TopA + 200, 50, 20)
   $SButtonA_[$XA + 8] = GUICtrlCreateButton("Stop", $LeftA + 50, $TopA + 200, 50, 20)
   $InputA_[$XA + 8] = GUICtrlCreateInput("", $LeftA, $TopA + 220, 100, 20, 0x2000 + 0x1000 + 0x0002)
   $InputA2_[$XA + 8] = GUICtrlCreateInput("", $LeftA, $TopA + 243, 100, 20, 0x1000)

; row 3
   GUICtrlCreateLabel($Header_A & " " & $XA + 16, $LeftA + 18, $TopA + 275, 60, 20, $SS_CENTER)
   $LabelA_[$XA + 16] = GUICtrlCreateLabel("", $LeftA, $TopA + 295, 100, 30, 0x00800000 + 0x0001)
   $InputA1_[$XA +16] = GUICtrlCreateInput("", $LeftA + 80, $TopA + 275, 20, 18, 0x1000+ 0x2000)
   GUICtrlSetFont($LabelA_[$XA + 16], 16)
   GUICtrlSetData($LabelA_[$XA + 16], "00:00:00")
   $CButtonA_[$XA + 16] = GUICtrlCreateButton("ok", $LeftA, $TopA + 275, 18, 18)
   $TButtonA_[$XA + 16] = GUICtrlCreateButton("Start", $LeftA, $TopA + 325, 50, 20)
   $SButtonA_[$XA + 16] = GUICtrlCreateButton("Stop", $LeftA + 50, $TopA + 325, 50, 20)
   $InputA_[$XA + 16] = GUICtrlCreateInput("", $LeftA, $TopA + 345, 100, 20, 0x2000 + 0x1000 + 0x0002)
   $InputA2_[$XA + 16] = GUICtrlCreateInput("", $LeftA, $TopA + 368, 100, 20, 0x1000)

; row 4
   GUICtrlCreateLabel($Header_A & " " & $XA + 24, $LeftA + 18, $TopA + 400, 60, 20, $SS_CENTER)
   $LabelA_[$XA + 24] = GUICtrlCreateLabel("", $LeftA, $TopA + 420, 100, 30, 0x00800000 + 0x0001)
   $InputA1_[$XA +24] = GUICtrlCreateInput("", $LeftA + 80, $TopA + 400, 20, 18, 0x1000+ 0x2000)
   GUICtrlSetFont($LabelA_[$XA + 24], 16)
   GUICtrlSetData($LabelA_[$XA + 24], "00:00:00")
   $CButtonA_[$XA + 24] = GUICtrlCreateButton("ok", $LeftA, $TopA + 400, 18, 18)
   $TButtonA_[$XA + 24] = GUICtrlCreateButton("Start", $LeftA, $TopA + 450, 50, 20)
   $SButtonA_[$XA + 24] = GUICtrlCreateButton("Stop", $LeftA + 50, $TopA + 450, 50, 20)
   $InputA_[$XA + 24] = GUICtrlCreateInput("", $LeftA, $TopA + 470, 100, 20, 0x2000 + 0x1000 + 0x0002)
   $InputA2_[$XA + 24] = GUICtrlCreateInput("", $LeftA, $TopA + 493, 100, 20, 0x1000)

$LeftA = $LeftA + 110
Next


;SECOND TAB GUI---------------------------------------------------------------------------------
GUICtrlCreateTabItem("Tickets 33 - 64")
GUICtrlCreateLabel($Header_A & "s 33 thru 64", -20, 23, 890, 18, $SS_CENTER, $WS_EX_STATICEDGE)
GUICtrlSetFont(-1, 12, 700)
GUICtrlSetBkColor(-1, 0xa5fafe)

For $XB = 1 To 8
; row 1 TAB B
   GUICtrlCreateLabel($Header_B & " " & $XB + 32, $LeftB + 18, $TopB + 25, 60, 20, $SS_CENTER); ticket lable ex: ticket 1
   $LabelB_[$XB] = GUICtrlCreateLabel("", $LeftB, $TopB + 43, 100, 30, 0x00800000 + 0x0001)
   $InputB1_[$XB] = GUICtrlCreateInput("", $LeftB + 80, $TopB + 23, 20, 18, 0x1000+ 0x2000)   
   GUICtrlSetFont($LabelB_[$XB], 16)
   GUICtrlSetData($LabelB_[$XB], "00:00:00")
   $CButtonB_[$XB] = GUICtrlCreateButton("ok", $LeftB, $TopB + 23, 18, 18)
   $TButtonB_[$XB] = GUICtrlCreateButton("Start", $LeftB, $TopB + 73, 50, 20)
   $SButtonB_[$XB] = GUICtrlCreateButton("Stop", $LeftB + 50, $TopB + 73, 50, 20)
     $InputB_[$XB] = GUICtrlCreateInput("", $LeftB, $TopB + 93, 100, 20,0x2000 + 0x1000 + 0x0002)
    $InputB2_[$XB] = GUICtrlCreateInput("", $LeftB, $TopB + 116, 100, 20, 0x1000 + 0x0002)    

; row 2 TAB B
   GUICtrlCreateLabel($Header_B & " " & $XB + 40, $LeftB + 18, $TopB + 150, 60, 20, $SS_CENTER)
   $LabelB_[$XB + 8] = GUICtrlCreateLabel("", $LeftB, $TopB + 170, 100, 30, 0x00800000 + 0x0001)
   $InputB1_[$XB + 8] = GUICtrlCreateInput("", $LeftB + 80, $TopB + 150, 20, 18, 0x1000 + 0x2000)
   GUICtrlSetFont($LabelB_[$XB + 8], 16)
   GUICtrlSetData($LabelB_[$XB + 8], "00:00:00")
   $CButtonB_[$XB + 8] = GUICtrlCreateButton("ok", $LeftB, $TopB + 150, 18, 18)
   $TButtonB_[$XB + 8] = GUICtrlCreateButton("Start", $LeftB, $TopB + 200, 50, 20)
   $SButtonB_[$XB + 8] = GUICtrlCreateButton("Stop", $LeftB + 50, $TopB + 200, 50, 20)
   $InputB_[$XB + 8] = GUICtrlCreateInput("", $LeftB, $TopB + 220, 100, 20, 0x2000 + 0x1000 + 0x0002)
   $InputB2_[$XB + 8] = GUICtrlCreateInput("", $LeftB, $TopB + 243, 100, 20, 0x1000)

; row 3 TAB B
   GUICtrlCreateLabel($Header_B & " " & $XB + 48, $LeftB + 18, $TopB + 275, 60, 20, $SS_CENTER)
   $LabelB_[$XB + 16] = GUICtrlCreateLabel("", $LeftB, $TopB + 295, 100, 30, 0x00800000 + 0x0001)
   $InputB1_[$XB +16] = GUICtrlCreateInput("", $LeftB + 80, $TopB + 275, 20, 18, 0x1000 + 0x2000)
   GUICtrlSetFont($LabelB_[$XB + 16], 16)
   GUICtrlSetData($LabelB_[$XB + 16], "00:00:00")
   $CButtonB_[$XB + 16] = GUICtrlCreateButton("ok", $LeftB, $TopB + 275, 18, 18)
   $TButtonB_[$XB + 16] = GUICtrlCreateButton("Start", $LeftB, $TopB + 325, 50, 20)
   $SButtonB_[$XB + 16] = GUICtrlCreateButton("Stop", $LeftB + 50, $TopB + 325, 50, 20)
   $InputB_[$XB + 16] = GUICtrlCreateInput("", $LeftB, $TopB + 345, 100, 20, 0x2000 + 0x1000 + 0x0002)
   $InputB2_[$XB + 16] = GUICtrlCreateInput("", $LeftB, $TopB + 368, 100, 20, 0x1000)

; row 4 TAB B
   GUICtrlCreateLabel($Header_B & " " & $XB + 56, $LeftB + 18, $TopB + 400, 60, 20, $SS_CENTER)
   $LabelB_[$XB + 24] = GUICtrlCreateLabel("", $LeftB, $TopB + 420, 100, 30, 0x00800000 + 0x0001)
   $InputB1_[$XB + 24] = GUICtrlCreateInput("", $LeftB + 80, $TopB + 400, 20, 18, 0x1000 + 0x2000)
   GUICtrlSetFont($LabelB_[$XB + 24], 16)
   GUICtrlSetData($LabelB_[$XB + 24], "00:00:00")
   $CButtonB_[$XB + 24] = GUICtrlCreateButton("ok", $LeftB, $TopB + 400, 18, 18)
   $TButtonB_[$XB + 24] = GUICtrlCreateButton("Start", $LeftB, $TopB + 450, 50, 20)
   $SButtonB_[$XB + 24] = GUICtrlCreateButton("Stop", $LeftB + 50, $TopB + 450, 50, 20)
   $InputB_[$XB + 24] = GUICtrlCreateInput("", $LeftB, $TopB + 470, 100, 20, 0x2000 + 0x1000 + 0x0002)
   $InputB2_[$XB + 24] = GUICtrlCreateInput("", $LeftB, $TopB + 493, 100, 20, 0x1000)
        
    $LeftB = $LeftB + 110
Next

;THIRD TAB GUI----------------------------------------------------------------------------------
GUICtrlCreateTabItem("Tickets 65 - 96")
GUICtrlCreateLabel($Header_C & "s 65 thru 96", -20, 23, 890, 18, $SS_CENTER, $WS_EX_STATICEDGE)
GUICtrlSetFont(-1, 12, 700)
GUICtrlSetBkColor(-1, 0xffd5d5)

For $XC = 1 To 8
; row 1 TAB C
   GUICtrlCreateLabel($Header_C & " " & $XC + 64, $LeftC + 18, $TopC + 25, 60, 20, $SS_CENTER); ticket lable ex: ticket 1
   $LabelC_[$XC] = GUICtrlCreateLabel("", $LeftC, $TopC + 43, 100, 30, 0x00800000 + 0x0001)
   $InputC1_[$XC] = GUICtrlCreateInput("", $LeftC + 80, $TopC + 23, 20, 18, 0x1000+ 0x2000 )   
   GUICtrlSetFont($LabelC_[$XC], 16)
   GUICtrlSetData($LabelC_[$XC], "00:00:00")
  ;$CButtonA_[$XA] = GUICtrlCreateButton("ok", $LeftA, $TopA + 23, 18, 18) to compare
   $CButtonC_[$XC] = GUICtrlCreateButton("ok", $LeftC, $TopC + 23, 18, 18)
   $TButtonC_[$XC] = GUICtrlCreateButton("Start", $LeftC, $TopC + 73, 50, 20)
   $SButtonC_[$XC] = GUICtrlCreateButton("Stop", $LeftC + 50, $TopC + 73, 50, 20)
    $InputC_[$XC] = GUICtrlCreateInput("", $LeftC, $TopC + 93, 100, 20,0x2000 + 0x1000 + 0x0002)
    $InputC2_[$XC] = GUICtrlCreateInput("", $LeftC, $TopC + 116, 100, 20, 0x1000 + 0x0002)    

; row 2 TAB C
   GUICtrlCreateLabel($Header_C & " " & $XC + 72, $LeftC + 18, $TopC + 150, 60, 20, $SS_CENTER)
   $LabelC_[$XC + 8] = GUICtrlCreateLabel("", $LeftC, $TopC + 170, 100, 30, 0x00800000 + 0x0001)
   $InputC1_[$XC + 8] = GUICtrlCreateInput("", $LeftC + 80, $TopC + 150, 20, 18, 0x1000 + 0x2000 )
   GUICtrlSetFont($LabelC_[$XC + 8], 16)
   GUICtrlSetData($LabelC_[$XC + 8], "00:00:00")
   $CButtonC_[$XC + 8] = GUICtrlCreateButton("ok", $LeftC, $TopC + 150, 18, 18)
   $TButtonC_[$XC + 8] = GUICtrlCreateButton("Start", $LeftC, $TopC + 200, 50, 20)
   $SButtonC_[$XC + 8] = GUICtrlCreateButton("Stop", $LeftC + 50, $TopC + 200, 50, 20)
   $InputC_[$XC + 8] = GUICtrlCreateInput("", $LeftC, $TopC + 220, 100, 20, 0x2000 + 0x1000 + 0x0002)
   $InputC2_[$XC + 8] = GUICtrlCreateInput("", $LeftC, $TopC + 243, 100, 20, 0x1000)

; row 3 TAB C
   GUICtrlCreateLabel($Header_C & " " & $XC + 80, $LeftC + 18, $TopC + 275, 60, 20, $SS_CENTER)
   $LabelC_[$XC + 16] = GUICtrlCreateLabel("", $LeftC, $TopC + 295, 100, 30, 0x00800000 + 0x0001)
   $InputC1_[$XC +16] = GUICtrlCreateInput("", $LeftC + 80, $TopC + 275, 20, 18, 0x1000 + 0x2000)
   GUICtrlSetFont($LabelC_[$XC + 16], 16)
   GUICtrlSetData($LabelC_[$XC + 16], "00:00:00")
   $CButtonC_[$XC + 16] = GUICtrlCreateButton("ok", $LeftC, $TopC + 275, 18, 18)
   $TButtonC_[$XC + 16] = GUICtrlCreateButton("Start", $LeftC, $TopC + 325, 50, 20)
   $SButtonC_[$XC + 16] = GUICtrlCreateButton("Stop", $LeftC + 50, $TopC + 325, 50, 20)
   $InputC_[$XC + 16] = GUICtrlCreateInput("", $LeftC, $TopC + 345, 100, 20, 0x2000 + 0x1000 + 0x0002)
   $InputC2_[$XC + 16] = GUICtrlCreateInput("", $LeftC, $TopC + 368, 100, 20, 0x1000)

; row 4 TAB C
   GUICtrlCreateLabel($Header_C & " " & $XC + 88, $LeftC + 18, $TopC + 400, 60, 20, $SS_CENTER)
   $LabelC_[$XC + 24] = GUICtrlCreateLabel("", $LeftC, $TopC + 420, 100, 30, 0x00800000 + 0x0001)
   $InputC1_[$XC + 24] = GUICtrlCreateInput("", $LeftC + 80, $TopC + 400, 20, 18, 0x1000 + 0x2000)
   GUICtrlSetFont($LabelC_[$XC + 24], 16)
   GUICtrlSetData($LabelC_[$XC + 24], "00:00:00")
   $CButtonC_[$XC + 24] = GUICtrlCreateButton("ok", $LeftC, $TopC + 400, 18, 18)
   $TButtonC_[$XC + 24] = GUICtrlCreateButton("Start", $LeftC, $TopC + 450, 50, 20)
   $SButtonC_[$XC + 24] = GUICtrlCreateButton("Stop", $LeftC + 50, $TopC + 450, 50, 20)
   $InputC_[$XC + 24] = GUICtrlCreateInput("", $LeftC, $TopC + 470, 100, 20, 0x2000 + 0x1000 + 0x0002)
   $InputC2_[$XC + 24] = GUICtrlCreateInput("", $LeftC, $TopC + 493, 100, 20, 0x1000)
       
    $LeftC = $LeftC + 110
Next

;FORTH TAB GUI-------------------------------------------------------------------------------------
GUICtrlCreateTabItem("Tickets 97 - 128")
GUICtrlCreateLabel($Header_D & "s 97 thru 128", -20, 23, 890, 18, $SS_CENTER, $WS_EX_STATICEDGE)
GUICtrlSetFont(-1, 12, 700)
GUICtrlSetBkColor(-1, 0xF9C5FE)

For $XD = 1 To 8
; row 1 TAB D
   GUICtrlCreateLabel($Header_D & "" & $XD + 96, $LeftD + 18, $TopD + 25, 60, 20, $SS_CENTER); ticket lable ex: ticket 1
   $LabelD_[$XD] = GUICtrlCreateLabel("", $LeftD, $TopD + 43, 100, 30, 0x00800000 + 0x0001)
   $InputD1_[$XD] = GUICtrlCreateInput("", $LeftD + 80, $TopD + 23, 20, 18, 0x1000 + 0x2000)   
   GUICtrlSetFont($LabelD_[$XD], 16)
   GUICtrlSetData($LabelD_[$XD], "00:00:00")
   $CButtonD_[$XD] = GUICtrlCreateButton("ok", $LeftD, $TopD + 23, 18, 18)
   $TButtonD_[$XD] = GUICtrlCreateButton("Start", $LeftD, $TopD + 73, 50, 20)
   $SButtonD_[$XD] = GUICtrlCreateButton("Stop", $LeftD + 50, $TopD + 73, 50, 20)
    $InputD_[$XD] = GUICtrlCreateInput("", $LeftD, $TopD + 93, 100, 20,0x2000 + 0x1000 + 0x0002)
    $InputD2_[$XD] = GUICtrlCreateInput("", $LeftD, $TopD + 116, 100, 20, 0x1000 + 0x0002)    

; row 2 TAB D
   GUICtrlCreateLabel($Header_D & " " & $XD + 104, $LeftD + 18, $TopD + 150, 60, 20, $SS_CENTER)
   $LabelD_[$XD + 8] = GUICtrlCreateLabel("", $LeftD, $TopD + 170, 100, 30, 0x00800000 + 0x0001)
   $InputD1_[$XD + 8] = GUICtrlCreateInput("", $LeftD + 80, $TopD + 150, 20, 18, 0x1000 + 0x2000)
   GUICtrlSetFont($LabelD_[$XD + 8], 16)
   GUICtrlSetData($LabelD_[$XD + 8], "00:00:00")
   $CButtonD_[$XD + 8] = GUICtrlCreateButton("ok", $LeftD, $TopD + 150, 18, 18)
   $TButtonD_[$XD + 8] = GUICtrlCreateButton("Start", $LeftD, $TopD + 200, 50, 20)
   $SButtonD_[$XD + 8] = GUICtrlCreateButton("Stop", $LeftD + 50, $TopD + 200, 50, 20)
   $InputD_[$XD + 8] = GUICtrlCreateInput("", $LeftD, $TopD + 220, 100, 20, 0x2000 + 0x1000 + 0x0002)
   $InputD2_[$XD + 8] = GUICtrlCreateInput("", $LeftD, $TopD + 243, 100, 20, 0x1000)

; row 3 TAB D
   GUICtrlCreateLabel($Header_D & " " & $XD + 112, $LeftD + 18, $TopD + 275, 60, 20, $SS_CENTER)
   $LabelD_[$XD + 16] = GUICtrlCreateLabel("", $LeftD, $TopD + 295, 100, 30, 0x00800000 + 0x0001)
   $InputD1_[$XD +16] = GUICtrlCreateInput("", $LeftD + 80, $TopD + 275, 20, 18, 0x1000 + 0x2000)
   GUICtrlSetFont($LabelD_[$XD + 16], 16)
   GUICtrlSetData($LabelD_[$XD + 16], "00:00:00")
   $CButtonD_[$XD + 16] = GUICtrlCreateButton("ok", $LeftD, $TopD + 275, 18, 18)
   $TButtonD_[$XD + 16] = GUICtrlCreateButton("Start", $LeftD, $TopD + 325, 50, 20)
   $SButtonD_[$XD + 16] = GUICtrlCreateButton("Stop", $LeftD + 50, $TopD + 325, 50, 20)
   $InputD_[$XD + 16] = GUICtrlCreateInput("", $LeftD, $TopD + 345, 100, 20, 0x2000 + 0x1000 + 0x0002)
   $InputD2_[$XD + 16] = GUICtrlCreateInput("", $LeftD, $TopD + 368, 100, 20, 0x1000)

; row 4 TAB D
   GUICtrlCreateLabel($Header_D & " " & $XD + 120, $LeftD + 18, $TopD + 400, 60, 20, $SS_CENTER)
   $LabelD_[$XD + 24] = GUICtrlCreateLabel("", $LeftD, $TopD + 420, 100, 30, 0x00800000 + 0x0001)
   $InputD1_[$XD + 24] = GUICtrlCreateInput("", $LeftD + 80, $TopD + 400, 20, 18, 0x1000 + 0x2000)
   GUICtrlSetFont($LabelD_[$XD + 24], 16)
   GUICtrlSetData($LabelD_[$XD + 24], "00:00:00")
   $CButtonD_[$XD + 24] = GUICtrlCreateButton("ok", $LeftD, $TopD + 400, 18, 18)
   $TButtonD_[$XD + 24] = GUICtrlCreateButton("Start", $LeftD, $TopD + 450, 50, 20)
   $SButtonD_[$XD + 24] = GUICtrlCreateButton("Stop", $LeftD + 50, $TopD + 450, 50, 20)
   $InputD_[$XD + 24] = GUICtrlCreateInput("", $LeftD, $TopD + 470, 100, 20, 0x2000 + 0x1000 + 0x0002)
   $InputD2_[$XD + 24] = GUICtrlCreateInput("", $LeftD, $TopD + 493, 100, 20, 0x1000)

    $LeftD = $LeftD + 110
Next

GUICtrlCreateTabItem("Options")
GUICtrlCreateLabel("Urgency levels, notify messages", -20, 23, 890, 22, $SS_CENTER, $WS_EX_STATICEDGE)
GUICtrlSetFont(-1, 12, 700)
GUICtrlSetBkColor(-1, 0xB79B80)
;urgency 1
GUICtrlCreateGroup("Urgency level 1", 20, 50, 220, 55)
$iniL1 = iniread("timer.ini", "level", "1", "")
$UL1A = GUICtrlCreateInput($iniL1, 30, 70, 18, 18, $ES_NUMBER);first
GUICtrlCreateLabel("First Notify", 55, 73,50, 20)
$iniL1A = iniread("timer.ini", "level", "1A", "")
$UL1B = GUICtrlCreateInput($iniL1A, 130, 70, 18, 18, $ES_NUMBER); second
GUICtrlCreateLabel("Second Notify", 155, 73, 70, 20)
;urgency 2
GUICtrlCreateGroup("Urgency level 2", 20, 120, 220, 55)
$iniL2 = iniread("timer.ini", "level", "2", "")
$UL2A = GUICtrlCreateInput($iniL2, 30, 140, 18, 18, $ES_NUMBER);first
GUICtrlCreateLabel("First Notify", 55, 143,50, 20)
$iniL2A = iniread("timer.ini", "level", "2A", "")
$UL2B = GUICtrlCreateInput($iniL2A, 130, 140, 18, 18, $ES_NUMBER); second
GUICtrlCreateLabel("Second Notify", 155, 143, 70, 20)
;urgency 3
GUICtrlCreateGroup("Urgency level 3", 20, 190, 220, 55)
$iniL3 = iniread("timer.ini", "level", "3", "")
$UL3A = GUICtrlCreateInput($iniL3, 30, 210, 18, 18, $ES_NUMBER);first
GUICtrlCreateLabel("First Notify", 55, 213,50, 20)
$iniL3A = iniread("timer.ini", "level", "3A", "")
$UL3B = GUICtrlCreateInput($iniL3A, 130, 210, 18, 18, $ES_NUMBER); second
GUICtrlCreateLabel("Second Notify", 155, 213, 70, 20)
;urgency 4
GUICtrlCreateGroup("Urgency level 4", 20, 260, 220, 55)
$iniL4 = iniread("timer.ini", "level", "4", "")
$UL4A = GUICtrlCreateInput($iniL4, 30, 280, 18, 18, $ES_NUMBER);first
GUICtrlCreateLabel("First Notify", 55, 283,50, 20)
$iniL4A = iniread("timer.ini", "level", "4A", "")
$UL4B = GUICtrlCreateInput($iniL4A, 130, 280, 18, 18, $ES_NUMBER); second
GUICtrlCreateLabel("Second Notify", 155, 283, 70, 20)
;urgency 5
GUICtrlCreateGroup("Urgency level 5", 20, 330, 220, 55)
$iniL5 = iniread("timer.ini", "level", "5", "")
$UL5A = GUICtrlCreateInput($iniL5, 30, 350, 18, 18, $ES_NUMBER);first
GUICtrlCreateLabel("First Notify", 55, 353,50, 20)
$iniL5A = iniread("timer.ini", "level", "5A", "")
$UL5B = GUICtrlCreateInput($iniL5A, 130, 350, 18, 18, $ES_NUMBER); second
GUICtrlCreateLabel("Second Notify", 155, 353, 70, 20)

;This section is part of the voice reminder----------------------------------------------------------
;check voice
$Button_1 = GUICtrlCreateButton("Start", 300, 110, 50, 20)
$Button_2 = GUICtrlCreateButton("Stop", 350, 110, 50, 20)
$Label_4 = GUICtrlCreateLabel("00:00:00", 300, 75, 100, 30, 0x00800000 + 0x0001)
GUICtrlSetBkColor($Label_4, 0xFF0000)
GUICtrlSetFont($Label_4, 16)
GUICtrlCreateGroup("Voice Reminder System", 285, 50, 300, 100)  
$voice1 = GUICtrlCreateLabel("RED: Alert is off  ", 425, 75, 150, 20, 0x00800000 + 0x0001)   
GUICtrlSetFont($voice1, 12,600 )
GUICtrlSetBkColor($voice1, 0xFF0000)
$voice2 = GUICtrlCreateLabel("Green: Alert is on", 425, 110, 150, 20, 0x00800000 + 0x0001)   
GUICtrlSetFont($voice2, 12, 600)
GUICtrlSetBkColor($voice2, 0x64C671)

;buttons
$settingsA = GUICtrlCreateButton("&Apply", 560, 500, 50, 20)
$settingsB = GUICtrlCreateButton("&Help", 630, 500, 50, 20)
$settingsC = GUICtrlCreateButton("A&bout", 700, 500, 50, 20)
$settingsD = GUICtrlCreateButton("&Close T(egg)", 770, 500, 70, 20)

;----------------------------------------------------------------------------------------------
GUISetState()

;===========================
;===========================
;===========================

While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    IF $msg < 1 then ContinueLoop
    select
        Case $msg = $Button_1
            $Timer1Active = 1
            $timer1 = TimerInit()
            GUICtrlSetBkColor($Label_4, 0x64C671)
        Case $msg = $Button_2
            $Timer1Active = 0
            GUICtrlSetData($Label_4, "00:00:00")
            GUICtrlSetBkColor($Label_4, 0xFF0000)
        ;Case $msg = $GUI_EVENT_CLOSE
    endselect
 
    
    sleep(2)
    Switch GUICtrlRead($h_tab)
        Case 0
            For $xkA = 1 To $countA
              if $msg = $TButtonA_[$xkA] And GUICtrlRead($InputA_[$xkA]) > "" then
                    GUICtrlSetState($TButtonA_[$xkA], $GUI_DISABLE)
                    GUICtrlSetState($InputA_[$xkA], $GUI_DISABLE)
                    GUICtrlSetState($InputA1_[$xkA], $GUI_DISABLE)             
                    $TimerActiveA_[$xkA] = 1
                    
                    If Not StringLen(String($TimerA_[$xkA])) Or $TimerReseta Then 
                        $TimerA_[$xkA] = TimerInit()
                        $TimerResetA = 0
                    Else
                        GUICtrlSetData($SButtonA_[$xkA], "Stop")
                    EndIf
              elseif  $msg = $TButtonA_[$xkA] Then 
                    MsgBox(64, "User Error", "Please Type in a Ticket Number   ", 3)
              endif
              if    $msg = $SButtonA_[$xkA] And GUICtrlRead($SButtonA_[$xkA]) = "Reset" Then
                    GUICtrlSetData($LabelA_[$xkA], "00:00:00")
                    GUICtrlSetData($InputA_[$xkA], "")
                    GUICtrlSetData($InputA2_[$xkA], "")
                    GUICtrlSetData($InputA1_[$XkA], "")
                    GUICtrlSetData($SButtonA_[$xkA], "Stop")
                    GUICtrlSetState($TButtonA_[$xkA], $GUI_ENABLE)
                    GUICtrlSetState($InputA_[$xkA], $GUI_ENABLE)
                     GUICtrlSetState($InputA1_[$xkA], $GUI_ENABLE)                                                          
                    $TimerReseta = 1
              endif 
              if    $msg = $SButtonA_[$xkA] And GUICtrlRead($InputA_[$xkA]) <> "" And GUICtrlRead($SButtonA_[$xkA]) = "Stop" Then
                    $TimerActiveA_[$xkA] = 0
                    GUICtrlSetData($SButtonA_[$xkA], "Reset")
                    GUICtrlSetState($TButtonA_[$xkA], $GUI_DISABLE)
                    GUICtrlSetState($InputA_[$xkA], $GUI_DISABLE)
                    GUICtrlSetState($InputA1_[$xkA], $GUI_DISABLE)                    
                    GUICtrlSetBkColor($LabelA_[$xkA], 0xD4D0C8)
                    $NameA = GUICtrlRead($InputA_[$xkA])
                   
                    If $xkA < 32 Then
                        $UnitA = $Header_A & "  " & $xkA
                    EndIf
                  endif
               if $msg = $CButtonA_[$xkA] then GUICtrlSetBkColor($LabelA_[$xkA], 0xFFFFFF)
                    
               If $xkA = 32 Then ExitLoop 

            Next
         sleep(1)   
        Case 1
          ;SECOND TAB CONTROLS----------------------------------------------------------------------------   
            For $xkB = 1 To $countB
                If $msg = $TButtonB_[$xkB] And GUICtrlRead($InputB_[$xkB]) > "" Then
                    GUICtrlSetState($TButtonB_[$xkB], $GUI_DISABLE)
                    GUICtrlSetState($InputB_[$xkB], $GUI_DISABLE)
                    GUICtrlSetState($InputB1_[$xkB], $GUI_DISABLE)
                    $TimerActiveB_[$xkB] = 1
                    If Not StringLen(String($TimerB_[$xkB])) Or $TimerResetb Then 
                        $TimerB_[$xkB] = TimerInit()
                        $TimerResetb = 0
                    Else
                        GUICtrlSetData($SButtonB_[$xkB], "Stop")
                    EndIf
                ElseIf $msg = $TButtonB_[$xkB] Then
                    MsgBox(64, "User Error", "Please Type in a Ticket Number   ", 3)
                EndIf
                If $msg = $SButtonB_[$xkB] And GUICtrlRead($SButtonB_[$xkB]) = "Reset" Then
                    GUICtrlSetData($LabelB_[$xkB], "00:00:00")
                    GUICtrlSetData($InputB_[$xkB], "")
                    GUICtrlSetData($InputB2_[$xkB], "")
                    GUICtrlSetData($InputB1_[$XkB], "")
                    GUICtrlSetData($SButtonB_[$xkB], "Stop")
                    GUICtrlSetState($TButtonB_[$xkB], $GUI_ENABLE)
                    GUICtrlSetState($InputB_[$xkB], $GUI_ENABLE)
                    GUICtrlSetState($InputB1_[$xkB], $GUI_ENABLE) 
                    $TimerResetB = 1
                EndIf
                If $msg = $SButtonB_[$xkB] And GUICtrlRead($InputB_[$xkB]) <> "" And GUICtrlRead($SButtonB_[$xkB]) = "Stop" Then
                    $TimerActiveB_[$xkB] = 0
                    GUICtrlSetData($SButtonB_[$xkB], "Reset")
                    GUICtrlSetState($TButtonB_[$xkB], $GUI_DISABLE)
                    GUICtrlSetState($InputB_[$xkB], $GUI_DISABLE)
                    GUICtrlSetState($InputB1_[$xkB], $GUI_DISABLE) 
                    GUICtrlSetBkColor($LabelB_[$xkB], 0xD4D0C8)
                    $NameB = GUICtrlRead($InputB_[$xkB])
                  ;
                    If $xkB < 32 Then
                        $UnitB = $Header_B & "  " & $xkB
                    EndIf
                    EndIf 
                if $msg = $CButtonB_[$xkB] then GUICtrlSetBkColor($LabelB_[$xkB], 0xFFFFFF)   
               
                If $xkB = 32 Then ExitLoop      
            Next  
        sleep(1)    
        Case 2
          ;THIRD TAB CONTROLS-----------------------------------------------------------------------------
            For $xkC = 1 To $countC
                If $msg = $TButtonC_[$xkC] And GUICtrlRead($InputC_[$xkC]) > "" Then
                    GUICtrlSetState($TButtonC_[$xkC], $GUI_DISABLE)
                    GUICtrlSetState($InputC_[$xkC], $GUI_DISABLE)
                    $TimerActiveC_[$xkC] = 1
                    If Not StringLen(String($TimerC_[$xkC])) Or $TimerResetc Then 
                        $TimerC_[$xkC] = TimerInit()
                        $TimerResetc = 0
                    Else
                        GUICtrlSetData($SButtonC_[$xkC], "Stop")
                    EndIf
                ElseIf $msg = $TButtonC_[$xkC] Then
                    MsgBox(64, "User Error", "Please Type in a Ticket Number   ", 3)
                EndIf
                If $msg = $SButtonC_[$xkC] And GUICtrlRead($SButtonC_[$xkC]) = "Reset" Then
                    GUICtrlSetData($LabelC_[$xkC], "00:00:00")
                    GUICtrlSetData($InputC_[$xkC], "")
                    GUICtrlSetData($InputC2_[$xkC], "")
                    GUICtrlSetData($InputC1_[$XkC], "")
                    GUICtrlSetData($SButtonC_[$xkC], "Stop")
                    GUICtrlSetState($TButtonC_[$xkC], $GUI_ENABLE)
                    GUICtrlSetState($InputC_[$xkC], $GUI_ENABLE)
                    GUICtrlSetState($InputC1_[$xkC], $GUI_ENABLE)
                    $TimerResetc = 1
                EndIf
                If $msg = $SButtonC_[$xkC] And GUICtrlRead($InputC_[$xkC]) <> "" And GUICtrlRead($SButtonC_[$xkC]) = "Stop" Then
                    $TimerActiveC_[$xkC] = 0
                    GUICtrlSetData($SButtonC_[$xkC], "Reset")
                    GUICtrlSetState($TButtonC_[$xkC], $GUI_DISABLE)
                    GUICtrlSetState($InputC_[$xkC], $GUI_DISABLE)
                    GUICtrlSetState($InputC1_[$xkC], $GUI_DISABLE) 
                    GUICtrlSetBkColor($LabelC_[$xkC], 0xD4D0C8)
                    $NameB = GUICtrlRead($InputC_[$xkC])
                  ;
                    If $xkC < 32 Then
                        $UnitC = $Header_C & "  " & $xkC
                    EndIf
                    EndIf
                if $msg = $CButtonC_[$xkC] then GUICtrlSetBkColor($LabelC_[$xkC], 0xFFFFFF)    
               ;if $msg = $CButtonA_[$xkA] then GUICtrlSetBkColor($LabelA_[$xkA], 0xFFFFFF)   ;from first tab to compare           
                If $xkC = 32 Then ExitLoop      
            Next 
        sleep(1)
        Case 3
          ;FORTH TAB CONTROLS------------------------------------------------------------------------------
            For $xkD = 1 To $countD
                If $msg = $TButtonD_[$xkD] And GUICtrlRead($InputD_[$xkD]) > "" Then
                    GUICtrlSetState($TButtonD_[$xkD], $GUI_DISABLE)
                    GUICtrlSetState($InputD_[$xkD], $GUI_DISABLE)
                    $TimerActiveD_[$xkD] = 1
                    If Not StringLen(String($TimerD_[$xkD])) Or $TimerResetd Then 
                        $TimerD_[$xkD] = TimerInit()
                        $TimerResetd = 0
                    Else
                        GUICtrlSetData($SButtonD_[$xkD], "Stop")
                    EndIf
                ElseIf $msg = $TButtonD_[$xkD] Then
                    MsgBox(64, "User Error", "Please Type in a Ticket Number   ", 3)
                EndIf
                If $msg = $SButtonD_[$xkD] And GUICtrlRead($SButtonD_[$xkD]) = "Reset" Then
                    GUICtrlSetData($LabelD_[$xkD], "00:00:00")
                    GUICtrlSetData($InputD_[$xkD], "")
                    GUICtrlSetData($InputD2_[$xkD], "")
                    GUICtrlSetData($InputD1_[$XkD], "")
                    GUICtrlSetData($SButtonD_[$xkD], "Stop")
                    GUICtrlSetState($TButtonD_[$xkD], $GUI_ENABLE)
                    GUICtrlSetState($InputD_[$xkD], $GUI_ENABLE)
                    GUICtrlSetState($InputD1_[$xkD], $GUI_ENABLE)
                    $TimerResetd = 1
                EndIf
                If $msg = $SButtonD_[$xkD] And GUICtrlRead($InputD_[$xkD]) <> "" And GUICtrlRead($SButtonD_[$xkD]) = "Stop" Then
                    $TimerActiveD_[$xkD] = 0
                    GUICtrlSetData($SButtonD_[$xkD], "Reset")
                    GUICtrlSetState($TButtonD_[$xkD], $GUI_DISABLE)
                    GUICtrlSetState($InputD_[$xkD], $GUI_DISABLE)
                    GUICtrlSetState($InputD1_[$xkD], $GUI_DISABLE) 
                    GUICtrlSetBkColor($LabelD_[$xkD], 0xD4D0C8)
                    $NameB = GUICtrlRead($InputD_[$xkD])
                  ;
                    If $xkD < 32 Then
                        $UnitD = $Header_D & "  " & $xkD
                    EndIf
                    EndIf
                if $msg = $CButtonD_[$xkD] then GUICtrlSetBkColor($LabelD_[$xkD], 0xFFFFFF)    
                        
                If $xkD = 32 Then ExitLoop      
            Next
         sleep(1)    
         case 4
              select    
                 Case $msg = $settingsA  ;options control tab
                        $UL1 = GUICtrlRead($UL1A)
                        $strln1 = Stringlen($UL1)
                     if $strln1 >0 then iniwrite("timer.ini", "level", "1", $UL1)
                     
                        $UL2 = GUICtrlRead($UL1B)
                        $strln2 = Stringlen($UL2)
                     if $strln2 >0 then iniwrite("timer.ini", "level", "1A", $UL2)
                     
                        $UL3 = GUICtrlRead($UL2A)
                        $strln3 = Stringlen($UL3)
                     if $strln3 >0 then iniwrite("timer.ini", "level", "2", $UL3)
                     
                        $UL4 = GUICtrlRead($UL2B)
                        $strln4 = Stringlen($UL4)
                     if $strln4 >0 then iniwrite("timer.ini", "level", "2A", $UL4)
                     
                        $UL5 = GUICtrlRead($UL3A)           
                        $strln5 = Stringlen($UL5)
                     if $strln5 >0 then iniwrite("timer.ini", "level", "3", $UL5)
                     
                        $UL6 = GUICtrlRead($UL3B)
                        $strln6 = Stringlen($UL6)
                     if $strln6 >0 then iniwrite("timer.ini", "level", "3A", $UL6)
                     
                        $UL7 = GUICtrlRead($UL4A)
                        $strln7 = Stringlen($UL7)
                     if $strln7 >0 then iniwrite("timer.ini", "level", "4", $UL7)
                     
                        $UL8 = GUICtrlRead($UL4B)
                        $strln8 = Stringlen($UL8)
                     if $strln8 >0 then iniwrite("timer.ini", "level", "4A", $UL8)
             
                        $UL9 = GUICtrlRead($UL5A)
                        $strln9 = Stringlen($UL9)
                     if $strln9 >0 then iniwrite("timer.ini", "level", "5", $UL9)
                     
                        $UL10 = GUICtrlRead($UL5B)
                        $strln10 = Stringlen($UL10)
                     if $strln10 >0 then iniwrite("timer.ini", "level", "5A", $UL10)             
                     MsgBox(0 + 64, "apply", "Settings saved", 2)   
             
                      case $msg = $settingsB
                           MsgBox(0 + 32, "Help", " How to use the T(egg) timer system:" & @CRLF _
                      & ""& @CRLF _
                      & "1. First, set the urgency level between 1 and 5. The input field"& @CRLF _
                      & "is becide the ticket number. Example: Ticket 43   'field'"& @CRLF _
                      & "2. Enter in the ServiceDesk ticket number under the start button."& @CRLF _
                      & "3. Click start. This starts the timer. If later you have the "& @CRLF _
                      & "engineer's name, you can enter it in the field under the ServicDesk"& @CRLF _
                      & "ticket number field. The name can be entered after the timer has "& @CRLF _
                      & "started. "& @CRLF _
                      & " The timer will change color to yellow at the first notify. When the "& @CRLF _
                      & "second notify occurs, the timer will change to red."& @CRLF _
                      & " When you need to stop the timer, click on stop. To reset the timer,"& @CRLF _          
                      & "click on stop again. It will be renamed 'reset' during this time."& @CRLF _
                      & " If you wish to have a alarm for voice, check the box for 'Every "& @CRLF _
                      & "hour notify to check voice' This will provide a reminder once a hour"& @CRLF _
                      & ""& @CRLF _
                      & ""& @CRLF _
                      & "Urgency Levels can only be set in hour increments") 
               
                      Case  $msg = $settingsC
                              MsgBox(0 + 32, "About", " T(egg) Timer 1.0, 2005, SunTrust Bank. "& @CRLF _
                      & " Written by Martin Hawes - CTS Richmond HDQ")
                      
                      Case  $msg = $settingsD
                      exit
                endselect 
                sleep(1)         
    EndSwitch
wend  


;=============================================
;============================================= 

Func AllTimers()
    ;reminder timer on options tab
    Local $Secs, $Mins, $Hour, $Time1, $Time2, $sTime1 = $Time1, $sTime2 = $Time2 
    Dim $read1 = "One, Hour, Past, Start"
    Dim $read2 = int($count) & ", Hours, Past, Start"  
    If $Timer1Active Then
        _TicksToTime(Int(TimerDiff($timer1)), $Hour, $Mins, $Secs)
        $Time1 = StringFormat("%02i:%02i:%02i", $Hour, $Mins, $Secs)
        If $sTime1 <> $Time1 Then GUICtrlSetData($Label_4, $Time1)
      
    EndIf
    If StringLeft((GUICtrlRead($Label_4)), 2) = $count Then 
        If $count = "01" Then
            _TalkOBJ($read1)
            MsgBox(64, " Hour Message", "Check Voice", 10)
        Else
            _TalkOBJ($read2)
            MsgBox(64, " Hour Message", $count & " Hours have Passed Check Voice   ", 10)
        EndIf
        $count = $count + "01"
        If $count < 10 then $count = "0" & $count
    EndIf
   
     ;first tab
    For $ckA = 1 To $countA
        
        If $TimerActiveA_[$ckA] Then
            _TicksToTime(Int(TimerDiff($TimerA_[$ckA])), $Hour, $Mins, $Secs)
            $TimeA_[$ckA] = StringFormat("%02i:%02i:%02i", $Hour, $Mins, $Secs)
            If $sTimeA_[$ckA] <> $TimeA_[$ckA] Then GUICtrlSetData($LabelA_[$ckA], $TimeA_[$ckA])
               $urg = GUICtrlread($InputA1_[$ckA], 0)
               if $urg = 1 then 
                  $iniR = iniread("timer.ini", "level", "1", "")
                      If $Hour == $iniR and $Secs == 0 Then                      
                      GUICtrlSetBkColor($LabelA_[$ckA], 0xFF0000 )   ;red
                      endif
               endif 
               sleep(2)  
               if $urg = 2 then 
                  $iniR = iniread("timer.ini", "level", "2", "")
                      If $Hour == $iniR and $Secs == 0 Then                      
                      GUICtrlSetBkColor($LabelA_[$ckA], 0xFFFF00 )   ;yellow
                      endif
                  $iniR2 = iniread("timer.ini", "level", "2A", "")
                      If $Hour == $iniR2 and $Secs == 0 Then                      
                      GUICtrlSetBkColor($LabelA_[$ckA], 0xFF0000 )   ;red
                      endif
                endif
                sleep(2)
                if $urg = 3 then 
                  $iniR = iniread("timer.ini", "level", "3", "")
                      If $Hour == $iniR and $Secs == 0 Then                      
                      GUICtrlSetBkColor($LabelA_[$ckA], 0xFFFF00 )   ;yellow
                      endif
                  $iniR2 = iniread("timer.ini", "level", "3A", "")
                      If $Hour == $iniR2 and $Secs == 0 Then                      
                      GUICtrlSetBkColor($LabelA_[$ckA], 0xFF0000 )   ;red
                      endif
                endif 
                sleep(2)               
                if $urg = 4 then 
                  $iniR = iniread("timer.ini", "level", "4", "")
                      If $Hour == $iniR and $Secs == 0 Then                      
                      GUICtrlSetBkColor($LabelA_[$ckA], 0xFFFF00 )   ;yellow
                      endif
                  $iniR2 = iniread("timer.ini", "level", "4A", "")
                      If $Hour == $iniR2 and $Secs == 0 Then                      
                      GUICtrlSetBkColor($LabelA_[$ckA], 0xFF0000 )   ;red
                      endif
                endif
                sleep(2)
                if $urg = 5 then 
                  $iniR = iniread("timer.ini", "level", "5", "")
                      If $Hour == $iniR and $Secs == 0 Then                      
                      GUICtrlSetBkColor($LabelA_[$ckA], 0xFFFF00 )   ;yellow
                      endif
                  $iniR2 = iniread("timer.ini", "level", "5A", "")
                      If $Hour == $iniR2 and $Secs == 0 Then                      
                      GUICtrlSetBkColor($LabelA_[$ckA], 0xFF0000 )   ;red
                      endif
                endif
        EndIf
    Next
   ;second tab
    For $ckB = 1 To $countB
        
        If $TimerActiveB_[$ckB] Then
            _TicksToTime(Int(TimerDiff($TimerB_[$ckB])), $Hour, $Mins, $Secs)
            $TimeB_[$ckB] = StringFormat("%02i:%02i:%02i", $Hour, $Mins, $Secs)
            If $sTimeB_[$ckB] <> $TimeB_[$ckB] Then GUICtrlSetData($LabelB_[$ckB], $TimeB_[$ckB])
               $urg2 = GUICtrlread($InputB1_[$ckB], 0)
               if $urg2 = 1 then 
                  $iniR = iniread("timer.ini", "level", "1", "")
                      If $Hour == $iniR and $Secs == 0 Then                      
                      GUICtrlSetBkColor($LabelB_[$ckB], 0xFF0000 )   ;red
                      endif
               endif 
               sleep(2)  
               if $urg2 = 2 then 
                  $iniR = iniread("timer.ini", "level", "2", "")
                      If $Hour == $iniR and $Secs == 0 Then                      
                      GUICtrlSetBkColor($LabelB_[$ckB], 0xFFFF00 )   ;yellow
                      endif
                  $iniR2 = iniread("timer.ini", "level", "2A", "")
                      If $Hour == $iniR2 and $Secs == 0 Then                      
                      GUICtrlSetBkColor($LabelB_[$ckB], 0xFF0000 )   ;red
                      endif
                endif
                sleep(2)
                if $urg2 = 3 then 
                  $iniR = iniread("timer.ini", "level", "3", "")
                      If $Hour == $iniR and $Secs == 0 Then                      
                      GUICtrlSetBkColor($LabelB_[$ckB], 0xFFFF00 )   ;yellow
                      endif
                  $iniR2 = iniread("timer.ini", "level", "3A", "")
                      If $Hour == $iniR2 and $Secs == 0 Then                      
                      GUICtrlSetBkColor($LabelB_[$ckB], 0xFF0000 )   ;red
                      endif
                endif 
                sleep(2)               
                if $urg2 = 4 then 
                  $iniR = iniread("timer.ini", "level", "4", "")
                      If $Hour == $iniR and $Secs == 0 Then                      
                      GUICtrlSetBkColor($LabelB_[$ckB], 0xFFFF00 )   ;yellow
                      endif
                  $iniR2 = iniread("timer.ini", "level", "4A", "")
                      If $Hour == $iniR2 and $Secs == 0 Then                      
                      GUICtrlSetBkColor($LabelB_[$ckB], 0xFF0000 )   ;red
                      endif
                endif
                sleep(2)
                if $urg2 = 5 then 
                  $iniR = iniread("timer.ini", "level", "5", "")
                      If $Hour == $iniR and $Secs == 0 Then                      
                      GUICtrlSetBkColor($LabelB_[$ckB], 0xFFFF00 )   ;yellow
                      endif
                  $iniR2 = iniread("timer.ini", "level", "5A", "")
                      If $Hour == $iniR2 and $Secs == 0 Then                      
                      GUICtrlSetBkColor($LabelB_[$ckB], 0xFF0000 )   ;red
                      endif
                endif
        EndIf
    Next   
   ;THIRD TIMER
        For $ckC = 1 To $countC
        
        If $TimerActiveC_[$ckC] Then
            _TicksToTime(Int(TimerDiff($TimerC_[$ckC])), $Hour, $Mins, $Secs)
            $TimeC_[$ckC] = StringFormat("%02i:%02i:%02i", $Hour, $Mins, $Secs)
            If $sTimeC_[$ckC] <> $TimeC_[$ckC] Then GUICtrlSetData($LabelC_[$ckC], $TimeC_[$ckC])
            $urg3 = GUICtrlread($InputC1_[$ckC], 0)
               if $urg3 = 1 then 
                  $iniR = iniread("timer.ini", "level", "1", "")
                      If $Hour == $iniR and $Secs == 0 Then                      
                      GUICtrlSetBkColor($LabelC_[$ckC], 0xFF0000 )   ;red
                      endif
               endif 
               sleep(2)  
               if $urg3 = 2 then 
                  $iniR = iniread("timer.ini", "level", "2", "")
                      If $Hour == $iniR and $Secs == 0 Then                      
                      GUICtrlSetBkColor($LabelC_[$ckC], 0xFFFF00 )   ;yellow
                      endif
                  $iniR2 = iniread("timer.ini", "level", "2A", "")
                      If $Hour == $iniR2 and $Secs == 0 Then                      
                      GUICtrlSetBkColor($LabelC_[$ckC], 0xFF0000 )   ;red
                      endif
                endif
                sleep(2)
                if $urg3 = 3 then 
                  $iniR = iniread("timer.ini", "level", "3", "")
                      If $Hour == $iniR and $Secs == 0 Then                      
                      GUICtrlSetBkColor($LabelC_[$ckC], 0xFFFF00 )   ;yellow
                      endif
                  $iniR2 = iniread("timer.ini", "level", "3A", "")
                      If $Hour == $iniR2 and $Secs == 0 Then                      
                      GUICtrlSetBkColor($LabelC_[$ckC], 0xFF0000 )   ;red
                      endif
                endif 
                sleep(2)               
                if $urg3 = 4 then 
                  $iniR = iniread("timer.ini", "level", "4", "")
                      If $Hour == $iniR and $Secs == 0 Then                      
                      GUICtrlSetBkColor($LabelC_[$ckC], 0xFFFF00 )   ;yellow
                      endif
                  $iniR2 = iniread("timer.ini", "level", "4A", "")
                      If $Hour == $iniR2 and $Secs == 0 Then                      
                      GUICtrlSetBkColor($LabelC_[$ckC], 0xFF0000 )   ;red
                      endif
                endif
                sleep(2)
                if $urg3 = 5 then 
                  $iniR = iniread("timer.ini", "level", "5", "")
                      If $Hour == $iniR and $Secs == 0 Then                      
                      GUICtrlSetBkColor($LabelC_[$ckC], 0xFFFF00 )   ;yellow
                      endif
                  $iniR2 = iniread("timer.ini", "level", "5A", "")
                      If $Hour == $iniR2 and $Secs == 0 Then                      
                      GUICtrlSetBkColor($LabelC_[$ckC], 0xFF0000 )   ;red
                      endif
                endif
        EndIf
    Next
   ;FORTH TIMER
        For $ckD = 1 To $countD
        
        If $TimerActiveD_[$ckD] Then
            _TicksToTime(Int(TimerDiff($TimerD_[$ckD])), $Hour, $Mins, $Secs)
            $TimeD_[$ckD] = StringFormat("%02i:%02i:%02i", $Hour, $Mins, $Secs)
            If $sTimeD_[$ckD] <> $TimeD_[$ckD] Then GUICtrlSetData($LabelD_[$ckD], $TimeD_[$ckD])
            $urg4 = GUICtrlread($InputD1_[$ckD], 0)
               if $urg4 = 1 then 
                  $iniR = iniread("timer.ini", "level", "1", "")
                      If $Hour == $iniR and $Secs == 0 Then                      
                      GUICtrlSetBkColor($LabelD_[$ckD], 0xFF0000 )   ;red
                      endif
               endif 
               sleep(2)  
               if $urg4 = 2 then 
                  $iniR = iniread("timer.ini", "level", "2", "")
                      If $Hour == $iniR and $Secs == 0 Then                      
                      GUICtrlSetBkColor($LabelD_[$ckD], 0xFFFF00 )   ;yellow
                      endif
                  $iniR2 = iniread("timer.ini", "level", "2A", "")
                      If $Hour == $iniR2 and $Secs == 0 Then                      
                      GUICtrlSetBkColor($LabelD_[$ckD], 0xFF0000 )   ;red
                      endif
                endif
                sleep(2)
                if $urg4 = 3 then 
                  $iniR = iniread("timer.ini", "level", "3", "")
                      If $Hour == $iniR and $Secs == 0 Then                      
                      GUICtrlSetBkColor($LabelD_[$ckD], 0xFFFF00 )   ;yellow
                      endif
                  $iniR2 = iniread("timer.ini", "level", "3A", "")
                      If $Hour == $iniR2 and $Secs == 0 Then                      
                      GUICtrlSetBkColor($LabelD_[$ckD], 0xFF0000 )   ;red
                      endif
                endif 
                sleep(2)               
                if $urg4 = 4 then 
                  $iniR = iniread("timer.ini", "level", "4", "")
                      If $Hour == $iniR and $Secs == 0 Then                      
                      GUICtrlSetBkColor($LabelD_[$ckD], 0xFFFF00 )   ;yellow
                      endif
                  $iniR2 = iniread("timer.ini", "level", "4A", "")
                      If $Hour == $iniR2 and $Secs == 0 Then                      
                      GUICtrlSetBkColor($LabelD_[$ckD], 0xFF0000 )   ;red
                      endif
                endif
                sleep(2)
                if $urg4 = 5 then 
                  $iniR = iniread("timer.ini", "level", "5", "")
                      If $Hour == $iniR and $Secs == 0 Then                      
                      GUICtrlSetBkColor($LabelD_[$ckD], 0xFFFF00 )   ;yellow
                      endif
                  $iniR2 = iniread("timer.ini", "level", "5A", "")
                      If $Hour == $iniR2 and $Secs == 0 Then                      
                      GUICtrlSetBkColor($LabelD_[$ckD], 0xFF0000 )   ;red
                      endif
                endif
        EndIf
    Next 
EndFunc ;==>All Timers


Func _TalkOBJ($s_text)
    Local $o_speech
    $o_speech = ObjCreate("SAPI.SpVoice")
    $o_speech.Speak ($s_text)
    $o_speech = ""
EndFunc ;==>_TalkOBJ
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...