dcsimg
Results 1 to 18 of 18

Thread: IRC Bot Source Code

  1. #1

    Thread Starter
    Banned plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359

    IRC Bot Source Code

    [ edit 15/08/2006 ]
    Please see here:
    http://www.vbforums.com/showthread.php?p=2583859
    [ /edit ]

    [ edit 23/01/2007 ]
    Please see here:
    http://plenderj.com/files/IRCBot.1.0.6.zip
    [/edit]

    Here is the source code to a IRC Bot I've been coding over the past few days.
    It can get onto IRC, send and receive files via DCC, reply to CTCP queries, join channels, give people +o or +v if supplied with the right password ...

    It should also be very easy to modify the source code to add your own features etc.

    As always, if you've any queries or comments just contact me.
    Attached Files Attached Files
    Last edited by plenderj; Jan 22nd, 2007 at 08:29 PM.

  2. #2

    Thread Starter
    Banned plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    * 21-October-2004 - Moved to CodeBank *

  3. #3
    New Member
    Join Date
    Jul 2005
    Posts
    1

    Re: IRC Bot Source Code

    hey i tryed running your bot and well it doesnt work for me, i ran it with the default config and i got this error "Run-Time Error '40020': Invalid operation at current state, then i changed the config file with this
    =================================
    set nickname = testbot
    set altnick = bot2
    set connectToIRC = true
    set dccPass = password
    set quitMessage = Mwaaahhhhhhhhhhh
    set attemptedCPS = 4096

    Servers {
    2600net:6667
    }

    InitiallySend {
    JOIN #testing1
    OPER admin password
    }
    ===============================
    and still get the same error

  4. #4

    Thread Starter
    Banned plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359

    Re: IRC Bot Source Code

    Well bear in mind the code is based on the IRC protocol of over 3 years ago - I don't know if much has changed in the meantime...

  5. #5

    Thread Starter
    Banned plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359

    Re: IRC Bot Source Code

    Its a No Route To Host error. By the looks of it there is no IRC Server running on the host 2600.net

  6. #6
    New Member
    Join Date
    Jul 2006
    Posts
    2

    Re: IRC Bot Source Code

    Just thought id see how your bot worked in 2006 july - well it works fine still logs in joins channel no problems at all. IRC hasnt really changed much at all in years, and is unlikely to change much in the future, some new parts are added but overall its still the same base.

  7. #7

    Thread Starter
    Banned plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359

    Re: IRC Bot Source Code

    Thanks The source code is actually hacked down to a generic enough form from an IRC bot project I created to do some pretty specific stuff online. There's some parts of the code that don't really make sense or aren't applicable...

    ... come to think of it I should probably write a vb.net version of it...

  8. #8

    Thread Starter
    Banned plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359

    Re: IRC Bot Source Code

    By the way I'm coding a brand new bot from scratch in VB.NET

  9. #9

    Thread Starter
    Banned plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359

  10. #10
    Member
    Join Date
    Jan 2007
    Location
    Riverton, WY
    Posts
    36

    Re: IRC Bot Source Code

    I'm checking out this bot and running it through step by step. I think I understand what it's doing, but not quite why/how.

    Also, I'm trying to get it to where it picks up one what people say in the main room, run some calculations based on the input, and spit it back out.

    I want this to occur in the main room, not in a private message.

    I'm trying to figure out the sckServer.DataArrival part; I think that is the key for what I am looking for.

    Basically, I'm wanting it to work so that the following happens:

    <Joe_Schmoe> !roll 5
    Bot catches "Joe_Schmoe", the "!roll" command, and "5". Bot creates 5 random numbers within a pre-determined range and sends back the following to the room for all to see:

    <Bot_Test> <Joe_Schmoe> rolled 5 dice: #, #, #, #, #.


    Really all I'm needing help on is figuring out how to catch the input and send the output.


    Thanks!
    Last edited by CyberInfantry; Jan 22nd, 2007 at 01:47 PM.

  11. #11

    Thread Starter
    Banned plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359

    Re: IRC Bot Source Code

    You should really look at the new versions:
    http://plenderj.com/files/

  12. #12
    Member
    Join Date
    Jan 2007
    Location
    Riverton, WY
    Posts
    36

    Re: IRC Bot Source Code

    It appears that is in .NET? Am I wrong?

    While I have an academic version of .NET, I've never learned it... I don't know how different it is from VB 6.0, but 6.0 (Well, and Java) is the only thing I've worked with. :/

  13. #13

    Thread Starter
    Banned plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359

    Re: IRC Bot Source Code

    Very similar for the most part to VB6 actually

  14. #14

    Thread Starter
    Banned plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359

    Re: IRC Bot Source Code

    Looking at your other posts, if you used my VB.NET version you could modify this part in Core/BotCore.vb

    Code:
                            Select Case objMessages(i).Command
                                Case "376"
                                    Config.LiveInformation.IRCConnected = True
    
                                Case "PRIVMSG"
                                    If objMessages(i).Request.StartsWith(":DCC CHAT") Then
                                        Dim myDCCRequest As New DCCRequest(objMessages(i).Request)
                                        If myDCCRequest.IsValid Then
                                            CreateNewDCCConnection(myDCCRequest)
                                        End If
                                    End If
                            End Select
    And put in a Case Else statement and look for the !roll command etc

  15. #15
    Member
    Join Date
    Jan 2007
    Location
    Riverton, WY
    Posts
    36

    Re: IRC Bot Source Code

    I think I've gotten the code from the VB 6.0 one pretty much figured out. It can do all the commands that I want it to do now (for now).

    Excellent program.

  16. #16
    Member
    Join Date
    Sep 2008
    Location
    Turkey
    Posts
    37

    Re: IRC Bot Source Code

    ThanKs!!!

  17. #17
    Lively Member SNIPER.PS's Avatar
    Join Date
    Dec 2009
    Posts
    96

    Arrow Re: IRC Bot Source Code

    thank you very much

  18. #18
    New Member
    Join Date
    Jul 2010
    Posts
    13

    Re: IRC Bot Source Code

    Nice share thanks will come in handy

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width