I want to start off by saying i have self taught myself starting about 6 mos ago and this is my 3rd day on project about 16 hrs in..
You guys are freaking awesome! I was tasked with creating a timer for my company to track workers progress (they were not happy about that!) and had hit a fat wall because they wanted 6-10 independently operating timers and originally i was working with a timer that i found that was super complicated and could not get it to work right.
Then a light shined down as i was exploring new options and i saw this post.
From it i created:
Code:
#NoEnv
#singleinstance force
Settimer, Stopwatch, off
timerm := "00"
timers := "00"
stopped := "0"
timerm1 := "00"
timers1 := "00"
stopped1 := "0"
timerm2 := "00"
timers2 := "00"
stopped2 := "0"
timerm3 := "00"
timers3 := "00"
stopped3 := "0"
timerm4 := "00"
timers4 := "00"
stopped4 := "0"
timerm5 := "00"
timers5 := "00"
stopped5 := "0"
;StartTime := A_Hour . ":" . A_Min . ":" . A_Sec
;StopTime := "00:00:00"
Gui, Add, Text, x85 y5 w160 h20 vStartTime, Start = %StartTime%
Gui, Add, Text, x40 y52 w160 h20 vStopTime, Stop = %StopTime%
Gui, Add, Text, x155 y30 w60 h20 vTText, %timerm%:%timers%
Gui, Add, Text, x155 y70 w60 h20 vTText1, %timerm1%:%timers1%
Gui, Add, Text, x155 y110 w60 h20 vTText2, %timerm2%:%timers2%
Gui, Add, Text, x155 y150 w60 h20 vTText3, %timerm3%:%timers3%
Gui, Add, Text, x155 y190 w60 h20 vTText4, %timerm4%:%timers4%
Gui, Add, Text, x155 y230 w60 h20 vTText5, %timerm5%:%timers5%
;Gui, Add, Button, x2 y42 w80 h20 vPause, Pause
;Gui, Add, Button, x82 y42 w80 h20 vReset, Reset
Gui, Add, Button, x22 y20 w90 h30 gThe_Main_Gui_StopStart1 , &QC
Gui, Add, Button, x22 y60 w90 h30 gThe_Main_Gui_StopStart2 , &Sketch
Gui, Add, Button, x22 y100 w90 h30 gThe_Main_Gui_StopStart3 , &Tech
Gui, Add, Button, x22 y140 w90 h30 gThe_Main_Gui_StopStart4 , &Pokemon
Gui, Add, Button, x22 y180 w90 h30 gThe_Main_Gui_StopStart5 , &Intimate time
Gui, Add, Button, x22 y220 w90 h30 gThe_Main_Gui_StopStart6 , &Unicorn Dance
Gui, Add, Button, x22 y270 w90 h30 gThe_Main_Gui_Close, &Quit
gui, add, edit, w200 vMyEdit
Gui, Show, h400 w250, Stopwatch
Return
Stopwatch:
timers += 1
if(timers > 59)
{
timerm += 1
timers := "0"
GuiControl, , TText , %timerm%:%timers%
}
if(timers < 10)
{
GuiControl, , TText , %timerm%:0%timers%
}
else
{
GuiControl, , TText , %timerm%:%timers%
}
return
Stopwatch1:
timers1 += 1
if(timers1 > 59)
{
timerm1 += 1
timers1 := "0"
GuiControl, , TText1 , %timerm1%:%timers1%
}
if(timers < 10)
{
GuiControl, , TText1 , %timerm1%:0%timers1%
}
else
{
GuiControl, , TText1 , %timerm1%:%timers1%
}
return
Stopwatch2:
timers2 += 1
if(timers2 > 59)
{
timerm2 += 1
timers2 := "0"
GuiControl, , TText2 , %timerm2%:%timers2%
}
if(timers < 10)
{
GuiControl, , TText2 , %timerm%:0%timers2%
}
else
{
GuiControl, , TText2 , %timerm%:%timers2%
}
return
Stopwatch3:
timers3 += 1
if(timers3 > 59)
{
timerm3 += 1
timers3 := "0"
GuiControl, , TText3 , %timerm3%:%timers3%
}
if(timers < 10)
{
GuiControl, , TText3 , %timerm3%:0%timers3%
}
else
{
GuiControl, , TText3 , %timerm3%:%timers3%
}
return
Stopwatch4:
timers4 += 1
if(timers4 > 59)
{
timerm4 += 1
timers4 := "0"
GuiControl, , TText4 , %timerm4%:%timers4%
}
if(timers < 10)
{
GuiControl, , TText4 , %timerm4%:0%timers4%
}
else
{
GuiControl, , TText4 , %timerm4%:%timers4%
}
return
Stopwatch5:
timers5 += 1
if(timers5 > 59)
{
timerm5 += 1
timers5 := "0"
GuiControl, , TText5 , %timerm5%:%timers5%
}
if(timers < 10)
{
GuiControl, , TText5 , %timerm5%:0%timers5%
}
else
{
GuiControl, , TText5 , %timerm5%:%timers5%
}
return
The_Main_Gui_StopStart1:
if(stopped = 0)
{
Settimer, Stopwatch, off
stopped = 1
}
else
{
Settimer, Stopwatch, 999
stopped = 0
}
return
The_Main_Gui_StopStart2:
if(stopped = 0)
{
Settimer, Stopwatch1, off
stopped = 1
}
else
{
Settimer, Stopwatch1, 999
stopped = 0
}
return
The_Main_Gui_StopStart3:
if(stopped = 0)
{
Settimer, Stopwatch2, off
stopped = 1
}
else
{
Settimer, Stopwatch2, 999
stopped = 0
}
return
The_Main_Gui_StopStart4:
if(stopped = 0)
{
Settimer, Stopwatch3, off
stopped = 1
}
else
{
Settimer, Stopwatch3, 999
stopped = 0
}
return
The_Main_Gui_StopStart5:
if(stopped = 0)
{
Settimer, Stopwatch4, off
stopped = 1
}
else
{
Settimer, Stopwatch4, 999
stopped = 0
}
return
The_Main_Gui_StopStart6:
if(stopped = 0)
{
Settimer, Stopwatch5, off
stopped = 1
}
else
{
Settimer, Stopwatch5, 999
stopped = 0
}
return
The_Main_Gui_Close:
Exitapp
ButtonPause:
if(stopped = 0)
{
Settimer, Stopwatch, off
stopped = 1
}
else
{
Settimer, Stopwatch, 999
stopped = 0
}
return
ButtonReset:
timerm := "00"
timers := "00"
GuiControl, , TText , %timerm%:%timers%
return
GuiClose:
GuiEscape:
ExitApp
return
and was able to wow my bosses thanks a lot now to add the file append feature.
THANKS AGAIN