Alexxander Posted July 31, 2013 Share Posted July 31, 2013 (edited) hi all anyone knows why i can't but 2 thing in one loop ? i tried to make 2 while loops but the first one is the only running one. here is the code: #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 615, 237) GUISetState(@SW_SHOW) #endregion ### END Koda GUI section ### TCPStartup() $TCPListen = TCPListen(@IPAddress1, 403) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch Do $TCPAccept = TCPAccept($TCPListen) Until $TCPAccept <> -1 Do $TCPRecive = TCPRecv($TCPAccept, 1000000) Until $TCPRecive <> "" MsgBox(0, "hi", $TCPRecive) WEnd any ideas ? Edited August 1, 2013 by alexander95 Link to comment Share on other sites More sharing options...
Gianni Posted August 1, 2013 Share Posted August 1, 2013 (edited) Hi alexander95 your script works for me. where is the problem? to use your script yo need to send a messag to it from another script 1) compile your script and execute the resulting executable 2) then, while your script (exe) is running, run this second script from sciTE to send messages to your first sciript and you will see popup "hi" response. #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 623, 153, 280, 165) $Edit1 = GUICtrlCreateEdit("", 8, 8, 593, 113) GUICtrlSetData(-1, "Edit1") $Button1 = GUICtrlCreateButton("Button1", 8, 128, 593, 17) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### TCPStartup() Local $g_IP = @IPAddress1 ; same as server this example While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $Socket = TCPConnect($g_IP, 403) ; call the server If @error Then ConsoleWrite('!--> TCPConnect error number ( ' & @error & ' ).' & @CRLF) Exit EndIf TCPSend($Socket, GUICtrlRead($Edit1)) ; send the content of upper Edit1 EndSwitch WEnd bye Edited August 1, 2013 by Pincopanco Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... Link to comment Share on other sites More sharing options...
Belini Posted August 1, 2013 Share Posted August 1, 2013 hi all anyone knows why i can't but 2 thing in one loop ? i tried to make 2 while loops but the first one is the only running one. Use AdlibRegister to the function of the second loop. My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ Link to comment Share on other sites More sharing options...
Alexxander Posted August 1, 2013 Author Share Posted August 1, 2013 the script have to codes the first is the GUI close the second is the tcp functions when i run them to gather in 1 loop only the tcp will work and the close func will never work and if u runned them in 2 loops the second 1 will never work !!!!!!!!!! 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