SeaSky Posted May 1, 2012 Share Posted May 1, 2012 Hi i went my Script went work Example when i chick on Checkbox1 and chick start write 1 and when i write 3 Sec in Input and chick start write 1 all 3 sec and when chick Stop All Stop expandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Test", 423, 139, 731, 405, 0) GUISetBkColor(0x646464) $Checkbox1 = GUICtrlCreateCheckbox("1", 144, 0, 25, 17) $Checkbox2 = GUICtrlCreateCheckbox("2", 280, 0, 25, 17) $Checkbox3 = GUICtrlCreateCheckbox("5", 280, 24, 25, 17) $Checkbox4 = GUICtrlCreateCheckbox("8", 280, 48, 25, 17) $Checkbox5 = GUICtrlCreateCheckbox("3", 0, 24, 25, 17) $Checkbox6 = GUICtrlCreateCheckbox("4", 144, 24, 25, 17) $Checkbox7 = GUICtrlCreateCheckbox("6", 0, 48, 25, 17) $Checkbox8 = GUICtrlCreateCheckbox("7", 144, 48, 25, 17) $Checkbox9 = GUICtrlCreateCheckbox("0", 0, 0, 25, 17) $Checkbox10 = GUICtrlCreateCheckbox("9", 280, 72, 25, 17) $Input2 = GUICtrlCreateInput("", 216, 72, 33, 17) $Time = GUICtrlCreateLabel("Time", 176, 72, 27, 17) $Label1 = GUICtrlCreateLabel("Sec", 256, 72, 23, 17) $Input1 = GUICtrlCreateInput("", 72, 48, 33, 17) $Label2 = GUICtrlCreateLabel("Time", 32, 48, 27, 17) $Label3 = GUICtrlCreateLabel("Sec", 112, 48, 23, 17) $Input3 = GUICtrlCreateInput("", 352, 24, 33, 17) $Label4 = GUICtrlCreateLabel("Time", 312, 24, 27, 17) $Label5 = GUICtrlCreateLabel("Sec", 392, 24, 23, 17) $Input4 = GUICtrlCreateInput("", 216, 48, 33, 17) $Label6 = GUICtrlCreateLabel("Time", 176, 48, 27, 17) $Label7 = GUICtrlCreateLabel("Sec", 256, 48, 23, 17) $Input5 = GUICtrlCreateInput("", 216, 24, 33, 17) $Label8 = GUICtrlCreateLabel("Time", 176, 24, 27, 17) $Label9 = GUICtrlCreateLabel("Sec", 256, 24, 23, 17) $Input6 = GUICtrlCreateInput("", 352, 48, 33, 17) $Label10 = GUICtrlCreateLabel("Time", 312, 48, 27, 17) $Label11 = GUICtrlCreateLabel("Sec", 392, 48, 23, 17) $Input7 = GUICtrlCreateInput("", 352, 0, 33, 17) $Label12 = GUICtrlCreateLabel("Time", 312, 0, 27, 17) $Label13 = GUICtrlCreateLabel("Sec", 392, 0, 23, 17) $Input8 = GUICtrlCreateInput("", 72, 24, 33, 17) $Label14 = GUICtrlCreateLabel("Time", 32, 24, 27, 17) $Label15 = GUICtrlCreateLabel("Sec", 112, 24, 23, 17) $Input9 = GUICtrlCreateInput("", 216, 0, 33, 17) $Label16 = GUICtrlCreateLabel("Time", 176, 0, 27, 17) $Label17 = GUICtrlCreateLabel("Sec", 256, 0, 23, 17) $Input10 = GUICtrlCreateInput("", 72, 0, 33, 17) $Label18 = GUICtrlCreateLabel("Time", 32, 0, 27, 17) $Label19 = GUICtrlCreateLabel("Sec", 112, 0, 23, 17) $Input11 = GUICtrlCreateInput("", 72, 72, 33, 17) $Label20 = GUICtrlCreateLabel("Time", 40, 72, 27, 17) $Label21 = GUICtrlCreateLabel("Sec", 112, 72, 23, 17) $Label22 = GUICtrlCreateLabel("Time", 312, 72, 27, 17) $Input11 = GUICtrlCreateInput("", 352, 72, 33, 17) $Labe23 = GUICtrlCreateLabel("Sec", 392, 72, 23, 17) $Tab = GUICtrlCreateCheckbox("Tab", 0, 72, 41, 17) $Ctrl = GUICtrlCreateCheckbox("Ctrl", 144, 72, 33, 17) $Button1 = GUICtrlCreateButton("Start", 0, 96, 27, 17) $Button2 = GUICtrlCreateButton("Exit", 64, 96, 27, 17) $Button3 = GUICtrlCreateButton("Stop", 32, 96, 27, 17) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Thanks Link to comment Share on other sites More sharing options...
martin Posted May 1, 2012 Share Posted May 1, 2012 i went my Script went work Example when i chick on Checkbox1 and chick start write 1 and when i write 3 Sec in Input and chick start write 1 all 3 sec and when chick Stop All Stop which bit is causing you a problem? To respond to the start button you need to look in the help for GuiCtrlCreateButton, then to read the state of a checkbox and to read the contents on an input you need to look up GuiCtrlRead.To get someone to write it all for you you need to look up praying for divine intervention. 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 More sharing options...
SeaSky Posted May 1, 2012 Author Share Posted May 1, 2012 which bit is causing you a problem? To respond to the start button you need to look in the help for GuiCtrlCreateButton, then to read the state of a checkbox and to read the contents on an input you need to look up GuiCtrlRead. To get someone to write it all for you you need to look up praying for divine intervention. yes i know it now and i make Checkbox work when i add While 1 $msg = GUIGetMsg() Select Case $msg = $Button1 $send1 = GUICtrlRead($1) While 1 Send($send1) WEnd Case $msg = $GUI_EVENT_CLOSE GUIDelete() ExitLoop EndSelect WEnd but i don't know how make Time Work and Stop work so i need help Only in Time and Stop Button i will Try to so i know i will not get many help Link to comment Share on other sites More sharing options...
martin Posted May 1, 2012 Share Posted May 1, 2012 OK, I think I understand. When you click the button you have while 1 send($send) but you want that to stop the Send when the time in input11 has elepsed. Then there are several ways you could do that but here is one. $period = Number(GuiCtrlRead($Input11)) ;asume time is in seconds $started = Timerinit while TimerDiff($started) < $period * 1000 send($send) wend 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 More sharing options...
SeaSky Posted May 1, 2012 Author Share Posted May 1, 2012 OK, I think I understand. When you click the button you have while 1 send($send) but you want that to stop the Send when the time in input11 has elepsed. Then there are several ways you could do that but here is one. $period = Number(GuiCtrlRead($Input11)) ;asume time is in seconds $started = Timerinit while TimerDiff($started) < $period * 1000 send($send) wend thanks but see $started = Timerinit $started = Timerinit^ ERROR Link to comment Share on other sites More sharing options...
GEOSoft Posted May 1, 2012 Share Posted May 1, 2012 that was just a typo. it should have been TimerInit() as you would have easily discovered by looking in the help file. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" 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