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.
Last edited by plenderj; Jan 22nd, 2007 at 08:29 PM.
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
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
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.
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...
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
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:
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. :/
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
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]