Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #cs ----------------------------------------------------------------------------
- AutoIt Version: 3.3.6.1
- Author: FreeCoder
- Script Function:
- Example AutoIt script.
- #ce ----------------------------------------------------------------------------
- #include <GUIConstantsEx.au3>
- Global $timer = 0
- Global $hGui = GUICreate("Test", 320, 40)
- Global $checkBox1 = GUICtrlCreateCheckbox("Timer:", 20, 10)
- Global $textBox1 = GUICtrlCreateInput("5", 75, 10)
- Global $label1 = GUICtrlCreateLabel("Sekunden", 135, 13)
- Global $button1 = GUICtrlCreateButton("Start", 190, 8, 50)
- Global $button2 = GUICtrlCreateButton("Stop", 250, 8, 50)
- GUISetState(@SW_SHOW, $hGui)
- While True
- ; Checkout GUI events...
- $msg = GUIGetMsg()
- Switch $msg
- Case -3
- Exit
- Case $button1
- $timer = TimerInit()
- Case $button2
- $timer = 0
- EndSwitch
- ; Disable/Enable Textbox
- Local $state = GUICtrlRead($checkBox1)
- If $state = 1 Then
- GUICtrlSetState($textBox1, $GUI_ENABLE)
- ElseIf $state = 4 Then
- GUICtrlSetState($textBox1, $GUI_DISABLE)
- EndIf
- ConsoleWrite((TimerDiff($timer) / 1000) & @CRLF)
- ; Timer reaction
- If $timer > 0 And (TimerDiff($timer) / 1000) >= GUICtrlRead($textBox1) Then
- Reinit()
- EndIf
- ; Sleep a while... ^^
- Sleep(50)
- WEnd
- Func Reinit()
- $timer = TimerInit()
- MsgBox(64, "", "Entjungfert xD")
- EndFunc
Add Comment
Please, Sign In to add comment