Overview
The B-Man IRC bot allows you to connect to your server and talk to players and send commands.
Intro + Pastebin
So now that the last update is out, I thought I’d start giving out some of my trade secrets, such as the IRC bot I use for server management.
What is IRC?
This is an IRC bot I created a while back which uses the remote admin port on B-Man servers to talk to players and send commands. If you’re an IRC enthusiast who runs a server, this might be very interesting to you.
Get the bot script here[pastebin.com]
The script uses mIRC script. I run my bot on mIRC 6.21 but i’m pretty sure it works on the latest version. If it doesn’t you can google for v6.21, its probably floating somewhere.
Download mIRC[www.mirc.com]
How to set-up
I think its fairly simple to set up. Just install mIRC and load the script. You will have to do some code edits though.
The bot should now have the script loaded, however you will probably get an error on the 30th line of code or so. Proceed to the next section on how to deal with this.
Add/connect your own server(s)
At the beginning of the script, you should see a chunk of text:
Use the CTRL+F if you cant see it. You will need to edit this code to input your server. If you have multiple servers, you will need to duplicate this code multiple times, and have multiple channels open.
In place of <IRC CHANNEL>, type the channel name you want your server to put text lines into. (Example: #boringman-bot) Obviously, you will need to be present in the channel to see it.
For <IP> and <PORT>, you probably already figured it out but you will need to put your game server’s IP and PORT here so the bot knows where its connecting to.
Remember to open your server’s bm_settings.ini file and to set “rconEnable” to 1 to enable the remote port and to change rconPassword to something other then the default, otherwise your server could get hijacked!
In place of <RCON PASSWORD>, put in the rcon password you set in your server’s bm_settings.ini file.
Check out the example below:
The example above will connect the bot to two different servers on two different IRC channels. Putting two servers on one channel will cause issues, so you will need to have an IRC channel for each server you have up.
It IS possible to have all servers display in one channel (thats how the bot started out) but it gets chaotic so this is more efficient. In most cases (like probably yours) you only have one server so you will only need one IRC channel and one code entry to connect to it.
Once you think your done, type the “~connect” command into the irc channel you set up in the code and see if it connects. It should say [Connected] and then Login successful! after a few seconds. The “Login successful!” message comes directly from the game server!
Using your bot
So your server is connected and you are seeing chat messages or whatever. How fun.
You or other users can type “~help” to see the list of bot commands. There is also a cheat sheet text file you can look at for B-Man server commands.
Now that your bot is up and going, here are a few details.
The bot will disconnect all the servers if it is disconnected from IRC. You will need to use ~connect when it reconnects.
The bot has built-in flood protection. Flooding IRC shouldn’t be a problem if you only have one server, but if you have 8 servers (like me) it will need to throttle how many messages it sends. When the bot feels like its flooding IRC, it will begin to “echo” messages instead of sending them to the channel.
Echoing the messages will display them in the IRC client, but not in the channel, so the bot doesn’t risk getting disconnected/banned from the IRC server for flooding but so you don’t also miss any messages that you need. (You would need to go to the bot’s IRC client to view echoed messages)
ANYONE in your channel can perform bot commands, theres no check if they are an OP or half-OP or whatever. You can edit the script to fix this, but in the mean time you should only bring trusted friends into the channel.
The script does not automatically join channels, so you should configure your bot’s IRC client to do that instead. (or add it to the script yourself if you want)
Lastly when you use the ~say command, the bot will use your IRC nickname as the game’s admin nickname. So if your name is “xXxDarkShadow420IdiotMoronxXX” on IRC, thats what will appear to your players in-game when you talk to them.
That’s about all you need to know. You’re always welcome to edit the script to do your own bidding, such as connect automatically when it joins the server, or having it send a certain nickname to the server when you use ~say. mIRC scripting is pretty easy and a great way to introduce yourself to coding.