diff --git a/doc/PBot.html b/doc/PBot.html old mode 100755 new mode 100644 index e5d1c21a..8e8adc20 --- a/doc/PBot.html +++ b/doc/PBot.html @@ -2,8 +2,15 @@ - - PBot + + + + Candide - C + + @@ -21,8 +28,8 @@ var wgServer = "http://www.iso-9899.info"; var wgCanonicalNamespace = ""; var wgCanonicalSpecialPageName = false; var wgNamespaceNumber = 0; -var wgPageName = "PBot"; -var wgTitle = "PBot"; +var wgPageName = "Candide"; +var wgTitle = "Candide"; var wgAction = "view"; var wgRestrictionEdit = ["sysop"]; var wgRestrictionMove = ["sysop"]; @@ -33,295 +40,540 @@ var wgUserGroups = null; var wgUserLanguage = "en"; var wgContentLanguage = "en"; var wgBreakFrames = false; -var wgCurRevisionId = "9009"; +var wgCurRevisionId = "9111"; /*]]>*/ + + + + + - +
-

PBot

+

Candide

+

From C

+
Jump to: navigation, search

Contents

+ +
  • 2 Registry +
  • +
  • 3 Factoids -
  • -
  • 2.2.4 adlib list variables
  • -
  • 2.2.5 action_with_args
  • -
  • 2.2.6 add_nick
  • - - -
  • 2.3 Deleting a factoid +
  • 3.1 List of factoids
  • -
  • 2.4 Viewing/triggering a factoid
  • -
  • 2.5 Viewing/triggering another channel's factoid +
  • 3.2 Adding a factoid -
  • -
  • 2.6 Aliasing a factoid +
  • 3.2.1 factadd
  • +
  • 3.2.2 Special commands
  • -
  • 2.7 Moving/renaming a factoid +
  • 3.2.3 Special variables
  • -
  • 2.8 Changing a factoid +
  • 3.2.4 adlib list variables
  • -
  • 2.9 Finding a factoid +
  • 3.2.5 action_with_args
  • +
  • 3.2.6 add_nick
  • + + +
  • 3.3 Deleting a factoid
  • -
  • 2.10 Information about a factoid +
  • 3.4 Viewing/triggering a factoid
  • +
  • 3.5 Viewing/triggering another channel's factoid
  • - - -
  • 3 Commands +
  • 3.6 Aliasing a factoid +
  • +
  • 3.7 Moving/renaming a factoid
  • -
  • 3.2 Modules +
  • 3.8 Changing a factoid +
  • +
  • 3.9 Finding a factoid
  • -
  • 3.2.2.9 main() Function Unnecessary
  • -
  • 3.2.2.10 Embedding Newlines
  • -
  • 3.2.2.11 Printing in binary/base2
  • -
  • 3.2.2.12 Using the GDB debugger +
  • 3.10 Information about a factoid
  • -
  • 3.2.2.13 Interactive Editing + +
  • +
  • 4 Commands -
  • -
  • 3.2.2.14 Some Examples
  • - - -
  • 3.2.3 english
  • -
  • 3.2.4 expand
  • -
  • 3.2.5 prec
  • -
  • 3.2.6 paren
  • -
  • 3.2.7 faq
  • -
  • 3.2.8 cfact
  • -
  • 3.2.9 cjeopardy +
  • 4.1 Quotegrabs
  • -
  • 3.2.10 c99std
  • -
  • 3.2.11 c11std
  • -
  • 3.2.12 man
  • -
  • 3.2.13 google
  • -
  • 3.2.14 define
  • -
  • 3.2.15 dict
  • -
  • 3.2.16 foldoc
  • -
  • 3.2.17 vera
  • -
  • 3.2.18 udict
  • -
  • 3.2.19 wdict
  • -
  • 3.2.20 acronym
  • -
  • 3.2.21 math
  • -
  • 3.2.22 compliment
  • -
  • 3.2.23 insult
  • -
  • 3.2.24 excuse
  • -
  • 3.2.25 horoscope
  • -
  • 3.2.26 horrorscope
  • -
  • 3.2.27 quote
  • - - -
  • 3.3 Informative +
  • 4.2 Modules -
  • -
  • 3.4 Administrative +
  • 4.2.1 {}
  • +
  • 4.2.2 cc -
  • -
  • 3.5 ##c +
  • 4.2.2.1 Usage
  • +
  • 4.2.2.2 Supported Languages
  • +
  • 4.2.2.3 Default Language
  • +
  • 4.2.2.4 Disallowed system calls
  • +
  • 4.2.2.5 Program termination with no output
  • +
  • 4.2.2.6 Abnormal program termination
  • +
  • 4.2.2.7 C and C++ Functionality
  • +
  • 4.2.2.8 Using the preprocessor
  • - - -
  • 4 Flood control +
  • 4.2.2.9 main() Function Unnecessary
  • +
  • 4.2.2.10 Embedding Newlines
  • +
  • 4.2.2.11 Printing in binary/base2
  • +
  • 4.2.2.12 Using the GDB debugger +
  • +
  • 4.2.2.13 Interactive Editing
  • -
  • 4.5 Opping/Deopping
  • +
  • 4.2.2.14 Some Examples
  • + + +
  • 4.2.3 english
  • +
  • 4.2.4 expand
  • +
  • 4.2.5 prec
  • +
  • 4.2.6 paren
  • +
  • 4.2.7 faq
  • +
  • 4.2.8 cfact
  • +
  • 4.2.9 cjeopardy + +
  • +
  • 4.2.10 c99std
  • +
  • 4.2.11 c11std
  • +
  • 4.2.12 man
  • +
  • 4.2.13 google
  • +
  • 4.2.14 define
  • +
  • 4.2.15 dict
  • +
  • 4.2.16 foldoc
  • +
  • 4.2.17 vera
  • +
  • 4.2.18 udict
  • +
  • 4.2.19 wdict
  • +
  • 4.2.20 acronym
  • +
  • 4.2.21 math
  • +
  • 4.2.22 compliment
  • +
  • 4.2.23 insult
  • +
  • 4.2.24 excuse
  • +
  • 4.2.25 horoscope
  • +
  • 4.2.26 horrorscope
  • +
  • 4.2.27 quote
  • + + +
  • 4.3 Informative + +
  • +
  • 4.4 Administrative + +
  • +
  • 4.5 ##c +
  • +
  • 5 Flood control + +
  • +
  • 6 Anti-away/Nick-control
  • +
  • 7 Anti-auto-rejoin control
  • +
  • 8 Opping/Deopping
  • -

    PBot

    -

    About PBot

    -

    PBot is an IRC bot written in Perl in pragma_'s spare time. +

    Candide

    +

    About Candide

    +

    Candide is an IRC bot written in Perl in pragma_'s spare time.

    -

    Trigger

    -

    All of PBot's commands may begin with its name or its trigger, or be followed by its name. -

    The trigger character defaults to exclaimation mark [!]. -

    Note that commands need not be submitted to the channel; you can /msg it instead. If you /msg PBot, it will respond with a private message in return. In private message, you do not need to specify its name or one of the trigger symbols. -

    -
    Examples:
    - <pragma_> !hi
    - <pragma_> hi, PBot
    - <pragma_> PBot: hi
    -
    -

    Source

    -

    PBot's source may be found at these repositories: +

    Source

    +

    Candide's source may be found at these repositories:

    * https://github.com/pragma-/pbot
    -* https://code.google.com/p/pbot2-pl/source/browse/
     * https://bitbucket.org/pragmasoft/pbot/src
    -* https://gitorious.org/pbot/pbot/
     

    The URL for the source of any loaded modules may be found by using the factinfo command:

     <pragma_> factinfo ##c faq
    - <PBot> faq: Module loaded by pragma_ on Fri Dec 31 02:34:04 2004 -> 
    + <candide> faq: Module loaded by pragma_ on Fri Dec 31 02:34:04 2004 -> 
                https://github.com/pragma-/pbot/blob/master/modules/cfaq.pl, used 512 times (last by ecrane)
     
    -

    Bot Channel

    +

    Bot Channel

    You may test/play with the bot in the #pbot2 channel on irc.freenode.net. +


    -

    Directing output to a user

    -

    You may direct PBot to prepend the nickname of a specific person to a factoid in the channel by stating the nickname after the factoid (if the factoid doesn't take arguments): +

    Trigger

    +

    All of candide's commands may begin with its name or its trigger, or be followed by its name. +

    The trigger character defaults to exclaimation mark [!]. +

    Note that commands need not be submitted to the channel; you can /msg it instead. If you /msg candide, it will respond with a private message in return. In private message, you do not need to specify its name or one of the trigger symbols.

    -
     <pragma_> PBot: version defrost
    - <PBot> defrost: PBot revision 387 2012-10-07
    +
     Examples:
    +   <pragma_> !hi
    +   <pragma_> hi, candide
    +   <pragma_> candide: hi
    +
    +

    Embedded trigger

    +

    Many commands may be triggered from within a sentence. Such commands, however, cannot take any arguments. You can embed up to three triggers in one message. +

    If the sentence begins with a nick that is currently in the channel, the command's response will be prefixed with that nick. +

    +
     Example:
    +   <pragma_> Alice: Check out !K&R for a good book on C.  !H&S is also a great reference manual.
    +   <candide> Alice: K&R is The C Programming Language, 2nd edition, by Kernighan and Ritchie
    +             - http://wayback.archive-it.org/5263/20150203070038/http://cm.bell-labs.com/cm/cs/cbook/
    +             - errata: http://www.iso-9899.info/2ediffs.html
    +   <candide> Alice: H&S is "C - A Reference Manual" by Harbison & Steele; a reference for C on par with K&R 
    +             - http://www.amazon.com/Reference-Manual-Samuel-P-Harbison/dp/013089592X
    +
    +

    Directing output to a user

    +

    You may direct candide to prepend the nickname of a specific person to a factoid in the channel by stating the nickname after the factoid (if the factoid doesn't take arguments): +

    +
     <pragma_> candide: version defrost
    + <candide> defrost: PBot revision 387 2012-10-07
     
    tell

    You may also use the `tell <nick> about <command>` syntax (which is necessary if the factoid does take arguments):

    -
     <pragma_> PBot: tell defrost about help cc
    - <PBot> defrost: To learn all about cc, see http://www.iso-9899.info/wiki/PBot#cc
    +
     <pragma_> candide: tell defrost about help cc
    + <candide> defrost: To learn all about cc, see http://www.iso-9899.info/wiki/Candide#cc
     
    +

    Registry

    +

    Candide's behavior can be customized via a central registry of key/value pairs segregated by sections. +

    There are two types of registry values: literals and arrays. Literals can be strings, floats or integers. Arrays are comma-separated lists of literals. +

    +

    Overriding registry values per-channel

    +

    Some key/value pairs belonging to a specific section may be overridden on a per-channel basis by setting the key/value in a channel-specific section. +

    For example, the bot's trigger is defined in general->trigger. You may add a trigger key in #channel to override the trigger value for that channel: #channel->trigger. +

    For another example, the anti-flood max lines is defined in antiflood->chat_flood_threshold. To override this setting in #coolchannel, you can set #coolchannel->chat_flood_threshold. +

    +

    regadd

    +

    regadd adds a new registry value to a specific section/channel. +

    +
    Usage: regadd <section> <key> <value>
    +
    +
    Example:
    +  <pragma> regadd #mychannel trigger [,!%]
    +  <candide> [#mychannel] trigger set to [,!%]
    +
    +

    Some registry values can be regular expressions, like the above trigger example. Setting general->trigger to the character class [,!%] means that it will respond to , ! and % as trigger characters on a general basis. You can set #somechannel->trigger to something else to override this for that specific channel. +

    +

    regrem

    +

    regrem removes a registry key from a specific section/channel. +

    +
    Usage: regrem <section> <key>
    +
    +

    regshow

    +

    regshow displays the type and value of a specific key. +

    +
    Usage: regshow <section> <key>
    +
    +
    Example:
    +  <pragma> regshow antiflood chat_flood_punishment
    +  <candide> [antiflood] chat_flood_punishment: 60,300,3600,86400,604800,2419200 [array]
    +
    +

    regset

    +

    regset sets the meta-data values for a specific registry key. See registry meta-data list. +

    If you omit the <key> argument, it will list all the defined keys and values for the registry item. If you specify <key> but omit <value>, it will show the value for that specific key. +

    +
    Usage: regset <section> <item> [key [value]]
    +
    +
    Example:
    + <pragma> regset irc botnick value pangloss
    + * candide changed nick to pangloss
    + <pangloss> [irc] botnick: 'value' set to 'pangloss'
    +
    +

    Registry metadata list

    +

    This is a list of recognized registry meta-data keys. +

    +
    • type: sets the type of this registry key; text (literal) or array. +
    • value: the value of this registry key. +
    • private: whether the value of the registry key is displayed in regset, regshow or regfind. If set to a true value, the value of the registry key will be shown as "<private>". +
    +

    regunset

    +

    regunset deletes a meta-data key from a registry key. +

    +
    Usage: regunset <section> <item> <key>
    +
    +

    regchange

    +

    regchange changes the value of a registry item using a regular substitution expression. +

    +
    Usage: regchange <section> <item> s/<pattern>/<replacement>/
    +
    +
    Example:
    +  <pragma> regadd foo bar Hello, world!
    +  <candide> [foo] bar set to Hello, world!
    +  <pragma> regchange foo bar s/world/universe/
    +  <candide> [foo] bar set to Hello, universe!
    +
    +

    regfind

    +

    regfind searches for registry items, and may optionally show the values of all matching items. +

    +
    Usage: regfind [-showvalues] [-section <section>] <regex>
    +
    +

    To limit the search to a specific section, use -section <section>. To dump the entire registry, use `regfind -showvalues .*` +

    +

    Creating array values

    +

    Use the regset command to change the type meta-data value to "array", and set the registry value to a comma-separated list of values. +

    +
    Example:
    +  <pragma> regadd foo animals aardvark, badger, cat, dingo
    +  <candide> [foo] animals set to aardvark, badger, cat, dingo
    +  <pragma> regset foo animals type array
    +  <candide> [foo] animals: 'type' set to 'array'
    +
    +

    List of recognized registry items

    +
    • antiaway->bad_actions +
    • antiaway->bad_nicks +
    • antiaway->kick_msg +
    • antiflood->chat_flood_punishment +
    • antiflood->chat_flood_threshold +
    • antiflood->chat_flood_time_threshold +
    • antiflood->debug_checkban +
    • antiflood->dont_enforce_admins +
    • antiflood->enforce +
    • antiflood->enter_abuse_max_offenses +
    • antiflood->enter_abuse_punishment +
    • antiflood->enter_abuse_threshold +
    • antiflood->enter_abuse_time_threshold +
    • antiflood->join_flood_punishment +
    • antiflood->join_flood_threshold +
    • antiflood->join_flood_time_threshold +
    • antiflood->nick_flood_punishment +
    • antiflood->nick_flood_threshold +
    • antiflood->nick_flood_time_threshold +
    • antikickautorejoin->punishment +
    • antikickautorejoin->threshold +
    • bantracker->chanserv_ban_timeout +
    • bantracker->debug +
    • bantracker->mute_timeout +
    • factoids->default_rate_limit +
    • general->compile_blocks_channels +
    • general->compile_blocks +
    • general->compile_blocks_ignore_channels +
    • general->config_dir +
    • general->data_dir +
    • general->deop_timeout +
    • general->module_dir +
    • general->module_repo +
    • general->paste_ratelimit +
    • general->show_url_titles_channels +
    • general->show_url_titles +
    • general->show_url_titles_ignore_channels +
    • general->trigger +
    • interpreter->max_recursion +
    • irc->botnick +
    • irc->debug +
    • irc->identify_password +
    • irc->ircname +
    • irc->ircserver +
    • irc->log_default_handler +
    • irc->max_msg_len +
    • irc->port +
    • irc->show_motd +
    • irc->SSL_ca_file +
    • irc->SSL_ca_path +
    • irc->SSL +
    • irc->username +
    • lagchecker->lag_history_interval +
    • lagchecker->lag_history_max +
    • lagchecker->lag_threshold +
    • messagehistory->debug_aka +
    • messagehistory->debug_link +
    • messagehistory->max_messages +
    • messagehistory->sqlite_commit_interval +
    • messagehistory->sqlite_debug +
    • nicklist->debug +
    • [channel]->dont_enforce_antiflood +
    • [channel]->max_newlines +
    • [channel]->no_url_titles +
    • [channel]->no_compile_blocks +
    • [channel]->preserve_newlines +

    Factoids

    List of factoids

    The most recent exported list of factoids can be found here: -http://www.iso-9899.info/PBot/factoids.html. +http://www.iso-9899.info/candide/factoids.html.

    Channel namespaces

    Factoids added in one channel may be called/triggered in another channel or in private message, providing that the other channel doesn't already have a factoid of the same name. @@ -345,92 +597,116 @@ then this version of 'malloc' will be called instead of the ##c or the global fa

    Special commands

    /say
    -

    If a factoid begins with "/say " then PBot will not use +

    If a factoid begins with "/say " then candide will not use the "<factoid> is <description>" format when displaying the factoid.

     Example:
        <pragma_> factadd global hi is /say Well, hello there, $nick.
    -   <PBot> 'hi' added to the global channel
    -   <prec> PBot, hi
    -   <PBot> Well, hello there, prec.
    +   <candide> 'hi' added to the global channel
    +   <prec> candide, hi
    +   <candide> Well, hello there, prec.
     
    /me
    -

    If a factoid begins with "/me " then PBot will ACTION the factoid. +

    If a factoid begins with "/me " then candide will ACTION the factoid.

     Example:
        <pragma_> factadd global bounce is /me bounces around.
    -   <PBot> 'bounce' added to the global channel
    +   <candide> 'bounce' added to the global channel
        <pragma_> bounce
    -   *PBot bounces around.
    +   *candide bounces around.
     
    /call
    -

    If a factoid begins with "/call " then PBot will call an existing command. +

    If a factoid begins with "/call " then candide will call an existing command.

     Example:
        <pragma_> factadd global boing is /call bounce
    -   <PBot> 'boing' added to the global channel
    +   <candide> 'boing' added to the global channel
        <pragma_> boing
    -   *PBot bounces around.
    +   *candide bounces around.
     
    /msg
    -

    If a factoid begins with "/msg <nick> " then PBot will /MSG the factoid +

    If a factoid begins with "/msg <nick> " then candide will /MSG the factoid text to <nick>

    Special variables

    -

    Currently there are three special variables: +

    You can use the following variables in a factoid or as an argument to one.

    $nick
    -
     $nick:  expands to the nick of the caller
    -
    +

    $nick expands to the nick of the caller. +

    $args
    -
     $args:  expands to any text following the keyword
    -
    +

    $args expands to any text following the keyword. If there is no text then it expands to the nick of the caller. +

    +
    $arg[n]
    +

    $arg[n] expands to the nth argument. Indexing begins from 0 (the first argument is $arg[0]). You may use a negative number to count from the end; e.g., $arg[-2] means the 2nd argument from the end. Multiple words can be double-quoted to constitute one argument. If the argument does not exist, the variable and the leading space before it will be silently removed. +

    +
    $arg[n:m]
    +

    $arg[n:m] expands to a slice of arguments between n and m. Indexing begins from 0 (the first argument is $arg[0]). Not specifying the m value means the rest of the arguments; e.g., $arg[2:] means the remaining arguments after the first two. Multiple words can be double-quoted to constitute one argument. If the argument does not exist, the variable and the leading space before it will be silently removed. +

    $channel
    -
     $channel:  expands to the name of the channel in which the command is used
    -
    +

    $channel expands to the name of the channel in which the factoid is used. +

    +
    $randomnick
    +

    $randomnick expands to a random nick from the channel in which the factoid is used. +

    adlib list variables

    You may create a list of adlib words by using the normal factoid creation method. -Also note that multiple words can be surrounded with double quotes to constitute one element. +Multiple words can be surrounded with double quotes to constitute one element.

     Example:
        <pragma_> factadd global colors is red green blue "bright yellow" pink "dark purple" orange
    -   <PBot> 'colors' added to the global channel
    +   <candide> 'colors' added to the global channel
     
    -

    Then you can instruct PBot to pick a random word from this list to use in another factoid by +

    Then you can instruct candide to pick a random word from this list to use in another factoid by inserting the list as a variable.

     Example:
        <pragma_> factadd global sky is /say The sky is $colors.
    -   <PBot> 'sky' added to the global channel
    +   <candide> 'sky' added to the global channel
        <pragma_> sky
    -   <PBot> The sky is dark purple.
    +   <candide> The sky is dark purple.
        <pragma_> sky
    -   <PBot> The sky is green.
    +   <candide> The sky is green.
     

    A practical example, creating the RTFM trigger:

     <pragma_> factadd global sizes is big large tiny small huge gigantic teeny
    - <PBot> 'sizes' added to the global channel
    + <candide> 'sizes' added to the global channel
      <pragma_> factadd global attacks is whaps thwacks bashes smacks punts whacks
    - <PBot> 'attacks' added to the global channel
    + <candide> 'attacks' added to the global channel
      <pragma_> factadd global rtfm is /me $attacks $args with a $sizes $colors manual.
    - <PBot> 'rtfm' added to the global channel
    + <candide> 'rtfm' added to the global channel
      <pragma_> rtfm mauke
    - * PBot thwacks mauke with a big red manual.
    + * candide thwacks mauke with a big red manual.
    +
    +
    modifiers
    +

    Adlib list variables can accept trailing modifier keywords prefixed with a colon. These can be chained together to combine their effects. +

    +
    •  :uc - uppercases the expansion +
    •  :lc - lowercases the expansion +
    •  :ucfirst - uppercases the first letter in the expansion +
    •  :title - lowercases the expansion and then uppercases the first letter (effectively an alias for :lc:ucfirst) +
    •  :<channel> - looks for variable in <channel> first; use "global" to refer to the global channel +
    +
     Example:
    +   <pragma_> echo $colors:uc
    +   <candide> RED
    +   <pragma_> echo $colors:ucfirst
    +   <candide> Blue
     

    action_with_args

    You can use the factset command to set a special factoid meta-data key named "action_with_args" to trigger an alternate message if an argument has been supplied.

     Example:
        <pragma_> factadd global snack is /me eats a cookie.
    -   <PBot> 'snack' added to the global channel
    +   <candide> 'snack' added to the global channel
        <pragma_> factset global snack action_with_args /me gives $args a cookie.
    -   <PBot> [Factoids] (global) snack: 'action_with_args' set to '/me gives $args a cookie.'
    +   <candide> [Factoids] (global) snack: 'action_with_args' set to '/me gives $args a cookie.'
        <pragma_> snack
    -   * PBot eats a cookie.
    +   * candide eats a cookie.
        <pragma_> snack orbitz
    -   * PBot gives orbitz a cookie.
    +   * candide gives orbitz a cookie.
     

    add_nick

    You can use the factset command to set a special factoid meta-data key named "add_nick" to prepend the nick of the caller to the output. This is mostly useful for modules. @@ -446,8 +722,8 @@ inserting the list as a variable.

    Viewing/triggering a factoid

    To view or trigger a factoid, one merely issues its keyword as a command.

    -
      <pragma_> PBot, c?
    -  <PBot> C rocks!
    +
      <pragma_> candide, c?
    +  <candide> C rocks!
     

    Viewing/triggering another channel's factoid

    fact

    @@ -467,21 +743,21 @@ inserting the list as a variable.
     Example:
        <pragma_> factadd ##c book is /me points accusingly at $args, "Where is your book?!"
    -   <PBot> 'book' added to ##c
    +   <candide> 'book' added to ##c
        <pragma_> book newbie
    -   *PBot points accusingly at newbie, "Where is your book?!"
    +   *candide points accusingly at newbie, "Where is your book?!"
        <pragma_> factadd ##c rafb is /call book
    -   <PBot> 'rafb' added to ##c
    +   <candide> 'rafb' added to ##c
        <pragma_> rafb runtime
    -   *PBot points accusingly at runtime, "Where is your book?!"
    +   *candide points accusingly at runtime, "Where is your book?!"
     
     Another example:
        <pragma_> factadd ##c offtopic is /say In this channel, '$args' is off-topic.
        <pragma_> offtopic C++
    -   <PBot> In this channel, 'C++' is off-topic.
    +   <candide> In this channel, 'C++' is off-topic.
        <pragma_> factalias ##c C++ offtopic C++ (alternatively: factadd ##c C++ is /call offtopic C++)
        <pragma_> C++
    -   <PBot> In this channel, 'C++' is off-topic.
    +   <candide> In this channel, 'C++' is off-topic.
     

    Moving/renaming a factoid

    factmove

    @@ -497,11 +773,11 @@ inserting the list as a variable.

     Usage:  factchange <channel> <keyword> s/<pattern>/<change to>/
    <pragma_> c - <PBot> C rocks! + <candide> C rocks! <pragma_> factchange ##c c s/rocks/rules/ - <PBot> c changed. + <candide> c changed. <pragma_> c - <PBot> C rules! + <candide> C rules!

    Note that the final argument is a Perl-style substitution regex. See 'man perlre'.

    @@ -513,16 +789,37 @@ inserting the list as a variable.

    Alternatively, you may append to a factoid by using 'is also':

    -
      <pragma_> PBot, c is also See FAQ at http://www.eskimo.com/~scs/C-faq/top.html
    -  <PBot> Changed: c is /say C rules! ; See FAQ at http://www.eskimo.com/~scs/C-faq/top.html
    +
      <pragma_> candide, c is also See FAQ at http://www.eskimo.com/~scs/C-faq/top.html
    +  <candide> Changed: c is /say C rules! ; See FAQ at http://www.eskimo.com/~scs/C-faq/top.html
     

    factset

    -

    To view or set factoid meta-data, such as owner, rate-limit, etc, use the 'factset' command. +

    To view or set factoid meta-data, such as owner, rate-limit, etc, use the 'factset' command. See also: factoid metadata list.

     Usage:  factset <channel> <factoid> [<key> [value]]
     

    Omit <key> and <value> to list all the keys and values for a factoid. Specify <key>, but omit <value> to see the value for a specific key.

    +
    Factoid Metadata List
    +

    This is a list of recognized factoid meta-data fields. The number in parentheses next to the field is the minimum admin level necessary to modify it; if there is no such number then anybody may modify it. +

    +
    • created_on (90): The timestamp of when the factoid was created. +
    • enabled (10): Whether the factoid can be invoked or not. +
    • last_referenced_in (90): The channel or private-message in which the factoid was last used. +
    • last_referenced_on (90): The timestamp of when the factoid was last used. +
    • modulelauncher_subpattern (90): A substitution expression used to modify the arguments into a command-line. +
    • owner (90): The creator of the factoid. +
    • rate_limit (10): How often the factoid may be invoked, in seconds. Zero for unlimited. +
    • ref_count (90): How many times the factoid has been invoked. +
    • ref_user (90): The hostmask of the last person to invoke the factoid. +
    • type (90): The type of the factoid. "text" for regular factoid; "module" for module. +
    • edited_by (90): The hostmask of the person to last edit the factoid. +
    • edited_on (90): The timestamp of when the factoid was last edited. +
    • locked (10): If enabled, prevents the factoid from being changed or removed. +
    • add_nick (10): Prepends the nick of the person invoking the factoid to the output of the factoid. +
    • nooverride (10): Prevents the creation of a factoid with an identical name in a different channel. +
    • action_with_args: Alternate action to perform if an argument has been supplied when invoking the factoid. +
    • noembed: Factoid will not be triggered if embedded within a sentence. +

    factunset

    To unset factoid meta-data, use the 'factunset' command.

    @@ -532,21 +829,21 @@ inserting the list as a variable.

    factfind

    To search the database for a factoid, you may use the 'factfind' command. You may optionally specify whether to narrow by channel and/or include factoid owner and/or last referenced by in the search. -

    If there is only one match for the query, it will display that factoid, otherwise it will list all matches. +

    If there is only one match for the query, it will display that factoid and its text, otherwise it will list all matching keywords.

    Usage: factfind [-channel channel] [-owner nick] [-by nick] [text]
     Example:
    - <pragma_> PBot, factfind cast
    - <PBot> 3 factoids match: [##c] NULL casting dontcastmalloc
    + <pragma_> candide, factfind cast
    + <candide> 3 factoids match: [##c] NULL casting dontcastmalloc
     

    Information about a factoid

    factinfo

    To get information about a factoid, such as who submitted it and when, use the 'factinfo' command:

    -
     factinfo <channel> <keyword>
    +
     factinfo [channel] <keyword>
     
    -
     <pragma_> PBot, factinfo ##c NULL
    - <PBot> NULL: Factoid submitted by Major-Willard for all channels on Sat Jan 1 16:17:42 2005 
    +
     <pragma_> candide, factinfo ##c NULL
    + <candide> NULL: Factoid submitted by Major-Willard for all channels on Sat Jan 1 16:17:42 2005 
                [5 years and 178 days ago], referenced 39 times (last by pragma_ on Sun Jun 27 04:40:32 2010 [5 seconds ago])
     

    If the factoid has been submitted for the special global channel, then it will be shown as 'submitted for all channels'. Otherwise, @@ -555,10 +852,10 @@ it will be shown as 'submitted for #channel'.

    factshow

    To see the factoid string literal, use the 'factshow' command:

    -
     factshow <channel> <keyword>
    +
     factshow [channel] <keyword>
     
     <pragma_> factshow ##c hi
    - <PBot> hi: /say $greetings, $nick.
    + <candide> hi: /say $greetings, $nick.
     

    factset

    To view factoid meta-data, such as owner, rate-limit, etc, use the 'factset' command. @@ -571,17 +868,17 @@ it will be shown as 'submitted for #channel'.

    To see how many factoids and what percentage of the database <nick> has submitted, use the 'count' command:

     <pragma_> count prec
    - <PBot> prec has submitted 28 factoids out of 233 (12%)
    + <candide> prec has submitted 28 factoids out of 233 (12%)
      <pragma_> count twkm
    - <PBot> twkm has submitted 74 factoids out of 233 (31%)
    + <candide> twkm has submitted 74 factoids out of 233 (31%)
      <pragma_> count pragma
    - <PBot> pragma has submitted 27 factoids out of 233 (11%)
    + <candide> pragma has submitted 27 factoids out of 233 (11%)
     

    histogram

    To see a histogram of the top 10 factoid submitters, use the 'histogram' command:

     <pragma_> histogram
    - <PBot> 268 factoids, top 10 submitters: twkm: 74 (27%) Major-Willard:              
    + <candide> 268 factoids, top 10 submitters: twkm: 74 (27%) Major-Willard:              
                64 (23%) pragma_: 40 (14%) prec: 39 (14%) defrost: 14 (5%)  
                PoppaVic: 10 (3%) infobahn: 7 (2%) orbitz: 3 (1%) mauke: 3 
                (1%) Tom^: 2 (1%) 
    @@ -595,7 +892,7 @@ it will be shown as 'submitted for #channel'.
     

    Quotegrabs

    Table of quotegrabs

    -

    A table of grabbed quotes can be found here: http://www.iso-9899.info/PBot/quotegrabs.html +

    A table of grabbed quotes can be found here: http://www.iso-9899.info/candide/quotegrabs.html

    grab

    Grabs a message someone says, and adds it to the quotegrabs database. You may grab multiple nicks/messages in one quotegrab by separating the arguments with a plus sign (the nicks need not be different -- you can grab multiple messages by the same nick by specifying a different history for each grab). @@ -609,26 +906,19 @@ it will be shown as 'submitted for #channel'.

       <bob> Clowns are scary.
        <pragma-> grab bob clowns
    -   <PBot> Quote grabbed: 1: <bob> Clowns are scary.
    +   <candide> Quote grabbed: 1: <bob> Clowns are scary.
     
       <alice> Please put that in the right place.
        <bob> That's what she said!
        <pragma-> grab alice place + bob said
    -   <PBot> Quote grabbed 2: <alice> Please put that in the right place. <bob> That's what she said!
    +   <candide> Quote grabbed 2: <alice> Please put that in the right place. <bob> That's what she said!
     
       <charlie> I know a funny programming knock-knock joke.  
        <charlie> Knock knock!
        <charlie> Race condition.
        <charlie> Who's there?
        <pragma-> grab charlie knock + charlie race + charlie there
    -   <PBot> Quote grabbed 3: <charlie> Knock knock! <charlie> Race condition. <charlie> Who's there?
    -
    -

    recall

    -

    Recalls messages from the chat history and displays them with a relative time-stamp. -

    Usage: recall <[nick [history [channel]]] [-c,channel <channel>] [-t,text,h,history <history>] [+ ...]> -

    -
     <pragma-> recall alice + bob
    - <PBot> [20 seconds ago] <alice> Please put that in the right place. [8 seconds ago] <bob> That's what she said!
    +   <candide> Quote grabbed 3: <charlie> Knock knock! <charlie> Race condition. <charlie> Who's there?
     

    getq

    Retrieves and displays a specific grabbed quote from the quotegrabs database. @@ -645,39 +935,50 @@ it will be shown as 'submitted for #channel'.

    Usage: delq <quote-id>
     
    +

    recall

    +

    Recalls messages from the chat history and displays them with a relative time-stamp. +

    +
     Usage: recall <[nick [history [channel]]] [-c,channel <channel>] [-t,text,h,history <history>] [-b,before <context before>] [-a,after <context after>] [-x,context <nick>] [-n,count <count>] [+ ...]>
    +
    +

    You can use -b/-before and -a/-after to display the messages before and after the result message. For example, `recall ##c -b 99` would show the last 100 messages in the ##c channel. `recall bob 50 -b 5 -a 5` would show the 50th most recent message from bob, including 5 messages before and 5 messages after that message. If you also specify -x <nick>, then the before and after messages will be limited to messages from the <nick> argument; for example, `recall -x bob -b 10` would show bob's 10 most recent messages. +

    Alternatively, you can use -n/-count to display that many matches resulting from a -h/-history search; for example, `recall -h http -n 5` would show the last 5 messages containing "http". You can specify -x/-context to limit the search to a specific nick; for example, `recall -h http -x bob -n 5` would show bob's last 5 messages containing "http". +

    +
    Example:
    + <pragma-> recall alice + bob
    + <candide> [20 seconds ago] <alice> Please put that in the right place. [8 seconds ago] <bob> That's what she said!
    +

    Modules

    {}

    This is just an alias for the cc command. Can take an optional nick argument in front in order to address the output to said nick.

     Example:
        <pragma_> { puts("hello"); }
    -   <PBot> hello
    +   <candide> hello
        <pragma_> somebody: { puts("hi"); }
    -   <PBot> somebody: hi
    +   <candide> somebody: hi
     

    cc

    Code compiler (and executor). This command will compile and execute user-provided code in a number of languages, and then display the compiler and/or program output. -

    The program is executed within a gdb debugger instance, which may be interacted with via the gdb macros described below or with the gdb("command") function. +

    The program is executed within a gdb debugger instance, which may be interacted with via the gdb macros described below or with the gdb("command") function.

    The compiler and program are executed inside a virtual machine. After each run, the virtual machine is restored to a previous state. No system calls have been disallowed. You can write to and read from the filesystem, provided you do it in the same program. The network cable has been unplugged. You are free to write and test any code you like. Have fun. -

    Uses gcc 4.9.0 and gdb 7.7.

    Usage
    -
     Usage: cc [compiler options] [-paste] [-nomain] [-lang=<language>] <code> [-input=<stdin input>]
    +
     Usage: cc [compiler options] [-paste] [-nomain] [-noheaders] [-lang=<language>] <code> [-input=<stdin input>]
             cc <run|undo|show|paste|copy|replace|prepend|append|remove|s/// [and ...]>
             cc <diff>
             [nick] { <same as above without the cc in front> }
     
    • You can pass any gcc compiler options. By default, -Wall -Wextra -std=c11 -pedantic are passed unless an option is specified.
    • The -paste option will pretty-format and paste the code/output to a paste site and display the URL (useful to preserve newlines in output, and to refer to line-numbers). -
    • The -nomain flag will prevent the code from being wrapped with a main() function. +
    • The -nomain flag will prevent the code from being wrapped with a main() function. This is not necessary if you're explicitly defining a main function; it's only necessary if you don't want a main function at all. +
    • The -noheaders flag will prevent any of the default headers from being added to the code. This is not necessary if you explicitly include any headers since doing so will override the default headers. This flag is only necessary if you want absolutely no headers whatsoever.
    • The -input=<stdin input> option provides STDIN input (i.e., scanf(), getc(stdin), etc.); MUST be the last option after any code (otherwise the code will be considered to be input). -
    • The run, undo, show, replace, etc commands are part of interactive-editing. See below. +
    • The run, undo, show, replace, etc commands are part of interactive-editing.
    • The diff command can be used to display the differences between the two most recent snippets.
    • You can use { } instead of cc; the options/flags/comments must be inside the braces. Can take an optional nick argument in front in order to address the output to said nick.
    Supported Languages
    -

    The -lang option accepts the following languages: C, C99 and C11. Alternatively, you may use the -std=<c89|gnu89|c99|gnu99|etc> compiler option to specify which standard to follow. -

    Support for additional languages coming soon. +

    The -lang option can be used to specify an alternate compiler or language. Use -lang=? to list available languages.

    Default Language

    The default language (e.g., without an explicit -lang or -std option) is C11 pedantic; which is gcc -Wall -Wextra -std=c11 -pedantic. @@ -686,26 +987,35 @@ it will be shown as 'submitted for #channel'.

    None. The network cable has been unplugged. Other than that, anything goes. Have fun.

    Program termination with no output
    -

    If there is no output, information about the local variables will be displayed. +

    If there is no output, information about the local variables and/or the last statement will be displayed.

     <pragma_> cc int x = 5, y = 16; x ^= y, y ^= x, x ^= y;
    - <PBot> pragma_: <no output: x = 16; y = 5>
    + <candide> pragma_:  no output: x = 16; y = 5
     
     <pragma_> cc #include <sys/utsname.h> struct utsname u; uname(&u);
    - <PBot> pragma_:  <no output: u = {sysname = "Linux", nodename = "compiler", release = "3.2.0-8-generic", version = "#15-Ubuntu SMP Wed Jan 11 13:57:44 UTC 2012", machine = "x86_64",  __domainname = "(none)"}>
    + <candide> pragma_:  no output: u = {sysname = "Linux", nodename = "compiler", release = "3.2.0-8-generic", version = "#15-Ubuntu SMP Wed Jan 11 13:57:44 UTC 2012", machine = "x86_64",  __domainname = "(none)"}
    +
    +
     <pragma_> cc int a = 2, b = 3;  ++a + b;
    + <candide> pragma_:  no output: ++a + b = 6; a = 3; b = 3
    +
    +
     <pragma_> cc sizeof (char)
    + <candide> pragma_:  no output: sizeof (char) = 1
    +
    +
     <pragma_> cc 2 + 2
    + <candide> pragma_:  no output: 2 + 2 = 4
     
    Abnormal program termination

    If a signal is detected, the bot will display useful information.

    Example session:

    < pragma_> ,cc char *p = 0; *p = 1;
    -< PBot> pragma_: Program received signal 11 (SIGSEGV) at statement: *p = 1; <local variables: p = 0x0>
    +< candide> pragma_: Program received signal 11 (SIGSEGV) at statement: *p = 1; <local variables: p = 0x0>
     
    < pragma_> ,cc void bang() { char *p = 0, s[] = "lol"; strcpy(p, s); }  bang();
    -< PBot> pragma_: Program received signal 11 (SIGSEGV) in bang () at statement: strcpy(p, s); <local variables: p = 0x0, s = "lol">
    +< candide> pragma_: Program received signal 11 (SIGSEGV) in bang () at statement: strcpy(p, s); <local variables: p = 0x0, s = "lol">
     
    < pragma_> ,cc int a = 2 / 0;
    -< PBot> pragma_: [In function 'main': warning: division by zero] Program received signal 8 (SIGFPE) at statement: int a = 2 / 0;
    +< candide> pragma_: [In function 'main': warning: division by zero] Program received signal 8 (SIGFPE) at statement: int a = 2 / 0;
     
    C and C++ Functionality
    Using the preprocessor
    @@ -740,10 +1050,10 @@ it will be shown as 'submitted for #channel'.

    In C and C++, you may #include <file.h> one after another on the same line. The bot will automatically put them on separate lines. If you do use #include, the files you specify will replace the default includes. You do not need to append a \n after the #include.

    <pragma_> cc #include <sys/utsname.h> struct utsname u; uname(&u);
    -<PBot> pragma_:  <no output: u = {sysname = "Linux", nodename = "compiler", release = "3.2.0-8-generic", version = "#15-Ubuntu SMP Wed Jan 11 13:57:44 UTC 2012", machine = "x86_64",  __domainname = "(none)"}>
    +<candide> pragma_:  <no output: u = {sysname = "Linux", nodename = "compiler", release = "3.2.0-8-generic", version = "#15-Ubuntu SMP Wed Jan 11 13:57:44 UTC 2012", machine = "x86_64",  __domainname = "(none)"}>
     
    <pragma_> cc #include <stdio.h> #include <stdlib.h> void func(void) { puts("Hello, world"); } func();
    -<PBot> pragma_: Hello, World
    +<candide> pragma_: Hello, World
     

    In the previous examples, only the specified includes (e.g., <sys/utsname.h> in the first example, <stdio.h> and <stdlib.h> in the second, will be included instead of the default includes.

    @@ -751,14 +1061,14 @@ it will be shown as 'submitted for #channel'.

    You can also #define macros; however, #defines require an explicit "\n" sequence to terminate, otherwise the remainder of the line will be part of the macro.

    <pragma_> cc #define GREETING "Hello, World"\n puts(GREETING);
    -<PBot> pragma_: Hello, World
    +<candide> pragma_: Hello, World
     
    main() Function Unnecessary

    In C and C++, if there is no main function, then a main function will created and wrapped around the appropriate bits of your code (unless the -nomain flag was specified); anything outside of any functions, excluding preprocessor stuff, will be put into this new main function. Here's an example:

     <pragma_> cc -paste int add(int a, int b) { return a + b; } printf("4 + 6 = %d -- ", add(4, 6)); int add3(int a, int b, int c) 
                { return add(a, b) + c; } printf("7 + 8 + 9 = %d", add3(7, 8, 9));
    - <PBot> http://sprunge.us/ehRA?c
    + <candide> http://sprunge.us/ehRA?c
     

    The -paste flag causes the code to be pretty-formatted and pasted with output in comments to a paste site, which displays the following:

    @@ -808,18 +1118,16 @@ int main(void) { ************** OUTPUT *************/
    Embedding Newlines
    -

    In Assembler, you may start a newline in the code via a \n sequence or a semi-colon. -

    In C and C++, #defines must be terminated by a \n sequence. -

    In all other languages, you may embed a newline in the code by using |n. Yes, that's the pipe character followed by 'n'. +

    Any \n character sequence appearing outside of a character literal or a string literal will be replaced with a literal newline.

    Printing in binary/base2

    A freenode ##c regular, Wulf, has provided a printf format specifier 'b' which can be used to print values in base2.

        <Wulf> cc printf("%b", 1234567);
    - <PBot> 000100101101011010000111
    + <candide> 000100101101011010000111
     
        <Wulf> cc printf("%#'b", 1234567);
    - <PBot> 0001.0010.1101.0110.1000.0111
    + <candide> 0001.0010.1101.0110.1000.0111
     
    Using the GDB debugger

    The program is executed within a gdb debugger instance, which may be interacted with via the following gdb macros. @@ -828,118 +1136,52 @@ int main(void) {

    The print() macro prints the values of expressions. Useful for printing out structures and arrays.

    <pragma_> cc int a[] = { 1, 2, 3 }; print(a);
    -<PBot> pragma_: <a = {1, 2, 3}>
    +<candide> pragma_: a = {1, 2, 3}
     
    <pragma_> cc #include <sys/utsname.h> struct utsname u; uname(&u); print(u);
    -<PBot> pragma_: <u = {sysname = "Linux", nodename = "compiler", release = "3.2.0-8-generic", version = "#15-Ubuntu SMP Wed Jan 11 13:57:44 UTC 2012", machine = "x86_64",  __domainname = "(none)"}>
    +<candide> pragma_: u = {sysname = "Linux", nodename = "compiler", release = "3.2.0-8-generic", version = "#15-Ubuntu SMP Wed Jan 11 13:57:44 UTC 2012", machine = "x86_64",  __domainname = "(none)"}
     
    <pragma_> cc print(sizeof(int));
    -<PBot> pragma_: <sizeof(int) = 4>
    +<candide> pragma_: sizeof(int) = 4
     
    <pragma_> cc print(2+2);
    -<PBot> pragma_: <2 + 2 = 4>
    +<candide> pragma_: 2 + 2 = 4
     
    ptype

    The ptype() macro prints the types of expressions.

     <pragma_> cc int *a[] = {0}; ptype(a); ptype(a[0]); ptype(*a[0]);
    - <PBot> pragma_: <a = int *[1]> <a[0] = int *> <*a[0] = int>
    + <candide> pragma_: a = int *[1]  a[0] = int *  *a[0] = int
     
    watch

    The watch() macro watches a variable and displays its value when it changes.

    -
    <pragma_> cc int n = 0, last = 1; watch(n); while(n <= 7000) { n += last; last = n - last; } /* fibonacci */
    -<PBot> pragma_: <n = 1> <n = 2> <n = 3> <n = 5> <n = 8> <n = 13> <n = 21> <n = 34> <n = 55> <n = 89> <n = 144> <n = 233> <n = 377> <n = 610> <n = 987> <n = 1597> <n = 2584> <n = 4181> <n = 6765> <n = 10946>
    +
    <pragma_> cc int n = 0, last = 1; watch(n); while(n <= 144) { n += last; last = n - last; } /* fibonacci */
    +<candide> pragma_: n = 1  n = 2  n = 3  n = 5  n = 8  n = 13  n = 21  n = 34  n = 55  n = 89  n = 144
     
    trace

    The trace() macro traces a function's calls, displaying passed and returned values.

     <pragma_> ,cc trace(foo); char *foo(int n) { puts("Hello, world"); return "Good-bye, world"; } foo(42);
    - <PBot> pragma_: <entered [1] foo (n=42)>
    -                    Hello, world
    -                    <leaving [1] foo (n=42), returned 0x401006 "Good-bye, world">
    -
    -
     <pragma_> ,cc int fib2(int n, int p0, int p1) { return n == 1 ? p1 : fib2(n  - 1, p1, p0 + p1); } 
    -               int fib(int n) { return n == 0 ? 0 : fib2(n, 0, 1); } 
    -               trace(fib); trace(fib2); for(int i = 0; i < 20; i++) printf("%d ", fib(i));
    - <PBot> pragma_: <entered [1] fib (n=0)>
    -                    <leaving [1] fib (n=0), returned 0>
    -                    1
    -                    <entered [1] fib (n=2)>
    -                    <entered [2]  fib2 (n=2, p0=0, p1=1)>
    -                    <entered [3]   fib2 (n=1, p0=1, p1=1)>
    -                    <leaving [3]   fib2 (n=1, p0=1, p1=1), returned 1>
    -                    <leaving [2]  fib2 (n=2, p0=0, p1=1), returned 1>
    -                    <leaving [1] fib (n=2), returned 1>
    -                    1
    -                    <entered [1] fib (n=3)>
    -                    <entered [2]  fib2 (n=3, p0=0, p1=1)>
    -                    <entered [3]   fib2 (n=2, p0=1, p1=1)>
    -                    <entered [4]    fib2 (n=1, p0=1, p1=2)>
    -                    <leaving [4]    fib2 (n=1, p0=1, p1=2), returned 2>
    -                    <leaving [3]   fib2 (n=2, p0=1, p1=1), returned 2>
    -                    <leaving [2]  fib2 (n=3, p0=0, p1=1), returned 2>
    -                    <leaving [1] fib (n=3), returned 2>
    -                    2
    -                    <entered [1] fib (n=4)>
    -                    <entered [2]  fib2 (n=4, p0=0, p1=1)>
    -                    <entered [3]   fib2 (n=3, p0=1, p1=1)>
    -                    <entered [4]    fib2 (n=2, p0=1, p1=2)>
    -                    <entered [5]     fib2 (n=1, p0=2, p1=3)>
    -                    <leaving [5]     fib2 (n=1, p0=2, p1=3), returned 3>
    -                    <leaving [4]    fib2 (n=2, p0=1, p1=2), returned 3>
    -                    <leaving [3]   fib2 (n=3, p0=1, p1=1), returned 3>
    -                    <leaving [2]  fib2 (n=4, p0=0, p1=1), returned 3>
    -                    <leaving [1] fib (n=4), returned 3>
    -                    3
    -                    <entered [1] fib (n=5)>
    -                    <entered [2]  fib2 (n=5, p0=0, p1=1)>
    -                    <entered [3]   fib2 (n=4, p0=1, p1=1)>
    -                    <entered [4]    fib2 (n=3, p0=1, p1=2)>
    -                    <entered [5]     fib2 (n=2, p0=2, p1=3)>
    -                    <entered [6]      fib2 (n=1, p0=3, p1=5)>
    -                    <leaving [6]      fib2 (n=1, p0=3, p1=5), returned 5>
    -                    <leaving [5]     fib2 (n=2, p0=2, p1=3), returned 5>
    -                    <leaving [4]    fib2 (n=3, p0=1, p1=2), returned 5>
    -                    <leaving [3]   fib2 (n=4, p0=1, p1=1), returned 5>
    -                    <leaving [2]  fib2 (n=5, p0=0, p1=1), returned 5>
    -                    <leaving [1] fib (n=5), returned 5>
    -                    5
    -                    <entered [1] fib (n=6)>
    -                    <entered [2]  fib2 (n=6, p0=0, p1=1)>
    -                    <entered [3]   fib2 (n=5, p0=1, p1=1)>
    -                    <entered [4]    fib2 (n=4, p0=1, p1=2)>
    -                    <entered [5]     fib2 (n=3, p0=2, p1=3)>
    -                    <entered [6]      fib2 (n=2, p0=3, p1=5)>
    -                    <entered [7]       fib2 (n=1, p0=5, p1=8)>
    -                    <leaving [7]       fib2 (n=1, p0=5, p1=8), returned 8>
    -                    <leaving [6]      fib2 (n=2, p0=3, p1=5), returned 8>
    -                    <leaving [5]     fib2 (n=3, p0=2, p1=3), returned 8>
    -                    <leaving [4]    fib2 (n=4, p0=1, p1=2), returned 8>
    -                    <leaving [3]   fib2 (n=5, p0=1, p1=1), returned 8>
    -                    <leaving [2]  fib2 (n=6, p0=0, p1=1), returned 8>
    -                    <leaving [1] fib (n=6), returned 8>
    -                    8
    -                    ... etc ...
    + <candide> pragma_: entered [1] foo (n=42)  Hello, world  leaving [1] foo (n=42), returned 0x401006 "Good-bye, world"
     
    gdb

    The gdb() function takes a string argument which it passes to the gdb debugger and then displays the output if any.

     <pragma_> ,cc gdb("info macro NULL");
    - <PBot> pragma_: <Defined at /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h:402> <#define NULL ((void *)0)>
    + <candide> pragma_: Defined at /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h:402  #define NULL ((void *)0)
     
     <pragma_> ,cc void foo() { gdb("info frame"); } foo();
    - <PBot> pragma_: <Stack level 1, frame at 0x7fffffffe660:> rip = 0x400e28 in foo (); saved rip 0x400e43 called by frame at 0x7fffffffe680, caller of frame at 0x7fffffffe650 source language
    -                    c. Arglist at 0x7fffffffe650, args: Locals at 0x7fffffffe650, Previous frame's sp is 0x7fffffffe660 Saved registers: rbp at 0x7fffffffe650, rip at 0x7fffffffe658
    + <candide> pragma_: Stack level 1, frame at 0x7fffffffe660: rip = 0x400e28 in foo (); saved rip 0x400e43 called by frame at 0x7fffffffe680, caller of frame at 0x7fffffffe650 source language c. Arglist at 0x7fffffffe650, args: Locals at 0x7fffffffe650, Previous frame's sp is 0x7fffffffe660 Saved registers: rbp at 0x7fffffffe650, rip at 0x7fffffffe658
     
    Interactive Editing

    The cc command supports interactive-editing. The general syntax is: cc [command]. -

    Each cc snippet is saved in a buffer which is named after the channel or nick it was used in. You can use show or diff with a buffer argument to view that buffer; otherwise you can use the copy command to copy the most recent snippet of another buffer into the current buffer and optionally chain it with another command -- for example, to copy the ##c buffer and paste it: cc copy ##c and paste. +

    Each cc snippet is saved in a buffer which is named after the channel or nick it was used in. You can use show or diff with a buffer argument to view that buffer; otherwise you can use the copy command to copy the most recent snippet of another buffer into the current buffer and optionally chain it with another command -- for example, to copy the ##c buffer (e.g., from a private message or a different channel) and paste it: cc copy ##c and paste.

    The commands are: copy, show, diff, paste, run, undo, s//, replace, prepend, append, and remove. Most of the commands may be chained together by separating them with whitespace or "and".

    The commands are described in more detail below:

    copy
    -

    To copy a snippet from another buffer, use the copy command. Other commands can optionally be chained after this command. +

    To copy the most recent snippet from another buffer (e.g., to copy another channel's or private message's buffer to your own private message or channel), use the copy command. Other commands can optionally be chained after this command.

     Usage: cc copy <buffer> [and ...]
     
    @@ -947,7 +1189,7 @@ int main(void) {

    To show the latest code in the buffer, use the show command. This command can take an optional buffer argument.

     <pragma_> cc show
    - <PBot> pragma_: printf("Hello, world!");
    + <candide> pragma_: printf("Hello, world!");
     

    This command is stand-alone and cannot be chained with other interactive-editing commands.

    @@ -955,7 +1197,7 @@ int main(void) {

    To see the differences between the two most recent snippets, use the diff command. This command can take an optional buffer argument.

     <pragma_> cc diff
    - <PBot> pragma: printf("<replaced `Hello` with `Good-bye`>, <replaced `world` with `void`>");
    + <candide> pragma: printf("<replaced `Hello` with `Good-bye`>, <replaced `world` with `void`>");
     

    This command is stand-alone and cannot be chained with other interactive-editing commands.

    @@ -963,7 +1205,7 @@ int main(void) {

    To paste the full source of the latest code in the buffer as the compiler sees it, use the paste command:

     <pragma_> cc paste
    - <PBot> pragma_: http://some.random.paste-site.com/paste/results
    + <candide> pragma_: http://some.random.paste-site.com/paste/results
     

    This command is stand-alone and cannot be chained with other interactive-editing commands.

    @@ -971,7 +1213,7 @@ int main(void) {

    To attempt to compile and execute the latest code in the buffer, use the run command:

     <pragma_> cc run
    - <PBot> pragma_: Hello, world!
    + <candide> pragma_: Hello, world!
     

    This command is stand-alone and cannot be chained with other interactive-editing commands.

    @@ -982,9 +1224,9 @@ int main(void) {

    To change the latest code in the buffer, use the s/regex/substitution/[gi] pattern.

     <pragma_> cc s/Hello/Good-bye/ and s/world/void/
    - <PBot> pragma_: Good-bye, void!
    + <candide> pragma_: Good-bye, void!
      <pragma_> cc show
    - <PBot> pragma_: printf("Good-bye, void!");
    + <candide> pragma_: printf("Good-bye, void!");
     
    replace

    Alternatively, you may use the replace command. The usage is (note the required single-quotes): @@ -1011,35 +1253,35 @@ int main(void) {

       < pragma_> cc int fib2(int n, int p0, int p1) { return n == 1 ? p1 : fib2(n  - 1, p1, p0 + p1); } 
                    int fib(int n) { return n == 0 ? 0 : fib2(n, 0, 1); } for(int i = 0; i < 21; i++) printf("%d ", fib(i));
    -   < PBot> pragma_: 0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 6765
    +   < candide> pragma_: 0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 6765
     
       < pragma_> cc int i = 0, last = 1; while(i <= 7000) { printf("%d ", i); i += last; last = i - last; }
    -    <PBot> pragma_: 0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 6765
    +    <candide> pragma_: 0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 6765
     
       <Icewing> cc int n=0, f[2]={0,1}; while(n<20) printf("%d ",f[++n&1]=f[0]+f[1]); // based on cehteh
    -   <PBot> Icewing: 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 6765
    +   <candide> Icewing: 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 6765
     
      <3monkeys> cc @p=(0,1); until($#p>20) { print"$p[-2]\n"; push @p, $p[-2] + $p[-1] } -lang=Perl
    -   <PBot> 3monkeys: 0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181
    +   <candide> 3monkeys: 0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181
     
       <spiewak> cc -lang=Ruby p,c=0,1; 20.times{p p; c=p+p=c}
    -   <PBot> spiewak: 0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181
    +   <candide> spiewak: 0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181
     
         <Jafet> cc main = print $ take 20 $ let fibs = 0 : scanl (+) 1 fibs in fibs; -lang=Haskell
    -   <PBot> Jafet: [0,1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584,4181]
    +   <candide> Jafet: [0,1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584,4181]
     

    english

    -

    Converts C code into English sentences. Understands only C89 code. +

    Converts C11 code into English sentences.

     Usage: english <C snippet>
     
     Examples:
         <pragma_> english char (*a)[10];  char *b[10];
    -    <PBot> Let a be a pointer to an array of length 10 of type char. Let b be an array of length 10 of type pointer to char.
    +    <candide> Let a be a pointer to an array of length 10 of type char. Let b be an array of length 10 of type pointer to char.
         <pragma_> english for(;;);
    -    <PBot> Repeatedly compute nothing.
    +    <candide> Repeatedly compute nothing.
         <pragma_> english typedef char Batman; char Bruce_Wayne; char superhero = (Batman) Bruce_Wayne;
    -    <PBot> Let Batman be another name for a character. Let Bruce_Wayne be a character. Let superhero be a character, with value being Bruce_Wayne cast to a Batman.
    +    <candide> Let Batman be another name for a character. Let Bruce_Wayne be a character. Let superhero be a character, with value being Bruce_Wayne cast to a Batman.
     

    expand

    Expands macros in C code and displays the resulting code. Macros must be terminated by a \n sequence. You may #include headers to expand macros defined within. @@ -1048,9 +1290,9 @@ int main(void) {

     Example:
         <pragma_> expand #define WHILE while ( \n #define DO ) { \n #define WEND } \n  int i = 5; WHILE --i DO puts("hi"); WEND
    -    <PBot> pragma_: int i = 5; while ( --i ) { puts("hi"); }
    +    <candide> pragma_: int i = 5; while ( --i ) { puts("hi"); }
         <pragma_> expand #include <stdlib.h> NULL
    -    <PBot> pragma_: ((void *)0)
    +    <candide> pragma_: ((void *)0)
     

    prec

    paren

    @@ -1061,11 +1303,11 @@ int main(void) {
     Examples:
         <pragma_> prec *a++
    -    <PBot> pragma_: *(a++)
    +    <candide> pragma_: *(a++)
         <pragma_> prec a = b & c
    -    <PBot> pragma_: a = (b & c)
    +    <candide> pragma_: a = (b & c)
         <pragma_> prec token = strtok(s, d) != NULL
    -    <PBot> pragma_: token = (strtok(s, d) != NULL)
    +    <candide> pragma_: token = (strtok(s, d) != NULL)
     

    faq

    Displays questions from the comp.lang.c faq. Some queries may return more than one result; if this happens, you may use the 'match #' optional argument to specify the match you'd like to view. @@ -1073,17 +1315,17 @@ int main(void) {

     Usage: faq [match #] <search regex>
      Examples:
        <pragma_> faq cast malloc
    -   <PBot> 2 results, displaying #1: 7. Memory Allocation, 7.6 Why am  
    +   <candide> 2 results, displaying #1: 7. Memory Allocation, 7.6 Why am  
                  I getting ``warning: assignment of pointer from integer 
                  lacks a cast for calls to malloc? : 
                  http://www.eskimo.com/~scs/C-faq/q7.6.html
        <pragma_> faq 2 cast malloc
    -   <PBot> 2 results, displaying #2: 7. Memory Allocation, 7.7 Why 
    +   <candide> 2 results, displaying #2: 7. Memory Allocation, 7.7 Why 
                  does some code carefully cast the values returned by 
                  malloc to the pointer type being allocated? :    
                  http://www.eskimo.com/~scs/C-faq/q7.7.html
        <pragma_> faq ^6.4
    -   <PBot> 6. Arrays and Pointers, 6.4 Why are array and pointer 
    +   <candide> 6. Arrays and Pointers, 6.4 Why are array and pointer 
                  declarations interchangeable as function formal 
                  parameters? : http://www.eskimo.com/~scs/C-faq/q6.4.html
     
    @@ -1094,12 +1336,44 @@ int main(void) {

    cjeopardy

    Displays a random C Jeopardy question. You can specify a search text to limit the random set to those containing that text. Answer the questions with `what is ...?` +Can be used to skip the current question.

     Usage: cjeopardy [search text]
     
    hint

    Displays a hint for the current C Jeopardy question. Each subsequent hint request reveals more of the answer.

    +
    what
    +
    w
    +

    Answers a C Jeopardy question. `w` may be used as an alternative short-hand. +

    +
     Usage: what is <answer>?
    + Usage: w <answer>
    +
    +
    score
    +

    Shows the personal C Jeopardy statistics for a player. If used without any arguments, it shows your own statistics. +

    +
     Usage: score [player name]
    +
    +
    rank
    +

    Shows ranking for various C Jeopardy statistics, or your personal rankings in each of the statistics. If used without any arguments, it shows the available keywords for which statistics to rank. +

    +
     Usage: rank [keyword or player name]
    +
    +
    reset
    +

    Resets your personal C Jeopardy statistics for the current session. Your life-time records will still be retained. +

    +
    qstats
    +

    Shows statistics specific to a C Jeopardy question. Can also rank questions by a specific statistic. +

    +
     Usage: qstats [question id]
    + Usage: qstats rank [keyword or question id]
    +
    +
    qshow
    +

    Displays a specific C Jeopardy question without making it the current question. Useful for seeing which question belongs to a question id; .e.g. with qstats. +

    +
     Usage: qshow <question id>
    +

    c99std

    Searches ISO/IEC 9899:TC3 (WG14/N1256), also known as the C99 draft standard. http://www.open-std.org/jtc1/sc22/WG14/www/docs/n1256.pdf

    @@ -1114,13 +1388,13 @@ int main(void) {
     Examples:
     
       < pragma_> c99std pointer value
    -   < PBot> Displaying #1 of 64 matches: 5.1.2.2.1p1: [Program startup] If they are declared, the parameters to the 
    +   < candide> Displaying #1 of 64 matches: 5.1.2.2.1p1: [Program startup] If they are declared, the parameters to the 
                   main function shall obey the following constraints: -- The value of argc shall be nonnegative. -- argv[argc] 
                   shall be a null pointer. -- If the value of argc is greater than zero, the array members argv[0] through
                   argv[argc-1] inclusive shall contain pointers to st... truncated; see http://codepad.org/f2DULaGQ for full text.
     
       < pragma_> c99std pointer value -list
    -   < PBot> Sections containing 'pointer value': 5.1.2.2.1p2, 5.1.2.3p9, 6.2.5p20, 6.2.5p27, 6.3.2.1p3, 6.3.2.1p4, 
    +   < candide> Sections containing 'pointer value': 5.1.2.2.1p2, 5.1.2.3p9, 6.2.5p20, 6.2.5p27, 6.3.2.1p3, 6.3.2.1p4, 
                   6.3.2.3p2, 6.3.2.3p6, 6.5.2.1p3, 6.5.2.2p5, 6.5.2.2p6, 6.5.2.4p1, 6.5.2.4p2, 6.5.3.1p1, 6.5.3.2p3, 6.5.3.2p4,
                   6.5.3.3p5, 6.5.3.4p5, 6.5.6p8, 6.5.6p9, 6.5.8p5, 6.5.15p6, 6.6p7, 6.6p9, 6.7.2.2p5, 6.7.2.3p7, 6.7.2.3p3, 
                   6.7.5.1p3, 6.7.5.2p7, 7.1.1p1, 7.1.1p4, 7.1.4p1, 7... truncated; see http://codepad.org/qQlnJYJk for full text.
    @@ -1128,16 +1402,16 @@ int main(void) {
     
       < pragma_> Hmm, how about just section 6.3?
     
      < pragma_> c99std pointer value 6.3
    -  < PBot> Displaying #1 of 4 matches: 6.3.2.1p1: [Lvalues, arrays, and function designators] Except when it is the operand
    +  < candide> Displaying #1 of 4 matches: 6.3.2.1p1: [Lvalues, arrays, and function designators] Except when it is the operand
                  of the sizeof operator or the unary & operator, or is a string literal used to initialize an array, an expression
                  that has type ``array of type is converted to an expression with type ``pointer to type that points to the
                  initial element of the array ob... truncated; see http://codepad.org/mf1RNnr2 for full text.
     
      < pragma_> c99std pointer value 6.3 -list
    -  < PBot> Sections containing 'pointer value': 6.3.2.1p3, 6.3.2.1p4, 6.3.2.3p2, 6.3.2.3p6
    +  < candide> Sections containing 'pointer value': 6.3.2.1p3, 6.3.2.1p4, 6.3.2.3p2, 6.3.2.3p6
     
      < pragma_> c99std pointer value 6.3 -n3
    -  < PBot> Displaying #3 of 4 matches: 6.3.2.3p1: [Pointers] For any qualifier q, a pointer to a non-q-qualified type may be
    +  < candide> Displaying #3 of 4 matches: 6.3.2.3p1: [Pointers] For any qualifier q, a pointer to a non-q-qualified type may be
                  converted to a pointer to the q-qualified version of the type; the values stored in the original and converted 
                  pointers shall compare equal.
     
    @@ -1151,19 +1425,19 @@ int main(void) {
    Usage:  man [section] query
     Samples:
      <pragma_> man fork
    - <PBot> Includes: sys/types.h, unistd.h - pid_t fork(void); - SVr4,  
    + <candide> Includes: sys/types.h, unistd.h - pid_t fork(void); - SVr4,  
                SVID, POSIX, X/OPEN, BSD - fork creates a child process that 
                differs from the parent process only in its PID and PPID, and 
                in the fact that resource utilizations are set to 0 - 
                http://www.iso-9899.info/man?fork
      <pragma_> man atexit
    - <PBot> Includes: stdlib.h - int atexit(void (*function)(void)); - 
    + <candide> Includes: stdlib.h - int atexit(void (*function)(void)); - 
                SVID 3, BSD 4.3, ISO 9899 - atexit () function registers the 
                given function to be called at normal program termination, 
                whether via exit(3) or via return from the program's main - 
                http://www.iso-9899.info/man?atexit
      <pragma_> man getcwd
    - <PBot> Includes: unistd.h - char *getcwd(char *buf, size_t size); - 
    + <candide> Includes: unistd.h - char *getcwd(char *buf, size_t size); - 
                POSIX.1 - getcwd () function copies an absolute pathname of 
                the current working directory to the array pointed to by buf, 
                which is of length size - http://www.iso-9899.info/man?getcwd
    @@ -1174,10 +1448,10 @@ Samples:
     
    Usage:  google [number of results] query
     Samples:
       <pragma_> google brian kernighan
    -  <PBot> brian kernighan (115,000): Brian Kernighan's Home Page:                  
    +  <candide> brian kernighan (115,000): Brian Kernighan's Home Page:                  
                 (http://www.cs.princeton.edu/~bwk/)
       <pragma_> google 3 brian kernighan
    -  <PBot> brian kernighan (115,000): Brian Kernighan's Home Page:                  
    +  <candide> brian kernighan (115,000): Brian Kernighan's Home Page:                  
                 (http://www.cs.princeton.edu/~bwk/), An Interview with Brian      
                 Kernighan: (http://www-2.cs.cmu.edu/~mihaib/kernighan-interview/),
                 Interview with Brian Kernighan | Linux Journal: 
    @@ -1189,7 +1463,7 @@ Samples:
     

    define

    dict

    Displays dictionary defintions from http://dict.org using DICT protocol. -

    Databases for the -d option are listed here: http://www.iso-9899.info/PBot/dict_databases.txt -- Note that there may be several commands aliased to one of these databases; for example, the `foldoc` command is an alias to `dict -d foldoc`. +

    Databases for the -d option are listed here: http://www.iso-9899.info/candide/dict_databases.txt -- Note that there may be several commands aliased to one of these databases; for example, the `foldoc` command is an alias to `dict -d foldoc`.

     Usage: dict [-d database] [-n start from definition number] [-t first letter of word class type (n]oun, v]erb, etc)] 
             [-search <regex> for definitions matching <regex>] <word>
    @@ -1197,32 +1471,32 @@ Samples:
     
     Examples:
     
       <pragma_> dict hit
    -   <PBot> hit: n: 1) (baseball) a successful stroke in an athletic contest (especially in baseball); 
    +   <candide> hit: n: 1) (baseball) a successful stroke in an athletic contest (especially in baseball); 
                 "he came all the way around on Williams' hit", 2) the act of contacting one thing with another; 
                 "repeated hitting raised a large bruise"; "after three misses she finally got a hit" [syn: hitting,
                 striking], 3) a conspicuous success; "that song was his first hit and marked the beginning of his 
                 career"; "that new Broadway show is a real smasher"
     
       <pragma_> dict -n 4 hit
    -   <PBot> hit: n: 4) (physics) an brief event in which two or more bodies come together; "the collision of the 
    +   <candide> hit: n: 4) (physics) an brief event in which two or more bodies come together; "the collision of the 
                  particles resulted in an exchange of energy and a change of direction" [syn: collision], 5) a dose 
                  of a narcotic drug, 6) a murder carried out by an underworld syndicate; "it has all the earmarks of 
                  a Mafia hit", 7) a connection made via the internet to another website; "WordNet gets many hits from 
                  users worldwide"
     
       <pragma_> dict -t v hit
    -   <PBot> hit: v: 1) cause to move by striking; "hit a ball", 2) hit against; come into sudden contact with; 
    +   <candide> hit: v: 1) cause to move by striking; "hit a ball", 2) hit against; come into sudden contact with; 
                  "The car hit a tree"; "He struck the table with his elbow" [syn: strike, impinge on, run into, 
                  collide with] [ant: miss], 3) affect or afflict suddenly, usually adversely; "We were hit by really 
                  bad weather"; "He was stricken with cancer when he was still a teenager"; "The earthquake struck at 
                  midnight" [syn: strike], 4) deal a blow to
     
       <pragma_> dict -search ball hit
    -   <PBot> hit: n: 1) (baseball) a successful stroke in an athletic contest (especially in baseball); "he came all 
    +   <candide> hit: n: 1) (baseball) a successful stroke in an athletic contest (especially in baseball); "he came all 
                  the way around on Williams' hit", v: 1) cause to move by striking; "hit a ball"
     
       <pragma_> dict -d eng-fra hit
    -   <PBot> hit: 1) [hit] battre, frapper, heurter frapper, heurter atteindre, frapper, parvenir, saisir
    +   <candide> hit: 1) [hit] battre, frapper, heurter frapper, heurter atteindre, frapper, parvenir, saisir
     

    foldoc

    This is just an alias for `dict -d foldoc`. @@ -1247,12 +1521,12 @@ Samples:

    Usage:  acronym query
     Samples:
       <pragma_> acronym posix
    -  <PBot> posix (3 entries): Portable Operating System for   
    +  <candide> posix (3 entries): Portable Operating System for   
                 Information Exchange, Portable Operating System Interface 
                 Extensions (IBM), Portable Operating System Interface for        
                 Unix
       <pragma_> acronym linux
    -  <PBot> linux (1 entries): Linux Is Not UniX
    +  <candide> linux (1 entries): Linux Is Not UniX
     

    math

    Evaluate calculations. @@ -1260,7 +1534,7 @@ Samples:

    Usage:  math <expression>
     Example:
       <pragma_> math 5 + 5
    -  <PBot> 5 + 5 = 10
    +  <candide> 5 + 5 = 10
     

    compliment

    Displays a random Markov-chain compliment/insult. @@ -1295,69 +1569,163 @@ that author; if you specify text and --author, it searches for quotes by that au

    Usage: quote [search text] [--author <author name>]
     Samples:
       <pragma_> quote
    -  <PBot> "Each success only buys an admission ticket to a more difficult problem." -- Henry Kissinger (1923 -  ).
    +  <candide> "Each success only buys an admission ticket to a more difficult problem." -- Henry Kissinger (1923 -  ).
       <pragma_> quote --author lao tzu
    -  <PBot> 41 matching quotes found. "A journey of a thousand miles begins with a single step." -- Lao-tzu (604 BC - 531 BC).
    +  <candide> 41 matching quotes found. "A journey of a thousand miles begins with a single step." -- Lao-tzu (604 BC - 531 BC).
       <pragma_> quote butterfly
    -  <PBot> 11 matching quotes found. "A chinese philosopher once had a dream that he was a butterfly. From that day on, he
    +  <candide> 11 matching quotes found. "A chinese philosopher once had a dream that he was a butterfly. From that day on, he
                 was never quite certain that he was not a butterfly, dreaming that he was a man." -- Unknown.
     

    Informative

    list

    Lists information about specified argument

    -
    Usage:  .list <modules|factoids|commands|admins>
    +
    Usage: list <modules|factoids|commands|admins>
     

    info

    Shows detailed information about a module or a factoid

    -
     Usage:  .info <module|factoid>
    +
     Usage: info <channel> <keyword>
     

    version

    Shows version information

    source

    -

    Shows PBot's source information. +

    Shows candide's source information.

    help

    Shows link to this page.

    Administrative

    login

    -

    You cannot use any of the admin commands unless you login first +

    You cannot use any of the admin commands unless you login first.

     Usage:  login <password>
     
    -

    Note that login requires that your nick and hostmask match PBot's records. +

    Note that login requires that your hostmask matches candide's records.

    logout

    -

    Logs out of PBot. +

    Logs out of candide. +

    +

    Admin Management

    +
    adminadd
    +

    Adds a bot admin. +

    +
    Usage: adminadd <name> <channel> <hostmask> <level> <password>
    +
    +
    • name: a unique name to identify this account (usually the nick of the admin, but can be any identifier). +
    +
    • channel: which channel the admin can administrate; use "global" for all channels. This field cannot be changed without removing and re-adding the admin. +
    +
    • hostmask: a regular expression of what hostmask the admin is recognized/allowed to login from (e.g., somenick!.*@.*.somedomain.com or .*@unaffiliated/someuser). This field cannot be changed without removing and re-adding the admin. +
    +
    • level: an integer representing their level of privileges. See admin-levels. +
    +
    • password: the password the admin will use to login (from /msg!). A password is not required if the `stayloggedin` meta-data is set for the admin; however, a dummy password still needs to be set. +
    +
    Admin Levels
    +

    This is a list of admin commands allowed by each admin level. Higher level admins have access to all lower level admin commands. +

    +
    • 10: whitelist, blacklist, chanlist, ban, unban, mute, unmute, kick, ignore, unignore +
    • 40: chanset, chanunset, chanadd, chanrem, join, part +
    • 60: adminadd, adminrem, adminset, adminunset, akalink, akaunlink, regadd, regrem, regset, regunset, regchange +
    • 90: sl, load, unload, export, rebuildaliases, refresh, die +
    +
    adminrem
    +

    Removes a bot admin. You can use the name field or the hostmask field that was set via adminadd. +

    +
    Usage: adminrem <channel> <name/hostmask>
    +
    +
    adminset
    +

    Sets meta-data for an admin account. You can use the name field or the hostmask field that was set via adminadd. See also: admin metadata list. +

    If `key` is omitted, it will list all the keys and values that are set. If `value` is omitted, it will show the value for `key`. +

    +
    Usage: adminset <channel> <name/hostmask> [<key> [value]]
    +
    +
    Admin Metadata List
    +

    This is a list of recognized meta-data keys for admin accounts. +

    +
    • name: A unique name identifying this admin account. +
    • level: The privilege level of the admin. See admin levels. +
    • password: The password for this admin account. +
    • loggedin: Whether the admin is logged in or not. +
    • stayloggedin: Do not automatically log the admin out when they part/quit. +
    +
    adminunset
    +

    Deletes a meta-data key from an admin account. You can use the name field or the hostmask field that was set via adminadd. +

    +
    Usage: adminunset <channel> <name/hostmask> <key>
    +
    +

    Channel Management

    +
    chanadd
    +

    chanadd adds a channel to candide's list of channels to auto-join and manage. +

    +
    Usage: chanadd <channel>
    +
    +
    chanrem
    +

    chanrem removes a channel from candide's list of channels to auto-join and manage. +

    +
    Usage: chanrem <channel>
    +
    +
    chanset
    +

    chanset sets a channel's meta-data. See channel meta-data list +

    +
    Usage: chanset <channel> [key [value]]
    +
    +

    If both key and value are omitted, chanset will show all the keys and values for that channel. If only value is omitted, chanset will show the value for that key. +

    +
    Channel Metadata List
    +
    • enabled: when set to a true value, candide will auto-join this channel after identifying to NickServ. +
    • chanop: when set to a true value, candide will perform channel management (anti-flooding, ban-evasion, etc). +
    • permop: when set to a true value, candide will automatically op itself when joining and remain opped instead of automatically opping and deopping as necessary. +
    +
    chanunset
    +

    chanunset deletes a channel's meta-data key. +

    +
    Usage: chanunset <channel> <key>
    +
    +
    chanlist
    +

    chanlist lists all added channels and their meta-data keys and values.

    ignore

    Ignore a user

    -
    Usage:  ignore <hostmask> [channel] [timeout]
    +
    Usage:  ignore <hostmask regex> [channel [timeout]]
     
    -

    unignore

    -

    Unignores a user +

    Timeout can be specified as an relative time in English; for instance, "5 minutes", "1 month and 2 weeks", "next thursday", "friday after next", and so on.

    -
    Usage:  unignore <hostmask> [channel]
    +

    unignore

    +

    Unignores a user2 +

    +
    Usage:  unignore <hostmask regex> [channel]
    +
    +

    whitelist

    +

    Whitelists a hostmask to be exempt from ban evasions. +

    +
    Usage:  whitelist <show/list>
    +        whitelist add <channel> <hostmask>
    +        whitelist remove <channel> <hostmask>
    +
    +

    blacklist

    +

    Blacklists a hostmask regex from joining a channel. +

    +
    Usage:  blacklist <show/list>
    +        blacklist add <hostmask regex> [channel]
    +        blacklist remove <hostmask regex> [channel]
     

    ban

    -

    Bans a user +

    Bans a user. If the argument is a nick instead of a hostmask, it will determine an appropriate banmask for that nick.

    -
     Usage:  ban <hostmask> [timeout seconds]
    +
     Usage:  ban <nick or hostmask> [channel [timeout]]
     
    -

    If timeout is omitted, PBot will ban the user for one hour. Timeout is in seconds. +

    If timeout is omitted, candide will ban the user for 24 hours. Timeout can be specified as an relative time in English; for instance, "5 minutes", "1 month and 2 weeks", "next thursday", "friday after next", and so on.

    unban

    -

    Unbans a user +

    Unbans a user. If the argument is a nick instead of a hostmask, it will find all bans that match any of that nick's hostmasks or NickServ accounts and unban them.

     Usage:
    -   unban <hostmask>
    +   unban <nick or hostmask> [channel]
     
    -

    Note that <hostmask> must EXACTLY match the hostmask in the ban list for the channel. -

    kick

    Removes a nick from the channel.

    @@ -1365,10 +1733,21 @@ Samples: From private message: kick <channel> <nick> <reason>

    export

    -

    exports specified list to web page +

    Exports specified list to website.

    -
    Usage:  export <commands|factoids|admins|channels>
    +
    Usage:  export <commands|factoids|quotegrabs|admins|channels>
     
    +

    refresh

    +

    Refreshes/reloads PBot core modules (not the loadable modules since those are "loaded" each time they are invoked). +

    +

    sl

    +

    Sends a raw IRC line to the server. +

    +
    Example: sl PRIVMSG #channel :Test message
    +
    +

    die

    +

    Kills candide. :-( Causes candide to disconnect and exit. +

    ##c

    C-Aphorisms

    The C Aphorisms can be triggered with c<n> where <n> is an integer representing one of the aphorisms. For example, to quote C Aphorism 1, use `c1`. @@ -1389,40 +1768,43 @@ Samples:

  • The more the questioner attempts to describe their problem, the less coherent their description becomes.
  • Flood control

    -

    PBot can monitor the channel for excessive rapid traffic originating from an individual and automatically ban the offender for a certain length of time. +

    Candide can monitor the channel for excessive rapid traffic originating from an individual and automatically ban the offender for a certain length of time.

    Message flood

    -

    If four (4) or more messages are sent within ten (10) seconds, the flood control is triggered. The offender will be muted for 30 seconds for the first offense. Each additional offense will result in the offender being muted for a much longer period. For example, the first offense will result in 30 seconds, the 2nd offense will be 5 minutes, the 3rd will be 1 hour, and so on. +

    If four (4) or more messages are sent within five (5) seconds, the flood control is triggered. The offender will be muted for 30 seconds for the first offense. Each additional offense will result in the offender being muted for a much longer period. For example, the first offense will result in 30 seconds, the 2nd offense will be 5 minutes, the 3rd will be 1 hour, and so on. The offense counter is decremented once every 24 hours. +

    The offender will be sent the following private message: "You have been muted due to flooding. Please use a web paste service such as http://ideone.com for lengthy pastes. You will be allowed to speak again in $timeout."

    Join flood

    If four (4) or more JOINs are observed within thirty (30) minutes without any messages in between joins, the offender will be forwarded to another channel for a limited time: 2^(number_of_offenses + 2) hours. -

    In addition to private instructions from PBot, this channel will have a /topic and ChanServ on-join message with instructions explaining to the offender how to remove the forwarding. The instructions are to message PBot with: unbanme <channel>. -

    (Any messages sent to the public channel by the user at any time will reset their JOIN counter back to zero. The unbanme command can only be used for the first two offenses -- the offense counter is decremented once every 24 hours.) +

    In addition to private instructions from candide, this channel will have a /topic and ChanServ on-join message with instructions explaining to the offender how to remove the forwarding. The instructions are to message candide with: unbanme <channel>. +

    Any messages sent to the public channel by the user at any time will reset their JOIN counter back to zero. The unbanme command can only be used for the first two offenses -- the offense counter is decremented once every 24 hours. +

    The offender will be sent the following private message: "You have been banned from $channel due to join flooding. If your connection issues have been resolved, or this was an accident, you may request an unban at any time by responding to this message with: unbanme $channel, otherwise you will be automatically unbanned in $timeout."

    Enter key abuse

    If four (4) consecutive messages are sent with ten (10) seconds or less between individual messages and without another person speaking, an enter-key-abuse counter is incremented. This counter will then continue to be incremented every two (2) consecutive messages with ten (10) seconds or less in between until another person speaks or more than ten (10) seconds have elapsed, whereupon it returns to requiring four (4) consecutive messages. When this counter reaches three (3) or greater, the offender will be muted using the same timeout rules as message flooding. This counter is automatically decremented once per hour. +

    The offender will be sent the following private message: "You have been muted due to abusing the enter key. Please do not split your sentences over multiple messages. You will be allowed to speak again in $timeout."

    -

    Notification message

    -

    PBot will send the following message to the offender each offense. +

    Nick flood

    +

    If four (4) or more nick-changes are observed within thirty (30) minutes, the nick-change flood control is triggered. The offender will be muted for 15 minutes for the first offense. Each additional offense will result in the offender being muted for a much longer period. The offense counter is decremented once every 24 hours. +

    The offender will be sent the following private message: "You have been temporarily banned due to nick-change flooding. You will be unbanned in $timeout."

    -

    Message flooding

    -

    "You have been muted due to flooding. Please use a web paste service such as http://codepad.org for lengthy pastes. You will be allowed to speak again in $timeout." +

    Anti-away/Nick-control

    +

    Candide can detect nick-changes to undesirable nicks such as those ending with |away, as well as undesirable ACTIONs such as /me is away. +

    When such a case is detected, Candide will kick the offender with a link to http://sackheads.org/~bnaylor/spew/away_msgs.html in the kick message.

    -

    Join flooding

    -

    "You have been banned from $channel due to join flooding. If your connection issues have been resolved, or this was an accident, you may request an unban at any time by responding to this message with: unbanme $channel, otherwise you will be automatically unbanned in $timeout." +

    Anti-auto-rejoin control

    +

    Candide can detect if someone immediately auto-rejoins after having been kicked. +

    When such a case is detected, Candide will kickban the offender (with a kick message of "$timeout ban for auto-rejoining after kick") for 5 minutes for the first offense. Each additional offense will result in the offender being banned for a much longer period. The offense counter is decremented once every 24 hours.

    -

    Enter key abuse

    -

    "You have been muted due to abusing the enter key. Please do not split your sentences over multiple messages. You will be allowed to speak again in $timeout." -

    -

    Opping/Deopping

    -

    ChanServ will automagically op and deop PBot when necessary. PBot will wait until about 5 minutes have elapsed before requesting a deop from ChanServ. +

    Opping/Deopping

    +

    ChanServ will automagically op and deop Candide when necessary. Candide will wait until about 5 minutes have elapsed before requesting a deop from ChanServ.


    Category IRC

    - + +Retrieved from "http://www.iso-9899.info/wiki/Candide"
    @@ -1433,10 +1815,10 @@ Retrieved from "http://www.iso-9899
    Views
    @@ -1444,7 +1826,7 @@ Retrieved from "http://www.iso-9899
    Personal tools
    @@ -1479,10 +1861,10 @@ Retrieved from "http://www.iso-9899
    Toolbox
    +
  • Printable version
  • @@ -1490,8 +1872,8 @@ Retrieved from "http://www.iso-9899 + - +