Announcement

Collapse
No announcement yet.

Connect to IRC server ... SHOULD be easy, isnt!?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Connect to IRC server ... SHOULD be easy, isnt!?

    *sigh* sorry guys
    I found the bug a second after I posted here ... posting here actually REVEALED the bug ... somehow my code had some other character where there should've been a space character. In the PB IDE it looked like a space, but when I posted it here it turned out as an asterisk ... weird!
    Anyway problem fixed

    Admins please delete this thread, sorry for the hassle

    ps. If anybodys interested, yes it IS easy to connect to an IRC server when you use the correct space character

    Code:
    #COMPILE EXE
     
    $IRCServer = "irc.server.com"
     
    FUNCTION PBMAIN() AS LONG
    LOCAL hTCP AS DWORD, sPacket AS STRING
    TCP OPEN PORT 6667 AT $IRCServer AS #hTCP
     TCP PRINT #hTCP, "NICK mynickname"
     TCP PRINT #hTCP, "USER myident " & CHR$(34,34) & " " & CHR$(34) & $IRCServer & CHR$(34) & " :my fullname"
     DO
       TCP LINE INPUT #hTCP, sPacket
       PRINT sPacket
       IF LEFT$(sPacket, 5) = "PING " THEN TCP PRINT #hTCP, "PONG " & RIGHT$(sPacket, LEN(sPacket) - 5)
     LOOP
    TCP CLOSE #hTCP
    END FUNCTION
    Last edited by Wayne Diamond; 1 May 2009, 05:35 AM.
    -
Working...
X