Jump to content

Clock help~!


kdf2883
 Share

Recommended Posts

Ok the time that it shows in my program keeps doing these fidgets when it changes over to another minute I tried using sleep but it delays my script when i want to use the add button.All in all, i want the label to stop fidgeting.Please help me if you can~

;
; AutoIt Version: 3.0
; Language:    English
; Platform:    Win9x/NT
; Author:        
;
; Script Function:
;   Timestamp
;
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListBoxConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Date.au3>
#include <GuiConstants.au3>
#include <Constants.au3>
#NoTrayIcon
#Include <GUIEdit.au3>
#Include <String.au3>
#Include <IE.au3>
#Include <INet.au3>


$Form1_1 = GUICreate("Form1", 622, 210, 193, 125,$WS_OVERLAPPEDWINDOW)
$hnmlist = GUICtrlCreateList("", 16, 32, 489, 149)
$Addtime = GUICtrlCreateButton("Add", 512, 72, 89, 33, 0)
$delete = GUICtrlCreateButton("Delete", 512, 112, 89, 33, 0)
$clearlist = GUICtrlCreateButton("Clear List", 512, 152, 89, 33, 0)

$timeleft = GUICtrlCreateLabel("", 228, 16, 43, 15)
$Windows = GUICtrlCreateLabel("", 444, 16, 43, 15)
$clockitbutton = GUICtrlCreateButton("Clock It!", 512, 32, 91, 33, 0)
$Label1 = GUICtrlCreateLabel("Current Time:", 16, 8, 67, 17)
$Label2 = GUICtrlCreateLabel("Til Next Window", 136, 8, 82, 17)
$Label3 = GUICtrlCreateLabel("Window:", 368, 8, 65, 17)
GUISetState(@SW_SHOW)

While 1
        Refreshtime()
    _IELoadWaitTimeout(1000)
 Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Addtime
            MsgBox(0,"","test")
    EndSwitch
WEnd

Func ExitScript()
    Exit
EndFunc
Func addtolist()
EndFunc
Func removefromlist()

EndFunc
Func clearlist()

EndFunc
Func Refreshtime()
$currenttime = GUICtrlCreateLabel(_NowTime(), 84, 8, 43, 15)
    EndFunc
Link to comment
Share on other sites

I am sorry to say this, but half your script does nothing and the other half is pointless. You should open the helpfile and read about, well everything..... :D

Link to comment
Share on other sites

It's a work in progress and the help file doesn't help me at all.

Why doesn't it help? It contains just about everything you need... Multiple examples (in most cases), technical information for the function, explanations, syntax... Whats not there to help you?
Link to comment
Share on other sites

Ok the time that it shows in my program keeps doing these fidgets when it changes over to another minute I tried using sleep but it delays my script when i want to use the add button.All in all, i want the label to stop fidgeting.Please help me if you can~

;
; AutoIt Version: 3.0
; Language:    English
; Platform:    Win9x/NT
; Author:        
;
; Script Function:
;   Timestamp
;
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListBoxConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Date.au3>
#include <GuiConstants.au3>
#include <Constants.au3>
#NoTrayIcon
#Include <GUIEdit.au3>
#Include <String.au3>
#Include <IE.au3>
#Include <INet.au3>


$Form1_1 = GUICreate("Form1", 622, 210, 193, 125,$WS_OVERLAPPEDWINDOW)
$hnmlist = GUICtrlCreateList("", 16, 32, 489, 149)
$Addtime = GUICtrlCreateButton("Add", 512, 72, 89, 33, 0)
$delete = GUICtrlCreateButton("Delete", 512, 112, 89, 33, 0)
$clearlist = GUICtrlCreateButton("Clear List", 512, 152, 89, 33, 0)

$timeleft = GUICtrlCreateLabel("", 228, 16, 43, 15)
$Windows = GUICtrlCreateLabel("", 444, 16, 43, 15)
$clockitbutton = GUICtrlCreateButton("Clock It!", 512, 32, 91, 33, 0)
$Label1 = GUICtrlCreateLabel("Current Time:", 16, 8, 67, 17)
$Label2 = GUICtrlCreateLabel("Til Next Window", 136, 8, 82, 17)
$Label3 = GUICtrlCreateLabel("Window:", 368, 8, 65, 17)
GUISetState(@SW_SHOW)

While 1
        Refreshtime()
    _IELoadWaitTimeout(1000)
 Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Addtime
            MsgBox(0,"","test")
    EndSwitch
WEnd

Func ExitScript()
    Exit
EndFunc
Func addtolist()
EndFunc
Func removefromlist()

EndFunc
Func clearlist()

EndFunc
Func Refreshtime()
$currenttime = GUICtrlCreateLabel(_NowTime(), 84, 8, 43, 15)
    EndFunc
Change the function Refreshtime. Create the label with all the other labels and controls and then the function Refreshtime cam be used to update the label as needed. Best to only update the label when the time has changed, so on the basis that it will need updating only every second, then instead of putting Refreshtime in your main loop so that it's called many times a second, use AdliEnable.

; AutoIt Version: 3.0
; Language:    English
; Platform:    Win9x/NT
; Author:
;
; Script Function:
;   Timestamp
;
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListBoxConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Date.au3>
#include <GuiConstants.au3>
#include <Constants.au3>
#NoTrayIcon
#include <GUIEdit.au3>
#include <String.au3>
#include <IE.au3>
#include <INet.au3>


$Form1_1 = GUICreate("Form1", 622, 210, 193, 125, $WS_OVERLAPPEDWINDOW)
$hnmlist = GUICtrlCreateList("", 16, 32, 489, 149)
$Addtime = GUICtrlCreateButton("Add", 512, 72, 89, 33, 0)
$delete = GUICtrlCreateButton("Delete", 512, 112, 89, 33, 0)
$clearlist = GUICtrlCreateButton("Clear List", 512, 152, 89, 33, 0)

$timeleft = GUICtrlCreateLabel("", 228, 16, 43, 15)
$Windows = GUICtrlCreateLabel("", 444, 16, 43, 15)
$clockitbutton = GUICtrlCreateButton("Clock It!", 512, 32, 91, 33, 0)
$Label1 = GUICtrlCreateLabel("Current Time:", 16, 8, 67, 17)
$Label2 = GUICtrlCreateLabel("Til Next Window", 136, 8, 82, 17)
$Label3 = GUICtrlCreateLabel("Window:", 368, 8, 65, 17)
$timelab = GUICtrlCreateLabel(_NowTime(), 84, 8, 43, 15)
GUISetState(@SW_SHOW)
AdlibEnable("Refreshtime", 1000);every second
While 1
    _IELoadWaitTimeout(1000)
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Addtime
            MsgBox(0, "", "test")
    EndSwitch
WEnd

Func ExitScript()
    Exit
EndFunc  ;==>ExitScript
Func addtolist()
EndFunc  ;==>addtolist
Func removefromlist()

EndFunc  ;==>removefromlist

Func clearlist()

EndFunc  ;==>clearlist

Func Refreshtime()
    GUICtrlSetData($timelab, _NowTime())
EndFunc  ;==>Refreshtime
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
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...