Essbaumer Posted December 23, 2006 Posted December 23, 2006 Hi, I try to code a simply IRC Client. This is my first try. CODE #include <file.au3> Global $addr = "irc.freenode.net" Global $port = "6667" Global $channel = "#test-channel" Global $nick = "noname145236" Global $nick_pw = "" Global $sock = -1 AutoItSetOption("RunErrorsFatal", 0) Opt("TCPTimeout",100) ;in ms TCPStartup() $ip = TCPNameToIP($addr) $sock = TCPConnect($ip, $port) If @error Then Msgbox(0, "Fehler", "Could not connect to " & $addr & ":" & $port & ".") Exit EndIf $loop = 0 While 1 $irc = TCPRecv($sock, 384) If @error Then Exit EndIf If $irc <> "" Then _FileWriteLog(@ScriptDir & "\log_backup.txt", $irc) EndIf WEnd IRC_Send("Blub") Func IRC_Send($Msg) Global $sock TCPSend($sock, $Msg) EndFunc A Log File will be created. Take a look: CODE 2006-12-23 22:17:04 : NOTICE AUTH : *** Looking up your hostname... 2006-12-23 22:17:05 : NOTICE AUTH : *** Found your hostname, welcome back NOTICE AUTH : *** Checking ident 2006-12-23 22:17:12 : NOTICE AUTH : *** No identd (auth) response 2006-12-23 22:17:20 : ERROR :Closing Link: 127.0.0.1 (Connection Timed Out) It looks like fine. But the IRC Server kicked me. Why? Where is my Bug? Greetings, Ralf CURalf
Thatsgreat2345 Posted December 23, 2006 Posted December 23, 2006 there are a few IRC Clients in the example scripts as well as a UDF to connect to a chat so you might want to check it out
Essbaumer Posted December 23, 2006 Author Posted December 23, 2006 I had takjed one of this samples. But I can't see the bug. CURalf
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