Crome_BAD Posted December 28, 2004 Share Posted December 28, 2004 Hey guys, i was wondering if anyony could help with this program. Im not very familiar with the AU3Xtra.dll so, any help would be nice. expandcollapse popup#include <GUICONSTANTS.AU3> HotKeySet( "{ENTER}", "TCPSend") HotKeySet( "{ESC}", "TCPShutdown") Global $connectip = "127.0.0.1" Global $port = "65534" Main() Func Main() GUICreate( "Crome's Chat Program", 300, 400, -1, -1, "", $WS_EX_CLIENTEDGE) $start = GUICtrlCreateButton( "Start", 5, 5, -1, -1, $BS_FLAT) Global $sendtext = GUICtrlCreateInput( "", 5, 70, 150, 20) GUISetState() While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then Exit EndIf If $msg = $start Then TCPStart() EndIf WEnd EndFunc Func TCPStart() Global $tcpstart = DLLCall( "AU3Xtra.dll", "int", "TCPStartUp" ) If $tcpstart = @error Then MsgBox( 0, "Error", "Unable To Start TCP Abilities") Exit EndIf TCPConnect() EndFunc Func TCPConnect() Global $tcpconnect = DLLCall( "AU3Xtra.dll", "int", "TCPConnect", "str", $connectip, "int", $port) If $tcpconnect = @error Then Msgbox( 0, "Error", "Unable To Connect To " & $connectip) TCPShutdown() EndIf GUICtrlCreateLabel( "Connected...", 5, 40) TCPListen() EndFunc Func TCPListen() Global $tcplisten = DLLCall( "AU3Xtra.dll", "int", "TCPListen", "str", "127.0.0.1", "int", $port ) If $tcplisten = @error Then MsgBox( 0, "Error", "Cannot Listen On 127.0.0.1") TCPShutdown() EndIf TCPRecv() EndFunc Func TCPRecv() Do Global $tcprecv = DLLCall( "AU3Xtra.dll", "int", "TCPRecv", "int", $tcplisten, "str", "", "int", 1024 ) Until $tcprecv = @error TCPShutdown() EndFunc Func TCPSend() $read = GUICtrlRead( $sendtext) DLLCall( "AU3Xtra.dll", "int", "TCPSend", "int", $tcpconnect, "str", $read) Sleep(1500) TCPRecv() EndFunc Func TCPShutdown() DLLCall( "AU3Xtra.dll", "int", "TCPShutDown" ,"int", $tcpstart) Stop() EndFunc Func Stop() Exit EndFunc Also, anyone kno where to update scite? lol ive got the new au3 def but scite doesent pick them up, and i cant run scripts through it, so i havta compile everytime i want to run 1, real big pain... Peace, Crome_BAD Link to comment Share on other sites More sharing options...
Developers Jos Posted December 28, 2004 Developers Share Posted December 28, 2004 Also, anyone kno where to update scite? lol ive got the new au3 def but scite doesent pick them up, and i cant run scripts through it, so i havta compile everytime i want to run 1, real big pain...Peace,Crome_BAD<{POST_SNAPBACK}>There is a special SciTE installer available on its own SciTE4AutoIt3 's home page that contains everything needed to code AutoIt3 scripts with SciTE:http://www.autoitscript.com/autoit3/scite SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Crome_BAD Posted December 28, 2004 Author Share Posted December 28, 2004 (edited) Just about to edit this post....lol i found it, ty tho. Also, i ran the program on 2 cp's, both say unable to connect to either its IP address, or 127.0.0.1..... Edited December 28, 2004 by Crome_BAD Link to comment Share on other sites More sharing options...
layer Posted December 28, 2004 Share Posted December 28, 2004 maybe you have the router ip address... here! go to here and use these as the ip'shttp://www.whatismyip.com/just a suggestion FootbaG Link to comment Share on other sites More sharing options...
Crome_BAD Posted December 28, 2004 Author Share Posted December 28, 2004 yes, lol but i fixed it alittle to connect to localhost (will be changed with time) but now i have a the problem of it not recieving text...lol any ideas..? Link to comment Share on other sites More sharing options...
layer Posted December 28, 2004 Share Posted December 28, 2004 recieving test from? where? FootbaG Link to comment Share on other sites More sharing options...
Crome_BAD Posted December 28, 2004 Author Share Posted December 28, 2004 Lol hold up and ill put it on another cp also, and test it form there Link to comment Share on other sites More sharing options...
Einzeinbleth Posted December 28, 2004 Share Posted December 28, 2004 IMO AutoIt is not good for creating chat program .. i created one in Delphi, and also, you dont need to have any installed program :] just connect via telnet to pc where program is running, and then everybody who is there connected will receive your messages if someone want test: telnet 83.27.120.64 6120 [in win 98 disable "local echo" in terminal-> preferences...] and a program with source:http://www.wroclaw.mm.pl/~einzeinbleth/chat.zipsorry for offtopicEinzeinbleth Link to comment Share on other sites More sharing options...
layer Posted December 28, 2004 Share Posted December 28, 2004 well, i think it could be done, who cares if it's not perfect... someone has got to start the wheel of AutoIt Instant Messaging! a few dllcalls here and there!and poof,,, right>? FootbaG Link to comment Share on other sites More sharing options...
Crome_BAD Posted December 28, 2004 Author Share Posted December 28, 2004 Hmmm ill check that out Link to comment Share on other sites More sharing options...
Crome_BAD Posted December 28, 2004 Author Share Posted December 28, 2004 (edited) Thats right layer, it would be nice, im trying hard, lol but i cant get the tcp functions to work for my liking. lol. Im trying to figure out wat order it goes in...1. TCP Start (Duh)2. TCP Connect Maybe?3. TCP Listen4. TCP Send\Recieve5. TCP ShutdownI think larry posted a example server/client code, but i cant seem to find it.(Really tired, newborn keeps me up all night:P)Peace,Crome_BADEDIT: Found the RIGHT example code, studing it now...lol Edited December 28, 2004 by Crome_BAD Link to comment Share on other sites More sharing options...
Crome_BAD Posted December 28, 2004 Author Share Posted December 28, 2004 (edited) Heres Some new code, try this, its for a server. I think it will only run on WinXP, im running WinME and the program locks up, arg. If you guys have any luck, let me kno. expandcollapse popup#include <GUICONSTANTS.AU3> HotKeySet( "{ESC}", "TCPShutDown") Main() Func Main() GUICreate( "Cromes Messenger", 300, 300, -1, -1, "", $WS_EX_CLIENTEDGE) $start = GUICtrlCreateButton( "Start", 5, 5, -1, -1, $BS_FLAT) Global $sendtext = GUICtrlCreateInput( "", 5, 250, 290, 20) GUISetState() While 1 $msg = GUIGetMsg() If $msg = $start Then TCPStartServer() EndIf WEnd EndFunc Func TCPStartServer() $tcpstart = DLLCall( "AU3Xtra.dll", "int", "TCPStartUp" ) If @error Or $tcpstart[0] = 0 Then MsgBox( 4096, "Error", "Unable To Start TCP Abilities") Stop() Else TCPListen() EndIf EndFunc Func TCPListen() $tcplisten = DLLCall( "AU3Xtra.dll", "int", "TCPListen","str", "127.0.0.1","int", 65432 ) If @error Then MsgBox( 4096, "Error", "Unable To Connect To 127.0.0.1") TCPShutDown() Else Global $socket = $tcplisten[0] TCPRec() EndIf EndFunc Func TCPRec() Do $tcprecv = DLLCall( "AU3Xtra.dll", "int", "TCPRecv","int", $socket,"str", "","int", 1024 ) Until @error TCPShutDown() EndFunc Func TCPShutDown() DLLCall( "AU3Xtra.dll", "int", "TCPShutDown","int", $socket) Stop() EndFunc Func Stop() Exit EndFunc Peace, Crome_BAD The Client Code im workin on works fine, not sure y.... Edited December 28, 2004 by Crome_BAD Link to comment Share on other sites More sharing options...
zcoacoaz Posted February 22, 2005 Share Posted February 22, 2005 i have been making a chat program called ez chat for about 2 months now, it has plugins, themes, you can have as many conversations as your comp can handle send files, and im working on more, when i finish the next build i will send you the client if you want [font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font] 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