Jump to content

Bot making channel in IRC


Recommended Posts

Okay I would first off say hi I am new to forums but have been in IRC for a while.You may know my bot his name is Haxxorbot and has been requested in a few of the channels.Well Staulkor and I decided to make a #bot channel

for people who are interested and or have coded IRC bots and give you a safe

testgroud for new ideas and concepts. We are typically using Java but Perl and other languages are welcome. I am online for at least 3 hours a day and maybe 5 on weekends. So come in for help or to test your bots. And HAK.5 rules. :P

Link to comment
Share on other sites


This is a bit of old C code, so it doesn't look particularly nice, but this was basically the bot I used to police my FTP site.

What it does is it enters the channel, and keeps track of the IPs of those in it. For each individual in the channel it will keep an entry in your hosts.allow file (which it obviously will need access to) explicitly allowing that individual access to the in.ftpd process.

In other words, it allows or denies people access using the TCP Wrappers.

If you leave the channel, you're removed from the file. If a netsplit occurs and you end up on the other side of the rift, you get 5 minutes gracetime after which the split must be over, you must be reconnected to the bot's side of the split, or you get removed from the file.

There are 4 built-in triggers:


This spits out a list of which users are currently seen in the channel under what hostname, and by extension, which hosts are currently allowed access by CooperBot.


Spits out the contents of a file called sites.txt which can contain whatever you want but the name should give you some ideas...


Spits out the last 30 (see the #define in triggers.c) lines of a file called recent.txt which, once again can contain anything but kinda gives away what this was originally built for. :)


Sends out a notice that this is an unsupported trigger.

To prevent it from getting flooded off, the rate at which it sends out messages is tightly controlled. The PONG response to a server's PING gets priority in the message sending list.

It's not my best code by a long shot, but it works, and it's in C which should make it a nice addition to whatever you've already got.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...