retaly Posted September 14, 2011 Share Posted September 14, 2011 Hi, i have one small problem i did a gui, where i can switch the values, and it is work so good. but my problem is: i did a checkbox, checkbox func is repeat/no repeat scripts.. how can i do how when i click to chekcbox and to start button( and now running the script with repeat), after that if i click to checkbox again(pipe is off), the script is stopping with repeat.(sry for bad english) plz help me!!! 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", 197, 201, 513, 292) $gomb1 = GUICtrlCreateInput("1", 72, 32, 97, 21, $GUI_SS_DEFAULT_INPUT) $btnStart = GUICtrlCreateButton("Start", 56, 160, 75, 25) GUICtrlCreateLabel("Skill Gomb:", 16, 32, 57, 17) GUICtrlCreateLabel("sleep:", 32, 56, 40, 17) $szunet1 = GUICtrlCreateInput("1000", 72, 56, 97, 21, $GUI_SS_DEFAULT_INPUT) GUICtrlCreateLabel("Skill Gomb:", 16, 80, 57, 17) GUICtrlCreateLabel("sleep:", 32, 104, 40, 17) $szunet2 = GUICtrlCreateInput("1000", 72, 104, 97, 21, $GUI_SS_DEFAULT_INPUT) $gomb2 = GUICtrlCreateInput("2", 72, 80, 97, 21, $GUI_SS_DEFAULT_INPUT) $ismetles = GUICtrlCreateCheckbox("Repeat", 72, 136, 97, 17) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $gomb1 Case $btnStart $string = GUICtrlRead($gomb1) $string1 = GUICtrlRead($szunet1) $string2 = GUICtrlRead($gomb2) $string3 = GUICtrlRead($szunet2) $ism = GUICtrlRead($ismetles) If ProcessExists($ism) Then Send($string & @LF) Sleep($string1 & @LF) Send($string2 & @LF) Sleep($string3 & @LF) $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch Else While 1 Send($string & @LF) Sleep($string1 & @LF) Send($string2 & @LF) Sleep($string3 & @LF) $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd EndIf Case $szunet1 Case $szunet2 Case $gomb2 EndSwitch WEnd Link to comment Share on other sites More sharing options...
Akarillon Posted September 14, 2011 Share Posted September 14, 2011 Create a Stop button and put a script like below in the loop? Case $StopButton Exit Challenge accepted! Link to comment Share on other sites More sharing options...
retaly Posted September 14, 2011 Author Share Posted September 14, 2011 ah not, i wanna just pausing the script runing when pick up the pipe from box, and the script is started again when i click again to box Link to comment Share on other sites More sharing options...
Beege Posted September 14, 2011 Share Posted September 14, 2011 (edited) Go through the steps 1 by 1 with me of what your trying to do again cause im not understanding. You have muiltiple GUIGetMsg() loops inside other GUIGetMsg() loops which is doesnt make sense. If you press the startbut and the process does not exist you go into a endless loop that only waits for you to close it. edit: This part. What are you trying to do here? Case $btnStart $string = GUICtrlRead($gomb1) $string1 = GUICtrlRead($szunet1) $string2 = GUICtrlRead($gomb2) $string3 = GUICtrlRead($szunet2) $ism = GUICtrlRead($ismetles) If ProcessExists($ism) Then Send($string & @LF) Sleep($string1 & @LF) Send($string2 & @LF) Sleep($string3 & @LF) $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch Else While 1 Send($string & @LF) Sleep($string1 & @LF) Send($string2 & @LF) Sleep($string3 & @LF) $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd EndIf Edited September 14, 2011 by Beege Assembly Code: fasmg . fasm . BmpSearch . Au3 Syntax Highlighter . Bounce Multithreading Example . IDispatchASMUDFs: Explorer Frame . ITaskBarList . Scrolling Line Graph . Tray Icon Bar Graph . Explorer Listview . Wiimote . WinSnap . Flicker Free Labels . iTunesPrograms: Ftp Explorer . Snipster . Network Meter . Resistance Calculator Link to comment Share on other sites More sharing options...
retaly Posted September 14, 2011 Author Share Posted September 14, 2011 ah nothing... i fixed my problem ˘˘˘so it is work Link to comment Share on other sites More sharing options...
Beege Posted September 14, 2011 Share Posted September 14, 2011 ok but your using GUIGetMsg() wrong. If you need to sleep() in your main loop between sending strings, I would look into using OnEvent mode. Using sleep() in a GUIGetMsg() loop will cause your gui controls to not respond.. Assembly Code: fasmg . fasm . BmpSearch . Au3 Syntax Highlighter . Bounce Multithreading Example . IDispatchASMUDFs: Explorer Frame . ITaskBarList . Scrolling Line Graph . Tray Icon Bar Graph . Explorer Listview . Wiimote . WinSnap . Flicker Free Labels . iTunesPrograms: Ftp Explorer . Snipster . Network Meter . Resistance Calculator 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