Scanzee Posted October 30, 2005 Posted October 30, 2005 $sec = 0 #include <GUIConstants.au3> Opt("GUIOnEventMode",1) GUICreate("Inloggen", 200, 200) While 1 For $sec = 1 to 59 Step 1 $LabelID = GUICtrlCreateLabel($sec, 10, 30,) Sleep(1000) Next GUISetState() Wend ------------------------------------------------------------------ Whit this script you 're able to see the seconds like a stopwatch.. But here is the problem: If you use the script like above the seconds are counting but they stay on de screen:(1,2,3,...) are at the same time on the screen. I hope you understand my question and have a nice answer for me. Thanks Scanzee Products<Scanzee@hotmail.com>
Developers Jos Posted October 30, 2005 Developers Posted October 30, 2005 maybe this will help you to get started: $sec = 0 #include <GUIConstants.au3> Opt("GUIOnEventMode",1) GUICreate("Inloggen", 200, 200) $LabelID = GUICtrlCreateLabel($sec, 10, 30) GUISetState() For $sec = 1 to 59 Step 1 Sleep(1000) GUICtrlSetData($LabelID,$sec) Next SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Scanzee Posted October 30, 2005 Author Posted October 30, 2005 That problem is gone but.. Here is some other.. If the seconds are < 10 Then the computer shows 1,2,3,... But The computer has to show 01,02,03 what do I have to do?! Thanks
MHz Posted October 30, 2005 Posted October 30, 2005 You can add a 0 to the display like with this example For $i = 1 To 59 MsgBox(0, '', StringRight('0' & $i, 2), 1) Next
Developers Jos Posted October 30, 2005 Developers Posted October 30, 2005 (edited) here's an example i posted a while ago: #include <GUIConstants.au3> #include <Date.au3> opt("TrayIconDebug", 1) Global $Secs, $Mins, $Hour, $Time ;Create GUI GUICreate("My Timer", 200, 200) GUICtrlCreateLabel("00:00:00", "80", "80") GUISetState() ;Start timer $timer = TimerInit() AdlibEnable("Timer", 50) ; While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit EndSelect WEnd ; Func Timer() _TicksToTime(Int(TimerDiff($timer)), $Hour, $Mins, $Secs) Local $sTime = $Time; save current time to be able to test and avoid flicker.. $Time = StringFormat("%02i:%02i:%02i", $Hour, $Mins, $Secs) If $sTime <> $Time Then ControlSetText("My Timer", "", "Static1", $Time) EndFunc ;==>Timer Edited October 30, 2005 by JdeB SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Scanzee Posted October 31, 2005 Author Posted October 31, 2005 All problems are almost gone.. Just this one (I hope).. $Minop = $Min if $Minop = ($Minop + 4) Then MsgBox(0,"MsgBox","Ready") endif I know this part of my script doesn't make any sens but I hope someone could help me out...
w0uter Posted October 31, 2005 Posted October 31, 2005 how can that if-statement ever be true ? do you want to like wait until it is true ? if so check out While loop's. My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll
Scanzee Posted November 2, 2005 Author Posted November 2, 2005 I don't know what to do with this.. Do someone have a idea?! Need help..
LxP Posted November 2, 2005 Posted November 2, 2005 I would suggest posting the logic of your script, which is needed before any code can be written. Example:Wait for 4 minutes.Show a ready message.
Scanzee Posted November 2, 2005 Author Posted November 2, 2005 Is this what you mean? *I 'm using some time calculation like above... *Func Timedifrent: After 4 minutes (from my one timecalculation) * MsgBox(...,"Msg","You are ready") It has to be something like this!
Scanzee Posted November 2, 2005 Author Posted November 2, 2005 expandcollapse popupFunc Tijd() For $sec = 0 to 59 Step 30 If $sec < 10 Then $sec = "0" & $sec EndIf If $Min = 59 And $Sec = 00 Then $Min = -1 EndIf If $sec = 00 Then Global $variable If Assign("variable", "Hello") Then $Min = $Min + 1 if $Min < 10 Then $Min = "0" & $Min endif EndIf If $Hour = 23 And $Min = 00 Then $Hour = -1 if $Day = 30 Then $Day = 0 Global $variable If Assign("variable", "Hello") Then $Month = $Month + 1 endif Global $variable If Assign("variable", "Hello") Then $Day = $Day + 1 EndIf If $month = 13 Then $Month = 01 Global $variable If Assign("variable", "Hello") Then $Year = $Year + 1 EndIf If $Min = 00 And $sec = 00 Then Global $variable If Assign("variable", "Hello") Then $Hour = $Hour + 1 if $Hour < 10 Then $Hour = "0" & $Hour endif if $Day < 10 And $Hour = 00 Then $Day = "0" & $Day endif if $Month = 01 And $Day = 01 Then $Month = "0" & $Month endif EndIf Sleep(750) GUICtrlSetData($LabelTimeID,$Hour & ":" & $Min & ":" & $sec) GUICtrlSetData($LabelDateID,$Day & "/" & $Month & "/" & $Year) GUICtrlSetData($Label04ID,"Je hebt " & $gold & " Gold " & $Silverplate & " Silverplate " & $Silver &" Silver") Next EndFunc This is my one timecalculation!!!!
LxP Posted November 2, 2005 Posted November 2, 2005 Hmm... why are you using Assign()?...Perhaps it might be a good idea to step back. What is the logic of your entire script? What is its purpose? How would you describe all of its functionality in plain English (i.e. not as code)?
Nuffilein805 Posted November 2, 2005 Posted November 2, 2005 do you want to run your script 24/7 the whole year? or why do you need months in your script?i don't get your question (haven't found it in your code)could you explain where you want to use that?*Func Timedifrent: After 4 minutes (from my one timecalculation) * MsgBox(...,"Msg","You are ready") my little chatmy little encryption toolmy little hidermy unsafe clickbot
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