Coded in C for efficiency, The ircBot was designed to help with the management of channels, sometimes referred to as chat rooms, on IRC.
Version 1.3 brings these changes:
I needed a bot to help manage a channel with a friend a few years ago, so I made this bot. I debated whether to release the source code, and here it finally is. Enjoy. As it's open source software, I probably should say share and enjoy.
Designed for Linux, it probably could be compiled for Windows with some changes. I'll get to that soon.
The setup script allows installing to /usr/local/bin/ircBot, or compile and run from the directory where the source code is located.
If you're modifying the bot, you might want to test it on an IRC server on your own computer. To install a small IRC server for testing, try the following command:
sudo apt install ngircd
The folder from which the program is run must contain a cfg.txt file, else one will be generated. The default config has the bot try to connect to an IRC server on your own machine. Here's another example of a good cfg.txt file:
irc.prison.net EdAnger %supernets hardchats @ * 123.45.67.89 #ircBot =Ron's IRC bot - http://rockymount.us?s=ircbot ~We welcome %s!
The first line of the cfg.txt file contains the address to connect to. The second line contains the nick, or name, for the bot to use.
Then, there are the following kinds of entries.
A line starting with % specifies banned words. Users who say these will be kicked. In our example, we ban the words supernets and hardchats because those are used by spammer bots.
A line starting with > tells whom to forward private messages to. In case someone communicates to the bot privately, the bot will notify the specified nick.
A line starting with @ tells the nick and address of a channel operator. Either can be * to match anything. These users will be given operator mode by the bot upon joining. If this op line appears before your lines about channels, the op is global. If the op line appears after a channel definition, the user will be opped only in that channel.
A line starting with - tells the nick and address of a banned user. Either can be * to match anything. These users will be kicked upon joining.
A line that starts with # indicates a channel to join.
Channels may have any or all of these options:
A line starting with ! specifies a file containing news alerts. When the bot sees that the contents of the file have changed, it announces those contents in the channel unless too short or long. It's ok if the file doesn't exist.
A line starting with = tells the topic for the channel. The bot will only set the topic in some conditions. If not provided, the bot will never set the topic.
A line starting with ~ specifies a greeting to tell to users who join. Include %s for the user's nick. Operators receive no greeting. If not provided, the bot will never tell a greeting.
A line starting with : tells the name of a memory share to use for a bridge. Chat messages from the channel are thus available to other ircBots running on your computer.
A line starting with ^ specifies the flags for the channel.
These are the flags that are currently available:
r Rejoin when not present in channel after a ping or two.
t Set topic to news headline instead of announcing in channel (feature may have been broken!)
1.0 Initial release
1.1 More resilient connection, changes nick if needed, checks all allocated memory.
1.2 Added bridge capability, added option to set topic to headlines, fixed greetings, login on reconnect, fixed potential buffer overflows.
1.2.1 Removed code for output for recent debugging & cleaned up code.
More features will probably be coming.
Released for free for use in accordance with the MIT license for open source software. The MIT license is more permissive than GNU GPL, and maybe sometime I'll explain why I don't use a GNU license anymore.
Tags: software c programming irc
These stats are for all pages using this layout.
Page generated in 0.026215 seconds.