Shoutouts to the GudeFrends IRC network and jIRCii community. If you find a bug(s) or need help, feel free to find me on EFnet/DALnet as ceph. - ceph (ceph@email.com) -- http://cepheidvariable.online/irc/ [ Preamble ] This is a script suite that forms a bot system for jIRCii. Main features include sentence learning/matching, inline response scripting allowable directly from commands on irc, a sizable collection of functional modules such as custom commands, weather, seen, wiki, news (and many more), an extensive help system, secure password storage, a built-in phrase system, and much more. Some minor portions of Jerkbot contain code inspired by scripts written by blue-elf and phos. Jerkbot hasn't been tested on Windows lately but seeing that it uses Java, there should not be any issues unless there are problems with Sleep on Windows. There is also very little error handling involved for settings, mod settings and file entries that are added or created incorrectly. If you are not vigilant, you can and will mess up this bot's settings, so read /docs and help files before changing things. The good news is that there is a very thorough help system available to use. just type !com after you've set up your bot, and it will give you a list of commands you can use. The help shown is relative to the level of the user requesting help. When you add your host to the bot_ownerauth.db and bot_owner.db files, you will see all help commands available to all user levels. [ Notes ] For now, mode chat responses are disabled until I do a serious review of their operation in relation to other aspects of the bot's operations. There are some current gating and response issues directly with particular regard to channel and variable choice that I will need to go over, as I've been noticing various anomolies that I can't quite pinpoint at this time. This might be a little arduous but I will get around to it. Disabled: halfop, halfopme, op, opme, voice, voiceme and desync response (chatter) files. [ Getting Started ] First, you need jIRCii to run this. You can download it at http://www.oldschoolirc.com. To enhance your experience, you may want to also get additional scripts written by other authors of the jIRCii community over at http://www.oldschoolirc.com/scripts, such as: a) System Tray Support (jircii-tray) by [Serge] An invaluable tool for this type of script, and is particularly useful for Windows. Link: http://amip.tools-for.net/wiki/jircii/plugins?s[]=jircii c) autoserv.irc by me autoserv.irc can make it easier to connect Jerkbot and run startup commands without having to add the network in the server list. It's also handy as an alternate channel join with different channels than those in bot_channels.db. Link: http://cepheidvariable.online/irc/more/autoserv.zip 1) To start, load 'jb.irc' into jIRCii as is, or rename that file to the name you want the file to be before you load it. * IMPORTANT: If you changed the name of the jb.irc file, you will need to change the name of the "jb" directory under /bots/ to the new matching name, and also in the script itself under the $bn variable near the top of the script. Check over the listing of modules in @modlist just below $bn, and timing settings a little further down. (changing timing settings are preferential and not necessary.) 2) Add yourself to the bot. Replace the current mask in "/bots//database/bot_owner.db" and bot_ownerauth.db with your own to give you complete control; you should add only your own masks to these files, as there are commands that can be exploited for abuse if you allow owner access to anyone you don't trust implicitly. To do this from the client, type '/aaowner your@mask' and '/aowner your@mask'. (Use standard wildcard mask format.) Authentication and your matching mask is required to access top level owner commands. You can find these commands labeled 'aowner' in aohelp and aliases.txt. If you need access to these commands and more from irc, you can start with the following: '/msg !pass ' to create a new password for your current mask, and then '/msg !auth ' to authenticate to the bot. (default auth reset time is 2 minutes, after which you will need to reauthenticate.) Password storage uses obfuscation, code trickery, character jumbling and file tomfoolery to create an invisible, salted/hashed and encrypted password file. If a password is forgotten, check the "advanced use.txt" file for information on resetting it. Any /command issued directly from the client does not need to be authenticated. If setauth is set to 'on' in the settings.db file, the following commands will also require authentication before use: !set, !mset, !per, !db. (On by default.) 3) Open up "/bots//settings/settings.db" and enable or disable options for your bot. These settings can also be modified directly through irc using the !set command. Most settings changes are made immediately upon applying the command, with the exception of settings that contain timings. Changes to these require a subsequent "/jerkbot refresh" (cmd.irc !refresh) You can also do the same for "/bots//settings/modsettings.db", for module-specific settings, and those can also be changed over IRC with the !mset command. 4) Connecting the bot is simple. Use standard irc commands, such as /server servername and /join #channel from within the client to initially get your bot on your channel. 5) Message the bot with "!help" for more setting and command information. Type "/jerkbot" from the client to get the full owner-privileged listing of jerkbot's main commands and module information. * Quick note on changing bots: bot change requires your mask to be in the bot_owner.db and bot_ownerauth.db files for the current and new bot. As the bot owner, remember to include your hostmask in any and all bots that you create. 6) Add the channels you want your bot to respond in with one of three methods: /achan #channel from the client directly, "/msg bot !achan #channel" or "!achan #channel" from in the channel itself. Then type "/joinall" in the client to have it join those channels. you can add additional channels that it can randomly join and part with "!archan #channel". Do the same for channels you want your bot to learn in, using alchan instead of achan. 7) If you want your bot to oper up to take advantage of hidehost capabilities, you'll need to edit the oinfo setting in settings.db and invoke /hidehost. This information is in plaintext in the file but is not shown anywhere via any command. 8) Learning is enabled by default at 200 (100% of public messages.) After some time when it has learned a few things, you can change the amount of responses it'll use from the learned file with the learn setting in /settings/percentages.db. (!per learn) [ Modules ] Modules for Jerkbot are also written in Sleep, but are typically short in terms of code requirements. If you're familiar with Sleep (or Perl) you probably won't have any problem writing your own custom module. If you're not, you can use the included modules to better understand how they work with Jerkbot. Some general rules should be followed with custom modules that you create: All modules must be declared in the main script and new commands that modules introduce to Jerkbot (alias {}) will need to be added to the /commands/ files in order to function. All included modules already have the associated lines in those files. (cmd.irc custom commands should not be added to files in the /commands/ directory.) Any module settings are to be stored in modsettings.db under the bot's settings/ directory. It is a very good idea to keep the module setting name as short as possible, to allow room for display when used with commands on irc. List of modules currently included (23): antiflood.irc, cmd.irc, convert.irc, cracked.irc, crypt.irc, imdb.irc, keybinds.irc, news.irc, notes.irc, quote.irc, reddit.irc, seen.irc, takenick.irc, textfx.irc, theonion.irc, troll.irc, ud.irc, url.irc, voicer.irc, weather.irc, wiki.irc, yahoo.irc and znc.irc. [ Tips & Info ] a) Read the other files in docs/ to get a much better understanding of Jerkbot, and how you can customize all aspects of this bot. b) All lines in most response files and strings files are standard irc client commands using !variables and must be formatted as such in order to parse correctly. c) All public commands can also be messaged to the bot. Always include the command character. d) You can "pass time" between multi-line commands by inserting "/eval" into it, which will create a delay based on what @t_rand has been set to in the script. "/eval" is also useful if you want to set certain response percentages to 200 yet still have a possible non-response active as well, by using ,, separators. ie: "hi==/phrase,,/eval,,/eval" (1/3 chance for /phrase) e) The rate at which Jerkbot responds and learns is governed by keywords and percentages. You will want to fine-tune these to your liking as you get used to how the bot operates in your channel. f) To set up another bot to run alongside the first, do this: 1) Make a copy of /bots/jb folder and give the copy a new name. Update bot specific things in the new folder. 2) Make a copy of jb.irc and rename it to your new bot's name. 3) Open up the new .irc file in your favorite text editor and change the '$bn' variable name near the top of the script to the new name. Comment out any modules you don't want loaded in the list just below. 4) Start another copy of jIRCii, type "/ul" to unload the previous Jerkbot script, and load the new script. You may or may not also have to initially turn '/jerkbot on' and use '/jerkbot -d' to disable debug. * You can also use /jerkbot bot with multiple bots to temporarily switch to a different bot from the original client, as long as that bot has a directory under /bots/. g) Certain settings in settings.db and modsettings.db require a /jerkbot refresh (F5 with keybinds.irc loaded) to take effect. These include all settings which use timers. h) To comment out lines in files (with the exception of the channel files), use two pound signs '##'. This will keep the script from using anything behind these pound symbols. i) The bot runs most optimally when in one channel. With more channels in the mix, you run the risk of what could be considered response bleedout, meaning it may respond in the incorrect channels due to quick changes of variables between multiple active channels. I've done my best to mitigate this by assigning specific variables to as many actions as I could, and by setting flags, but it doesn't work perfectly. This may be an inherent problem with running a bot from an IRC client. // EOF