Results 1 to 14 of 14

Thread: Irc Bot

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2002
    Posts
    75

    Irc Bot

    I'm trying to make a bot that will respont to command like !opme !voice and all those kind of command, but i got no idea how to be able to connect to a server..
    I did that program from the winsock tutorial 2 and added an input box, but after connecting to the server, i get timeout after like 1 min or so, which i'm guessing is cause that where the irclient is suppose to send data.. but that the problem, i dont know which kind of data i'm suppose to send, can anyone help?

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Mar 2002
    Posts
    75
    *bump*

  3. #3
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Take a look at my signature, there's an open source bot in there
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Mar 2002
    Posts
    75
    i already did, i edited the bot.conf file to join the server and channel i'm on, but never did..

  5. #5
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Can you post the conf file ?
    Also, look in modMisc.bas

    Set doDebug to True, and it will Debug.Print all incoming winsock data. that should indicate whats wrong
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Mar 2002
    Posts
    75
    hmm, it joins efnet servers without a problem, but when trying to join something like wondernet, it stops on the ident msg.. probally cause they use diff commands?

  7. #7
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Interesting.
    I've seen that problem before.

    What I suggest you do is write a bouncer, then connect through it with mIRC to the server and see how it does it
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Mar 2002
    Posts
    75
    bouncer? is that something like a packet sniffer? cause i tried spynet and it crashed my pc to a blue screen of death.... on winxp!! very strange..

  9. #9
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    code the boucner yourself.
    if you search for posts by me that have the word bouncer in them you should see source code for one and an explanation
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  10. #10

    Thread Starter
    Lively Member
    Join Date
    Mar 2002
    Posts
    75
    got the bouncer, i added the 2 winsock control and 2 listbox.. is there anything else i should change/add? btw, nothing happended when i ran it..

  11. #11
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    nothing is supposed to happen when you run it.
    you set the listen and connect out port accordingly, so 6667 or whatever in this case.
    in the bouncer set the remote host for the outbound connection to the hostname of the irc server

    then use mirc to connect to your own machine, and the bouncer will bounce the connect to the irc server.

    you can then see all data that passes between
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  12. #12

    Thread Starter
    Lively Member
    Join Date
    Mar 2002
    Posts
    75
    what i meant was that nothing comes up on neather listbox1 and 2..

  13. #13

    Thread Starter
    Lively Member
    Join Date
    Mar 2002
    Posts
    75
    i dont get the code..
    Code:
    Private Sub Form_Load()
        With Winsock1
            .LocalPort = 6667
            .Listen
    'if i try putting anything under .listen, i get an error..
        End With
    End Sub
    
    Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long)
        Winsock1.Close
        Winsock1.Accept requestID
        Winsock2.Connect "my ip?", 6667
    'does my ip go up there or the irc server?
    End Sub
    
    Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
        Dim strBuff As String
        Winsock1.GetData strBuff, vbString
        List1.AddItem "From Client : " & strBuff
        Do Until Winsock2.State = sckConnected
            DoEvents
        Loop
        Winsock2.SendData strBuff
    End Sub
    
    Private Sub Winsock2_DataArrival(ByVal bytesTotal As Long)
        Dim strBuff As String
        Winsock2.GetData strBuff, vbString
        List2.AddItem "From Server : " & strBuff
        Winsock1.SendData strBuff
    End Sub

  14. #14

    Thread Starter
    Lively Member
    Join Date
    Mar 2002
    Posts
    75
    nevermind, i got the bouncer working..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width