Madza91 Posted October 29, 2007 Share Posted October 29, 2007 Why not working this: #include <GUIConstants.au3> #include <Date.au3> $Main = GUICreate("Automation Program", 500, 400, -1, -1) $btnStart5 = GUICtrlCreateButton("Exit", 200, 40, 81, 25, 0) $lblTime = GUICtrlCreateLabel( _NowTime() ,170,80,150,25) $lastsec = @SEC GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE GUIDelete() Exit Case $msg = $btnStart5 MsgBox(0x0, "Click", "you clicked Exit ", 3) Exit EndSelect updateTime() WEnd If $lblTime = "23:00:00" Then GUICtrlCreateButton("Start", 100, 40, 81, 25, 0) EndIf Func updateTime() $cursec = @SEC if $cursec <> $lastsec Then $lastsec = $cursec GUICtrlSetData($lblTime,_NowTime()) EndIfEndFuncI want to create button if is label = 23:00:00 :| [quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :) Link to comment Share on other sites More sharing options...
James Posted October 29, 2007 Share Posted October 29, 2007 GuiCtrlRead() Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Madza91 Posted October 29, 2007 Author Share Posted October 29, 2007 (edited) I know for normal label, but how to use GuiCtrlRead() on this clock label? Edited October 29, 2007 by n3nE [quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :) Link to comment Share on other sites More sharing options...
James Posted October 29, 2007 Share Posted October 29, 2007 So you want to check that the label = 23:00 Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Madza91 Posted October 29, 2007 Author Share Posted October 29, 2007 yes See this:#include <GUIConstants.au3> #include <Date.au3> $Main = GUICreate("Automation Program", 500, 400, -1, -1) $btnStart5 = GUICtrlCreateButton("Exit", 200, 40, 81, 25, 0) $lblTime = GUICtrlCreateLabel( _NowTime() ,170,80,150,25) $lastsec = @SEC GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE GUIDelete() Exit Case $msg = $btnStart5 MsgBox(0x0, "Click", "you clicked Exit ", 3) Exit EndSelect updateTime() WEnd $item = GUICtrlRead($lblTime) If $item = "23:14:20" Then GUICtrlCreateButton("Start", 100, 40, 81, 25, 0) EndIf Func updateTime() $cursec = @SEC if $cursec <> $lastsec Then $lastsec = $cursec GUICtrlSetData($lblTime,_NowTime()) EndIfEndFuncWith GUICtrlRead but not working :S [quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :) Link to comment Share on other sites More sharing options...
James Posted October 29, 2007 Share Posted October 29, 2007 If GuiCtrlRead($CLOCKLABEL) == "23:00" Then ;Do Something EndIf Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Madza91 Posted October 29, 2007 Author Share Posted October 29, 2007 (edited) You dont understand me...I MADED THIS BUT WITH BUG :/#include <GUIConstants.au3> #include <Date.au3> $Main = GUICreate("Automation Program", 500, 400, -1, -1) $btnStart5 = GUICtrlCreateButton("Exit", 200, 40, 81, 25, 0) $lblTime = GUICtrlCreateLabel( _NowTime() ,170,80,150,25) $lastsec = @SEC GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE GUIDelete() Exit Case $msg = $btnStart5 MsgBox(0x0, "Click", "you clicked Exit ", 3) Exit EndSelect updateTime() If GuiCtrlRead($lblTime) == "23:27:10" Then GUICtrlCreateButton("Start", 100, 40, 81, 25, 0) EndIf WEnd Func updateTime() $cursec = @SEC if $cursec <> $lastsec Then $lastsec = $cursec GUICtrlSetData($lblTime,_NowTime()) EndIfEndFuncSTART button is bugged :S Edited October 29, 2007 by n3nE [quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :) Link to comment Share on other sites More sharing options...
Nevin Posted October 30, 2007 Share Posted October 30, 2007 (edited) Not bugged. You forgot to add AM or PM in here: If GuiCtrlRead($lblTime) == "9:59:50 PM" Then Does it work now? It worked for me. That's the time it was when I did it. To make it more dependable, you might want to pass a parameter to _NowTime. Without a parameter it will use the local computer's settings, which may be different than what you are checking for. The Start button looks a little funny at first, because the loop runs many times during that one second, so it keeps loading the button. You could fix that, though. just ask if you dont know how. I hope I fixed it for you. Edited October 30, 2007 by Nevin Link to comment Share on other sites More sharing options...
Madza91 Posted October 31, 2007 Author Share Posted October 31, 2007 Yes, tnx man [quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now