AutoITphil Posted January 12, 2011 Share Posted January 12, 2011 Hello fellow coders of AutoIT. I am extremely new to this concept of "networking". And I couldn't really seem to find anything helpful on the forums about what I am trying to do (it was mostly just people getting flamed for asking a question similar to mine). I am trying to make an Instant Messenger. I'll probably want to sit down one day and create a fancy GUI for it, but right now I just want to get the networking part down. Msgbox's would be a perfectly could substitute for now. But now how do I do this networking part? I have created two scripts, a server and a client, that must both be run for it to work. I was hoping to consolidate these into one. But the biggest problem I have with AutoIT is the lack on multitasking. Here are those two scripts: Client: #include <misc.au3> func IM() $input = InputBox("The IM", "Your message please") TCPStartup() $TCPconnect = TCPConnect(@IPAddress1, 403) if $TCPconnect = -1 then Exit TCPSend($TCPconnect, $input) EndFunc $exit = 1 while $exit < 3 IM() if _IsPressed("45") then $exit = 4 WEnd And the Server: #include <misc.au3> func Server() TCPStartup() $TCPListen = TCPListen(@IPAddress1, 403) Do $TCPAccept = TCPAccept($TCPListen) Until $TCPAccept <> -1 do $TCPRecv = TCPRecv($TCPAccept, 1000) until $TCPRecv <> "" sleep(300) MsgBox(0,"The Message", $TCPRecv) TCPShutdown() EndFunc $ExitSer = 1 while $ExitSer < 3 Server() if _IsPressed("45") then $ExitSer = 4 WEnd Please help me out with this, it will be greatly appreciated 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