[ Variables ] Jerkbot has several formatting, style and variable options available. Below are the variables you can use in all of the files under /responses/ and /help/. Further below you will find additional information in regards to several specialized files. "my_hostnames.db" and "my_realnames.db" in /database/ allow many variables as well, however, variables that include illegal characters will not work properly in the my_hostnames.db file and some networks restrict the amount of characters a realname can have. (Information on alias commands can be found in aliases.txt.) !ver - Version number for Jerkbot !scn - Name of script file !jver - Version number for jIRCii !cver - Internal build number for latest non-forked client !arch - OS architecture !sys - OS name !sver - OS version !kver - Kernel version (Linux) !server - Name of the server network !me - Bot's current nickname !bot - Bot name !autime - Time variable for authorization time limit !ipltime - Time variable for incorrect password lockout timer !joiner - Channel join nick !parter - Channel part nick !kicked - Kicked nick !kicker - Kicker nick !killed - Killed nick !killer - Nick of oper who did a /kill !quitter - Quit nick !onick - Original nick on nick change !nnick - New nickname on nick change !hnick - Nickname of user help was issued to !pnick - Nickname of user talking in public channel !cnick - Nickname of user that sent a command !parms - The last sentence typed by a user !topic - Topic string !tnick - Nickname of user that changed topic !moder - Nick of user who set mode !moded - Nick of user who got the mode !themode - The mode that was changed !pchan - Channel name the public event occurred in !cchan - Channel name the command event occurred in !mchan - Channel name the mode event occurred in !user - Random user from the response channel !rnum1 - Random number from 2 to 9 (not a typo) !rnum2 - Random number from 0 to 99 !rnum3 - Random number from 0 to 999 !rnum4 - Random number from 0 to 9999 !rnum5 - Random number from 0 to 99999 !yr1 - Current year, four digit !yr2 - Year, two digit !mon_ca1 - Current month full name !mon_lc1 - Month full name lcase !mon_ca2 - Month shortened name !mon_lc2 - Month shortened name lcase !mon_ca3 - Month numeric !day_ca1 - Current day full name !day_lc1 - Day full name lcase !day_ca2 - Day short name !day_lc2 - Day short name lcase !dm - Numeric day !hr1 - Current hour, ie: 7 !hr2 - Hour, ie: 07 !hr3 - Hour, ie: 19 !mn - Current minute !sc - Current second !mms - Current millisecond !mrdm_uc - AM/PM !mrdm_lc - am/pm !tz1 - Time zone full lcase !tz2 - Time zone shortened lcase !tz3 - Time zone shortened with numeric lcase !token1-5 - Up to five word tokens for use within /mphrase (These choose a word to match a response to in these ranges: 0-1, 1-2, 2-3, 3-4 and 4-5.) * These variables are specifically used only in strings.db and help files. They are also all in use in their respective locations, so you know which variables can be used where. !ccs - The command character(s) !aunick - The authenticated user !expr - The calc expression !ans - The answer to the calc expression !total - Total number of active connections !list - List of aformentioned connections including session number !1 - The name of the setting !2 - The value the setting has been changed to !3 - The original value of the setting !who - Nickname, if any, the !lev command was issued for !flag - Flags of user !level - Names of flags !helptype - Help specific to user level [ Style and Formatting ] You can include text formatting/styling in responses/, settings/ and styling in the help/ files. --u = Underlined --b = Bold --r = Inverse --o = Halt formatting :: = Multi-line tokenizer, you can create multiple responses in one line. Any line which uses the :: mln tokenizer must also begin with /mln or /fast_mln. Note: for now, multi-line can't be used in the sr_* or sa_* files, unfortunately. There is however a workaround: here are examples using \n (newline) to achieve something similar: /eval call(first_sub() . "\n" . call(next_sub())) <<|>> = Item randomization, surrounded with double angle brackets and split by pipes. ie: /msg !pchan <>, <> This has a limitation; you can't use the double angle brackets inside one another. All response files as well as all settings files can use this randomization. /// = Hide items from display within two sets of triple slashes. This is useful for strings in response, database and module files that may contain sensitive information. Anything between /// and /// will show as '' instead. The following are items that may need to be escaped using "\" for /eval commands in response and settings files or otherwise may cause conflict within the script. Pay careful attention while using these in any custom string. $ % @ ^ & ( ) [ ] | \ [ "/matched.db" File ] Jerkbot can create a match response syntax line that matches small random phrases from sentences according to the settings in settings.db. The bot uses this to form a direct match for either its learned.db or public.db files. Automatic matching is enabled by default. You can also manually add more finely tuned specific phrases to watch for. If you want to do it manually it is suggested that update (and optionally matching) be disabled in settings.db, so that your additions aren't removed during auto-prune after reaching their configured caps. For formatting, you will generally want to enclose a match in wildcards. Manual example: *i am *=>*you're * (To break this down, the first *i am * is the phrase to watch for. Stuff after the => delimiter is used to match responses in files to respond with. This works in conjunction with the specific reply function to give semi-realistic responses as it can also draw from another source for replies.) [ "/responses/sa_public.db" File ] * DISABLED (Refer to changelog.txt s. 1.9.10 line 7) This file contains specific actions to perform based on words or phrases within channels specified. These actions are carried out immediately. Syntax: #chan1,#chan2==*match1*,*match 2*==/command [string] The commands in this file are exempt from flood control and most other mechanisms that are usually invoked during normal conversation between users on irc. This makes a good word filter enforcer for channels that might require this. [ "/responses/sr_*" Files ] In these files you can add lines specific for users that speak or join, or words that it sees. Add a name or word/phrase (this can be split with a ',' comma to match more than one word/phrase), followed by '=='. to signify multiple random lines, use ',,'. The items in these files work by reading the file top to bottom - so in the case of response commands that clash with one another, keep the more generalized ones down near the bottom of the command db, and the more specific ones near the top. Examples: -> /responses/sr_user.db (This is exact match and case sensitive) addphrase sr_user ceph,jason==/msg !pchan i like !pnick,,/msg !pchan hi dad (If ceph or jason says something, it may reply with one of those two lines.) -> /responses/sr_join.db (This is exact match and case sensitive) addphrase sr_join ceph,jason=/msg !pchan hi dad,,/msg !pchan oh look, it's !pnick (If ceph or jason joins channel, it may reply with one of those two lines.) -> /responses/sr_public.db addphrase sr_public i'm hungry,food==/msg !pchan you should eat something,,/msg !pchan i'm hungry too. (If the phrase 'i'm hungry' or 'food' is found, it may reply with one of those two lines.) [ "/settings/percentages.db" File ] This file controls how often the bot will respond to various events by an integer ratio equivalent to a doubled percentage. To keep from getting spammed by the bot, it's a good idea to keep several of them pretty low. Note: all percentages are between values 0 for off or up to 200 for always. (ie: 100 = 50%) //EOF