#### CoD4 CBot v0.8.2 #### A Win32 IRC Log Bot for Call of Duty 4 #### INDEX #### 1. Important Notes 2. Features 3. Full Command List 4. Installation and First Run 5. GUI 6. Starting the Bot from Command-Line 7. Files created/Used by the Bot 8. Commands Usage 9. Customizing Messages 10. Release History 11. Credits 12. Contact #### 1. IMPORTANT NOTES!!! #### - The STOP button will never be enabled, that's normal as it's not implemented yet. - Remember to use !savesetup whenever you change any option from IRC and you want to keep them stored. - Use the !update NOW with caution as i'm usually uploading new versions just to test them so they might be unstable. Always make a backup of the older version at so you can replace it manually in case of any problems. - Remember to add 'seta g_logSync "3"' to your server config to enable the logging (you can use any number from 1 to 3). - If you have set a /sajoin for a channel in your IRC server or the IRCD is set to auto join anyone into the main channel which isn't the game relay channel, remember to ban the bot from these channels channel except for the one you want it to show logs on, because support for more than 1 channel is not added yet and that may mess with user modes. If the bot joined that channel already then ban it then restart the bot. - To register the bot's nickname on IRC, change your personal nick to the one you chose for the bot (before starting it), then register the bot's nickname and set the chosen password on the bot's GUI. Change your nick back to your personal one and start the bot, it should auto-identify. Also, you may need to give the bot owner of the channel if your ircd is set to kill any clients for excessive flooding (Right click -> user modes -> Give owner (+q). - Please note that all the information commands (like !gi and !pl) will start working only from next map. - The bot's GUI is messy right now, with empty tabs, misplaced gadgets and disabled buttons. That's normal as it's not finished yet. - My main goal in developing this bot was to support "standard" CoD4 servers. So, support for any server-side mods is not included at the moment and the bot could act weird (or not, I haven't tested it enough) by using such mods. ### 2. FEATURES - CoD4CBot can read the gamelog and output on IRC all the events. - All those events can be fully customized (colours/syntax) in appearance and enabled/disabled, all in real-time. - CoD4CBot can IDENTIFY itself on IRC. - All the available commands can be set to be allowed only for certain IRC MODES, like allowing the !msg only for Voiced users or higher. - CoD4CBot is GUI-based and can be easily configured from it. - Most important options can be set/modified from IRC too. - User modes on IRC are fully supported. - The RCON protocol is supported so you can send commands to the server. - WWhenever an update is available, you can update the bot by using a command from IRC, no need to download/install. - It's possible to send messages to the server from IRC, either for everyone or private to one player - CoD4CBot supports custom Host-messages, so now you can easily add/edit them from the GUI or from IRC - The bot keeps basic statistics of the game in progress (most kills and most deaths) and can show them as Host-messages ### 3. FULL COMMAND LIST note: commands that have 0 or 1 options means 0=off 1=on !msg !pmsg/!ppage !pl/!players !pi/!playerinfo (or empty to show all players) !gi/!gameinfo !antispam 0/1 !damagelog 0/1 !killlog 0/1 !weaponlog 0/1 !quitlog 0/1 !joinlog 0/1 !allchatlog 0/1 !teamchatlog 0/1 !unhandledevents 0/1 !savesetup !setfaction !setdamagelog !setkilllog !setweaponlog !setquitlog !setjoinlog !setallchatlog !setteamchatlog !addhostmsg !addtrans !sendrconcmd !setcmdperm !checkcmdperm !version !help !test !update NOW ### 4. INSTALLATION AND FIRST RUN - I suggest you to place the bot in its own folder inside the server's folder, as it creates and uses some files so it will be less messy that way. Anyway, you can place it wherever you wish. - Add 'seta g_logSync "3"' to your server config to enable the logging (you can use any number from 1 to 3). If logging wasn't enabled on your server then you'll need to set that variable from the console (just type g_logSync "3" and press enter). I don't know if you'll need a server restart. - Now start the bot. If the server was installed normally, with the installer on the DVD, then the bot will find its directory location automatically. If that's not the case, then you'll have to manually locate it. Go to the 'Server Setup' tab and use the 'Browse' buttons to locate both the multiplayer executable and the logfile (if you never ran your server the logfile wouldn't exist). - Next step is to setup the RCON stuff. Go to the 'Server Management' tab and select the server IP:Port. The bot is stored in the same box as the server, so for the IP you can use '127.0.0.1'. Then set the password. To set a password for the RCON in the server, you can use the variable 'rcon_password'. - Now you have to set the IRC stuff. Go to the 'IRC Setup>Connection' tab and setup everything. Note that 'Admin Channel' is not yet used. If you want the bot to automatically IDENTIFY itself, you'll have to register it yourself, then set the chosen password on this tab. Also I really suggest you to OPER it, so it'll be able to spam without being kicked and without slowdowns in output. - Last thing is to setup the commands permissions. If your IRC server supports ALL mode characters (~&@%+) then you can do it from IRC. If it only supports '@' for anything equal or higher of '+o', then you'll have to setup it from the GUI, as only '+q' (channel owners) will be able to set commands permissions at first bot start, or just use the command '/hop' (if your IRC client supports it, it's just a /part and /join) to let the bot see your mode. On the GUI, go to the 'IRC Setup>Administration' tab and setup permissions for every mode, by moving commands from the list on the left to the list on the right. - Now press the 'Save Setup' button on the 'CBot Setup' tab to save the whole bot setup and then just press the 'START' button on the 'Main' tab and the bot should start working. ### 5. GUI (Graphical User Interface) The CoD4CBot's GUI is really self-explanatory, but if I see that people still need help with it, I'll add help on this section in the next releases. Anyway, most of the options you can set from the GUI can also be set from IRC. ### 6. STARTING THE BOT FROM THE COMMAND-LINE CoD4CBot can be run from a .bat script or from a shell, so you can add it on your server .bat (if you use one to start it) to make it run the bot at the same time. It supports 1 command-line parameter at this time, '-autostart', that you'll have to set if you want the bot to automatically start the logging when run. From the GUI you can set the 'Minimize on autostart' option (set by default) to make the bot's window minimize on the taskbar automatically if it's run with the '-autostart' parameter (to have less windows opened on the desktop). ### 7. FILES CREATED/USED BY THE BOT CoD4CBot uses a number of files to save stuff for later use, most of these files are updated/created when you press the 'Save Setup' button or you use the '!savesetup' command from IRC: - CoD4CBot.ini - this file contains the configuration of all the options of the bot - CoD4CBot_host_messages.txt - this file contains all the custom Host Messages - CoD4CBot_trans.txt - this file contains all the "translations" that you have set - CoD4CBot_err.log - this file will be created/updated only in case of a crash or other errors ### 8. COMMANDS USAGE # !msg # - This command sends a message to the server, so every player can see it. example: !msg hi everyone! # !pmsg/!ppage # - This command is used to send a private message to 1 player only. You don't need to type the full name of the player, but just an unique part of it. There's no difference between the use of !pmsg or !ppage. example: !pmsg leetsniper hey! # !pl/!players # - This command shows all the players in the server and their faction. example: !pl # !pi/!playerinfo (or empty to show all players) # - With this command you can see detailed informations about one or more players. You can use a full name or a part of it, and it will output details about all matching players. Use it without parameters to show details for all the players. example: !pi leet # !gi/!gameinfo # - Use this command if you want to see details about the game in progress. It will show map name, game mode and number of players currently in the server. example: !gi # !antispam 0/1 # - This is a very simple anti-spam filter, mainly focused at blocking spam for the WEAPON event, as it will be repeatedly shown even if you don't pickup anything. It affects all and only the server events, and works by checking if the new message is the same as the last one. You can leave it on if you have enabled the WEAPON or the DAMAGE log, but remember that it can make the output to miss some event. To enable it use '1' as parameter, to disable use '0'. example: !antispam 1 # !damagelog/!killlog/!weaponlog/!quitlog/!joinlog/!allchatlog/!teamchatlog 0/1 # - All these commands works the same way, so I grouped them together. With these commands you can enable/disable events output in real-time. Just use them as the !antispam command. For more details in how to customize output messages, look in the 'Customizing Messages' section later on this readme. example: !damagelog 0 # !unhandledevents 0/1 # - By default, gamelog events that are not yet supported by the bot (as the ones added by mods) are not displayed. If you want to look at these events, you can set it to 1. Please note that these events are not supported so the bot will only show '[eventname] (unhandled event)' on IRC. example: !unhandledevents 1 # !savesetup # - Some changes are applied in real-time but nono of them is saved unless you want to. Use this command to save them whenever you want. example: !savesetup # !setfaction neutralscolour,axiscolour,alliescolour # - This command can be used to customize the colour used on IRC to represent each faction. Simply use the colour codes (a number from 0 to 15) as parameter, separated by commas. example: !setfaction 0,2,3 # !setdamagelog/!setkilllog/!setweaponlog/!setquitlog/!setjoinlog/!setallchatlog/!setteamchatlog # - These commands shares the same syntax so I grouped them together. You can change the output of each of these events with these commands. You can use this from the GUI but using it from IRC is easier as you'll be able to set colour codes much easily. For more details in how to customize output messages, look in the 'Customizing Messages' section later on this readme. example: !setkilllog $$killer killed $$victim with a $$weapon # !addhostmsg # - You can add a message to the list of Host-messages with this command. It will be used right after added, but remember that you'll need to !savesetup to save it, and there's not !delhostmsg yet ;) example: !addhostmsg Welcome to our server! # !addtrans # - You can add a "translation" to the bot with this command. It's not for localization purposes, but for translation of server names to a more human readable form. An example is map names, you can use it to show "Overgrown" on the output at the place of "mp_overgrown". Stuff that can be translated right now is: map names, game modes, weapon names, damage type and body locations. The parameter can contain spaces. If the translation is already in the database, then it will be updated with the new . example: !addtrans mp_overgrown Overgrown # !sendrconcmd # - This command can be used to send ANY command to the server, use it as you were typing on the console. Note that the bot does not support server replies yet, so if you use a command that will reply something, you can't see that reply. example: !sendrconcmd say Hi! # !setcmdperm # - The name stands for "Set Command Permissions", and can be used to set commands permissions from IRC. By default, if no config file is found, CoD4CBot adds this command, and only this, to the '+q' list, so the channel owner can set permissions for all the other commands. Using this command will instantly set permission for the specified command, but remember to !savesetup to make the change permanent. example: !setcmdperm !msg v # !checkcmdperm # - With this command you can check the permission status of a specific command. example: !checkcmdperm !msg # !version # - Shows CoD4CBot version example: !version # !help # - This command will show the requesting user all commands available to him/her, based on their user MODE. example: !help # !test # - This will show your current user MODE on IRC. I made this to check if the bot successfully see your MODES or not. example: !test # !update NOW # - After using this, the bot will check for a newer version available. If there is one and it can be downloaded, then it will automatically update it. Note that the bot will lose stats/info about game in progress until map change (like it happens at each bot restart). The 'NOW' part is case-sensitive. example: !update NOW ### 9. CUSTOMIZING MESSAGES Available Variables: $$killer = Name of who damaged/killed $$victim = Name of who got damaged/killed $$weapon = Weapon name of $$killer $$damagetype = Damage type of $$killer $$factioncol = IRC colour code (defined in GUI) that represents faction (neutral, axis or allies) $$bodypart = Name of the body part of $$victim, that's just been hit by $$killer $$damagevalue = Number representing amount of value done by $$killer to $$victim $$player = Name of player that performed the action (like Quit or Join) $$message = Message body of either AllChat or TeamChat Available Commands: !setdamagelog (can contain: $$killer $$victim $$weapon $$damagetype $$bodypart $$damagevalue $$factioncol) !setkilllog (can contain: $$killer $$victim $$weapon $$damagetype $$bodypart $$damagevalue $$factioncol) !setweaponlog (can contain: $$player $$weapon) !setquitlog (can contain: $$player) !setjoinlog (can contain: $$player) !setallchatlog (can contain: $$player $$message $$factioncol) !setteamchatlog (can contain: $$player $$message $$factioncol) How to customize a message: Create your own personal message, and use one or more of the available variables for that specific message type. Those variable names will be replaced in the output messages with the real value. For example, the default message for Kills looks like this: [09KILL] Player 04$$killer killed player 04$$victim ($$weapon/$$damagetype/$$bodypart/LastDamage $$damagevalue) You can use mIRC colour codes, just remember that if the number is lower than 10 you MUST add a 0 in front of it, like '5' will need to be written as '05', that's to prevent wrong output with player names starting with a number. ### 10. RELEASE HISTORY * v0.8.2 - 24-Mar-2008 - Added Key support for IRC - Added OPER authentication support for IRC - Fixed bug when bot won't join channels if the server got a MOTD - Fixed problem with bot spamming "player changed nickname" if more than 1 player in the server is using same GUID * v0.8.1 - 07-Mar-2008 - Forgot to add the !set***log commands to the list of available commands, so they couldn't be used from IRC :/ - Now CoD4CBot don't attempt to IDENTIFY itself if not password is supplied - Added About tab * v0.8.0 - 29-Feb-2008 - First public release ### 11. CREDITS - Thanks to cr0sis for all the time and patience he spent on testing this bot and for using it since the start. This project would never been born without him :) - Thanks to Ethenal for his damn useful technical assistance and suggestions, his knowledge really helped me in developing this bot. - Thanks to AsPHy for the nice logo and icon - Thanks to andr3w282 for giving me some nice suggestions for debugging, even if that was totally involuntary ;) - Thanks to BRenBot ( www.brenbot.com , www.blackhand-studios.net ) for inspiration - Thanks to the n00bstories community ( www.n00bstories.com ) for years of fun and for letting me meet all the people who helped me in this project. - Thanks to everyone who reported bugs and suggestions, in particular: Minipyro45, DaN#GW ### 12. CONTACT - You can find the latest version of the bot and the support forums at: http://affinitygamers.com Don't forget, if you like this project and the website please leave a donation as a gesture of support and good will. (c) 2008 David "Cunin" Bergantin