doc: update TOC headers

This commit is contained in:
Pragmatic Software 2020-01-12 10:23:32 -08:00
parent b14d29473c
commit 1f3bf44f6c
7 changed files with 321 additions and 301 deletions

View File

@ -1,72 +1,71 @@
Administrative
--------------
# Administrative
<!-- md-toc-begin -->
* [Logging in and out](#logging-in-and-out)
* [login](#login)
* [logout](#logout)
* [Admin management commands](#admin-management-commands)
* [adminadd](#adminadd)
* [adminrem](#adminrem)
* [Logging in and out](#logging-in-and-out)
* [login](#login)
* [logout](#logout)
* [Admin management commands](#admin-management-commands)
* [adminadd](#adminadd)
* [adminrem](#adminrem)
* [Admin levels](#admin-levels)
* [adminset](#adminset)
* [adminunset](#adminunset)
* [adminset](#adminset)
* [adminunset](#adminunset)
* [Admin metadata list](#admin-metadata-list)
* [Listing admins](#listing-admins)
* [Channel management commands](#channel-management-commands)
* [join](#join)
* [part](#part)
* [chanadd](#chanadd)
* [chanrem](#chanrem)
* [chanset](#chanset)
* [chanunset](#chanunset)
* [chanlist](#chanlist)
* [Listing admins](#listing-admins)
* [Channel management commands](#channel-management-commands)
* [join](#join)
* [part](#part)
* [chanadd](#chanadd)
* [chanrem](#chanrem)
* [chanset](#chanset)
* [chanunset](#chanunset)
* [chanlist](#chanlist)
* [Channel metadata list](#channel-metadata-list)
* [ignore](#ignore)
* [unignore](#unignore)
* [whitelist](#whitelist)
* [blacklist](#blacklist)
* [op](#op)
* [deop](#deop)
* [voice](#voice)
* [devoice](#devoice)
* [mode](#mode)
* [ban/mute](#banmute)
* [unban/unmute](#unbanunmute)
* [invite](#invite)
* [kick](#kick)
* [Module management commands](#module-management-commands)
* [load](#load)
* [unload](#unload)
* [Plugin management commands](#plugin-management-commands)
* [plug](#plug)
* [unplug](#unplug)
* [replug](#replug)
* [pluglist](#pluglist)
* [Miscellaneous commands](#miscellaneous-commands)
* [export](#export)
* [refresh](#refresh)
* [reload](#reload)
* [sl](#sl)
* [die](#die)
* [ignore](#ignore)
* [unignore](#unignore)
* [whitelist](#whitelist)
* [blacklist](#blacklist)
* [op](#op)
* [deop](#deop)
* [voice](#voice)
* [devoice](#devoice)
* [mode](#mode)
* [ban/mute](#banmute)
* [unban/unmute](#unbanunmute)
* [invite](#invite)
* [kick](#kick)
* [Module management commands](#module-management-commands)
* [load](#load)
* [unload](#unload)
* [Plugin management commands](#plugin-management-commands)
* [plug](#plug)
* [unplug](#unplug)
* [replug](#replug)
* [pluglist](#pluglist)
* [Miscellaneous commands](#miscellaneous-commands)
* [export](#export)
* [refresh](#refresh)
* [reload](#reload)
* [sl](#sl)
* [die](#die)
<!-- md-toc-end -->
### Logging in and out
## Logging in and out
You cannot use any of the admin commands unless you login. Note that login requires that your hostmask matches PBot's records.
However, if your admin account have the `loggedin` and `stayloggedin` metadata set to a true value then you will not need to login.
#### login
### login
Logs into PBot.
Usage: `login [channel] <password>`
#### logout
### logout
Logs out of PBot.
Usage: `logout`
### Admin management commands
#### adminadd
## Admin management commands
### adminadd
Adds a new admin to PBot.
Usage: `adminadd <name> <channel> <hostmask> <level> <password>`
@ -79,12 +78,12 @@ Parameter | Description
`<level>` | An integer representing their level of privileges. See [admin-levels](#admin-levels).
`<password>` | The password the admin will use to login (from /msg!). A password is not required if the `stayloggedin` and `loggedin` metadata are set for the admin; however, a dummy password still needs to be set.
#### adminrem
### adminrem
Removes an admin from PBot. You can use the name field or the hostmask field that was set via `adminadd`.
Usage: `adminrem <channel> <name or hostmask>`
##### Admin levels
### 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.
Level | Commands
@ -95,19 +94,19 @@ Level | Commands
90 | sl, plug, unplug, replug, load, unload, reload, export, rebuildaliases, refresh, die
99 | eval
#### adminset
### adminset
Sets metadata for an admin account. You can use the `name` field or the `hostmask` field that was set via `adminadd`. See also: [admin metadata list](#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 or hostmask> [<key> [value]]`
#### adminunset
### adminunset
Deletes a metadata key from an admin account. You can use the name `field` or the `hostmask` field that was set via adminadd.
Usage: `adminunset <channel> <name or hostmask> <key>`
##### Admin metadata list
### Admin metadata list
This is a list of recognized metadata keys for admin accounts.
Name | Description
@ -118,7 +117,7 @@ Name | Description
`loggedin` | Whether the admin is logged in or not.
`stayloggedin` | Do not log the admin out when they part/quit.
#### Listing admins
### Listing admins
To list admins, use the `list admins` command. This is not an admin command, but
it is included here for completeness.
@ -128,66 +127,66 @@ When used in a channel, it will list only the admins for that channel, plus all
global admins. When used from private message, it will list all admins from
all channels, including global admins.
### Channel management commands
## Channel management commands
#### join
### join
To temporarily join a channel, use the `join` command. The channels may be a comma-
separated list.
Usage: `join <channel(s)>`
#### part
### part
To temporarily leave a channel (that is, without removing it from PBot's list
of channels), use the `part` command. The channels may be a comma-separated
list.
Usage `part <channel(s)>`
#### chanadd
### chanadd
`chanadd` permanently adds a channel to PBot's list of channels to auto-join and manage.
Usage: `chanadd <channel>`
#### chanrem
### chanrem
`chanrem` removes a channel from PBot's list of channels to auto-join and manage.
Usage: `chanrem <channel>`
#### chanset
### chanset
`chanset` sets a channel's metadata. See [channel metadata list](#channel-metadata-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.
#### chanunset
### chanunset
`chanunset` deletes a channel's metadata key.
Usage: `chanunset <channel> <key>`
#### chanlist
### chanlist
`chanlist` lists all added channels and their metadata keys and values.
##### Channel metadata list
### Channel metadata list
Name | Description
--- | ---
`enabled` | When set to a true value, PBot will auto-join this channel after identifying to NickServ (unless `general.autojoin_wait_for_nickserv` is `0`, in which case auto-join happens immediately).
`chanop` | When set to a true value, PBot will perform channel management (anti-flooding, ban-evasion, etc).
`permop` | When set to a true value, PBot will automatically op itself when joining and remain opped instead of automatically opping and deopping as necessary.
#### ignore
### ignore
Ignore a user. If you omit `[channel]` PBot will ignore the user in all channels, including private messages.
Usage: `ignore <hostmask regex> [channel [timeout]]`
Timeout can be specified as an relative time in English; for instance, `5 minutes`, `1 month and 2 weeks`, `next thursday`, `friday after next`, `forever` and such.
#### unignore
### unignore
Unignores a user. If you omit `[channel]` PBot will unignore the user from all channels, including private messages.
Usage: `unignore <hostmask regex> [channel]`
#### whitelist
### whitelist
Whitelists a hostmask regex to be exempt from ban evasions or anti-flood enforcement.
Usages:
@ -196,7 +195,7 @@ Usages:
- `whitelist add <channel> <hostmask>`
- `whitelist remove <channel> <hostmask>`
#### blacklist
### blacklist
Blacklists a hostmask regex from joining a channel.
Usages:
@ -205,10 +204,10 @@ Usages:
- `blacklist add <hostmask regex> [channel]`
- `blacklist remove <hostmask regex> [channel]`
#### op
#### deop
#### voice
#### devoice
### op
### deop
### voice
### devoice
The `op`, `deop`, `voice` and `devoice` commands all perform their respective named action.
The `targets` parameter can be a list of multiple nicks, optionally containing
@ -230,7 +229,7 @@ From private message:
* `voice <channel> [targets]`
* `devoice <channel> [targets]`
#### mode
### mode
Sets or unsets channel or user modes.
Usage: `mode [channel] <flags> [targets]`
@ -239,7 +238,7 @@ PBot extends the IRC `MODE` command in useful ways. For instance, the `targets`
parameter may contain wildcards. To op everybody whose nick ends with `|dev` you
can do `!mode +o *|dev` in a channel.
#### ban/mute
### ban/mute
Bans or mutes a user. If the argument is a nick instead of a hostmask, it will determine an appropriate banmask for that nick.
The argument can be a comma-separated list of multiple nicks or masks.
@ -249,7 +248,7 @@ Usages:
If `timeout` is omitted, PBot 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`, `forever` and such.
#### unban/unmute
### unban/unmute
Unbans or unmutes 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.
The argument can be a comma-separated list of multiple nicks or masks.
@ -257,22 +256,22 @@ Usages:
- `unban <nick or hostmask> [channel]`
- `unmute <nick or hostmask> [channel]`
#### invite
### invite
Invites a user to a channel.
Usage: `invite [channel] <nick>`
#### kick
### kick
Removes a user from the channel. `<nick>` can be a comma-separated list of multiple users, optionally containing wildcards. If `[reason]` is omitted, a random insult will be used.
Usage from channel: `kick <nick> [reason]`
From private message: `kick <channel> <nick> [reason]`
### Module management commands
## Module management commands
Note that modules are "reloaded" each time they are executed. There is no need to `refresh` after editing a module.
#### load
### load
This command loads a module in `$data_dir/modules/` as a PBot command. It is
equivalent to `factadd`ing a new keyword and then setting its `type` to `module`.
@ -282,30 +281,30 @@ For example, to load `$data_dir/modules/qalc.sh` as the `qalc` command:
<pragma-> !load qalc qalc.sh
#### unload
### unload
This command unloads a module. It is equivalent to deleting the factoid keyword
the module was loaded as.
Usage: `unload <keyword>`
### Plugin management commands
## Plugin management commands
#### plug
### plug
Loads a plugin into PBot.
Usage: `plug <plugin>`
#### unplug
### unplug
Unloads a plugin from PBot.
Usage: `unplug <plugin>`
#### replug
### replug
Reloads a plugin into PBot. The plugin is first unloaded and then it is loaded again.
Usage: `replug <plugin>`
#### pluglist
### pluglist
Lists all currently loaded plugins. This isn't an admin command, but it is included here for completeness.
Usage: `pluglist`
@ -313,27 +312,27 @@ Usage: `pluglist`
<pragma-> !pluglist
<PBot> Loaded plugins: ActionTrigger, AntiAway, AntiKickAutoRejoin, AntiNickSpam, AntiRepeat, AntiTwitter, AutoRejoin, GoogleSearch, Quotegrabs, RemindMe, UrlTitles
### Miscellaneous commands
## Miscellaneous commands
These are some of the miscellaneous admin commands that have not been covered
above or in the rest of the PBot documentation.
#### export
### export
Exports specified list to HTML file in `$data_dir`.
Usage: `export <factoids|quotegrabs>`
#### refresh
### refresh
Refreshes/reloads PBot core modules and plugins (not the command-line modules since those are executed/loaded each time they are invoked).
#### reload
### reload
Reloads a data or configuration file from `$data_dir`. This is useful if you
manually edit a data or configuration file and you want PBot to know about the
modifications.
Usage `reload <admins|bantimeouts|blacklist|channels|factoids|funcs|ignores|mutetimeouts|registry|whitelist>`
#### sl
### sl
Sends a raw IRC line to the server. This is useful if you want to execute any
IRC command on the IRC server, in its raw pure form. Use the `sl` command when
PBot does not have a built-in command to do what you need.
@ -343,6 +342,6 @@ Usage: `sl <irc command>`
<pragma-> sl PRIVMSG #channel :Test message
<PBot> Test message
#### die
### die
Tells PBot to disconnect and exit.

View File

@ -1,32 +1,27 @@
Anti-Abuse
==========
# Anti-Abuse
PBot can monitor channels for abusive behavior and take appropriate action.
<!-- md-toc-begin -->
* [Anti-Abuse](#anti-abuse)
* [Flood control](#flood-control)
* [Message flood](#message-flood)
* [Join flood](#join-flood)
* [Enter key abuse](#enter-key-abuse)
* [Nick flood](#nick-flood)
* [Anti-away/Nick-control](#anti-awaynick-control)
* [Anti-auto-rejoin control](#anti-auto-rejoin-control)
* [Opping/Deopping](#oppingdeopping)
* [Flood control](#flood-control)
* [Message flood](#message-flood)
* [Join flood](#join-flood)
* [Enter key abuse](#enter-key-abuse)
* [Nick flood](#nick-flood)
* [Anti-away/Nick-control](#anti-awaynick-control)
* [Anti-auto-rejoin control](#anti-auto-rejoin-control)
* [Opping/Deopping](#oppingdeopping)
<!-- md-toc-end -->
Flood control
=============
## 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.
Message flood
-------------
### Message flood
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
----------
### 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`.
@ -35,31 +30,26 @@ Any messages sent to the public channel by the user at any time will reset their
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`, otherwise you will be automatically unbanned in $timeout."
Enter key abuse
---------------
### 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."
Nick flood
----------
### 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."
Anti-away/Nick-control
======================
## Anti-away/Nick-control
PBot 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, PBot will kick the offender with a link to http://sackheads.org/~bnaylor/spew/away_msgs.html in the kick message.
Anti-auto-rejoin control
========================
## Anti-auto-rejoin control
PBot can detect if someone immediately auto-rejoins after having been kicked.
When such a case is detected, PBot 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.
Opping/Deopping
===============
## Opping/Deopping
ChanServ can op and deop PBot as necessary, unless the channel `permop` meta-data is set to a true value. PBot will wait until about 5 minutes have elapsed before requesting a deop from ChanServ. This timeout can be controlled via the `general.deop_timeout` registry value, which can be overriden on a per-channel basis.

View File

@ -1,66 +1,66 @@
# Factoids
<!-- md-toc-begin -->
* [About](#about)
* [Channel namespaces](#channel-namespaces)
* [Special commands](#special-commands)
* [/say](#say)
* [/me](#me)
* [/call](#call)
* [/msg](#msg)
* [/code](#code)
* [Supported languages](#supported-languages)
* [Special variables](#special-variables)
* [testargs example](#testargs-example)
* [Setting a usage message](#setting-a-usage-message)
* [poll/vote example](#pollvote-example)
* [SpongeBob Mock meme example](#spongebob-mock-meme-example)
* [Using command-piping](#using-command-piping)
* [Improving SpongeBob Mock meme](#improving-spongebob-mock-meme)
* [Formatting and editing lengthy Code Factoids](#formatting-and-editing-lengthy-code-factoids)
* [Special variables](#special-variables-1)
* [$args](#args)
* [$arg[n]](#argn)
* [$arg[n:m]](#argnm)
* [$arglen](#arglen)
* [$channel](#channel)
* [$nick](#nick)
* [$randomnick](#randomnick)
* [$0](#0)
* [List variables](#list-variables)
* [Expansion modifiers](#expansion-modifiers)
* [action_with_args](#action_with_args)
* [add_nick](#add_nick)
* [Adding a factoid](#adding-a-factoid)
* [factadd](#factadd)
* [Viewing/triggering a factoid](#viewingtriggering-a-factoid)
* [Viewing/triggering another channel's factoid](#viewingtriggering-another-channels-factoid)
* [fact](#fact)
* [Deleting a factoid](#deleting-a-factoid)
* [factrem](#factrem)
* [forget](#forget)
* [Aliasing a factoid](#aliasing-a-factoid)
* [factalias](#factalias)
* [Moving/renaming a factoid](#movingrenaming-a-factoid)
* [factmove](#factmove)
* [Changing a factoid](#changing-a-factoid)
* [factchange](#factchange)
* [factundo](#factundo)
* [factredo](#factredo)
* [Factoid Metadata](#factoid-metadata)
* [factset](#factset)
* [factunset](#factunset)
* [Factoid Metadata List](#factoid-metadata-list)
* [Finding a factoid](#finding-a-factoid)
* [factfind](#factfind)
* [Information about a factoid](#information-about-a-factoid)
* [factinfo](#factinfo)
* [factshow](#factshow)
* [factset](#factset-1)
* [factlog](#factlog)
* [count](#count)
* [histogram](#histogram)
* [top20](#top20)
* [About](#about)
* [Channel namespaces](#channel-namespaces)
* [Special commands](#special-commands)
* [/say](#say)
* [/me](#me)
* [/call](#call)
* [/msg](#msg)
* [/code](#code)
* [Supported languages](#supported-languages)
* [Special variables](#special-variables)
* [testargs example](#testargs-example)
* [Setting a usage message](#setting-a-usage-message)
* [poll/vote example](#pollvote-example)
* [SpongeBob Mock meme example](#spongebob-mock-meme-example)
* [Using command-piping](#using-command-piping)
* [Improving SpongeBob Mock meme](#improving-spongebob-mock-meme)
* [Formatting and editing lengthy Code Factoids](#formatting-and-editing-lengthy-code-factoids)
* [Special variables](#special-variables-1)
* [$args](#args)
* [$arg[n]](#argn)
* [$arg[n:m]](#argnm)
* [$arglen](#arglen)
* [$channel](#channel)
* [$nick](#nick)
* [$randomnick](#randomnick)
* [$0](#0)
* [List variables](#list-variables)
* [Expansion modifiers](#expansion-modifiers)
* [action_with_args](#action_with_args)
* [add_nick](#add_nick)
* [Adding a factoid](#adding-a-factoid)
* [factadd](#factadd)
* [Viewing/triggering a factoid](#viewingtriggering-a-factoid)
* [Viewing/triggering another channel's factoid](#viewingtriggering-another-channels-factoid)
* [fact](#fact)
* [Deleting a factoid](#deleting-a-factoid)
* [factrem](#factrem)
* [forget](#forget)
* [Aliasing a factoid](#aliasing-a-factoid)
* [factalias](#factalias)
* [Moving/renaming a factoid](#movingrenaming-a-factoid)
* [factmove](#factmove)
* [Changing a factoid](#changing-a-factoid)
* [factchange](#factchange)
* [factundo](#factundo)
* [factredo](#factredo)
* [Factoid Metadata](#factoid-metadata)
* [factset](#factset)
* [factunset](#factunset)
* [Factoid Metadata List](#factoid-metadata-list)
* [Finding a factoid](#finding-a-factoid)
* [factfind](#factfind)
* [Information about a factoid](#information-about-a-factoid)
* [factinfo](#factinfo)
* [factshow](#factshow)
* [factset](#factset-1)
* [factlog](#factlog)
* [count](#count)
* [histogram](#histogram)
* [top20](#top20)
<!-- md-toc-end -->
## About

View File

@ -1,80 +1,114 @@
Modules
-------
PBot has several external command-line modules. Here is the documentation for most of them.
# Modules
<!-- md-toc-begin -->
* [cc](#cc)
* [Usage](#usage)
* [Supported Languages](#supported-languages)
* [Default Language](#default-language)
* [Disallowed system calls](#disallowed-system-calls)
* [Program termination with no output](#program-termination-with-no-output)
* [Abnormal program termination](#abnormal-program-termination)
* [C and C++ Functionality](#c-and-c-functionality)
* [Using the preprocessor](#using-the-preprocessor)
* [Default #includes](#default-includes)
* [Using #include](#using-include)
* [Using #define](#using-define)
* [main() Function Unnecessary](#main-function-unnecessary)
* [Embedding Newlines](#embedding-newlines)
* [Printing in binary/base2](#printing-in-binarybase2)
* [Using the GDB debugger](#using-the-gdb-debugger)
* [print](#print)
* [ptype](#ptype)
* [watch](#watch)
* [trace](#trace)
* [gdb](#gdb)
* [Interactive Editing](#interactive-editing)
* [copy](#copy)
* [show](#show)
* [diff](#diff)
* [paste](#paste)
* [run](#run)
* [undo](#undo)
* [s//](#s)
* [replace](#replace)
* [prepend](#prepend)
* [append](#append)
* [remove](#remove)
* [Some Examples](#some-examples)
* [english](#english)
* [expand](#expand)
* [prec](#prec)
* [paren](#paren)
* [faq](#faq)
* [cfact](#cfact)
* [cjeopardy](#cjeopardy)
* [hint](#hint)
* [what](#what)
* [w](#w)
* [filter](#filter)
* [score](#score)
* [rank](#rank)
* [reset](#reset)
* [qstats](#qstats)
* [qshow](#qshow)
* [c99std](#c99std)
* [c11std](#c11std)
* [man](#man)
* [google](#google)
* [define](#define)
* [dict](#dict)
* [foldoc](#foldoc)
* [vera](#vera)
* [udict](#udict)
* [wdict](#wdict)
* [acronym](#acronym)
* [math](#math)
* [calc](#calc)
* [qalc](#qalc)
* [compliment](#compliment)
* [insult](#insult)
* [excuse](#excuse)
* [horoscope](#horoscope)
* [quote](#quote)
* [About](#about)
* [Creating modules](#creating-modules)
* [Documentation for built-in modules](#documentation-for-built-in-modules)
* [cc](#cc)
* [Usage](#usage)
* [Supported Languages](#supported-languages)
* [Default Language](#default-language)
* [Disallowed system calls](#disallowed-system-calls)
* [Program termination with no output](#program-termination-with-no-output)
* [Abnormal program termination](#abnormal-program-termination)
* [C and C++ Functionality](#c-and-c-functionality)
* [Using the preprocessor](#using-the-preprocessor)
* [Default #includes](#default-includes)
* [Using #include](#using-include)
* [Using #define](#using-define)
* [main() Function Unnecessary](#main-function-unnecessary)
* [Embedding Newlines](#embedding-newlines)
* [Printing in binary/base2](#printing-in-binarybase2)
* [Using the GDB debugger](#using-the-gdb-debugger)
* [print](#print)
* [ptype](#ptype)
* [watch](#watch)
* [trace](#trace)
* [gdb](#gdb)
* [Interactive Editing](#interactive-editing)
* [copy](#copy)
* [show](#show)
* [diff](#diff)
* [paste](#paste)
* [run](#run)
* [undo](#undo)
* [s//](#s)
* [replace](#replace)
* [prepend](#prepend)
* [append](#append)
* [remove](#remove)
* [Some Examples](#some-examples)
* [english](#english)
* [expand](#expand)
* [prec](#prec)
* [paren](#paren)
* [faq](#faq)
* [cfact](#cfact)
* [cjeopardy](#cjeopardy)
* [hint](#hint)
* [what](#what)
* [w](#w)
* [filter](#filter)
* [score](#score)
* [rank](#rank)
* [reset](#reset)
* [qstats](#qstats)
* [qshow](#qshow)
* [c99std](#c99std)
* [c11std](#c11std)
* [man](#man)
* [google](#google)
* [define](#define)
* [dict](#dict)
* [foldoc](#foldoc)
* [vera](#vera)
* [udict](#udict)
* [wdict](#wdict)
* [acronym](#acronym)
* [math](#math)
* [calc](#calc)
* [qalc](#qalc)
* [compliment](#compliment)
* [insult](#insult)
* [excuse](#excuse)
* [horoscope](#horoscope)
* [quote](#quote)
<!-- md-toc-end -->
## About
Modules are external command-line executable programs and scripts that can be
loaded via PBot Factoids.
## Creating modules
Suppose you have the [Qalculate!](https://qalculate.github.io/) command-line
program and you want to provide a PBot command for it. You can create a _very_ simple
shell script containing:
#!/bin/sh
qalc "$*"
And let's call it `qalc.sh` and put it in PBot's `modules/` directory.
Then you can add the `qalc` factoid:
!factadd global qalc qalc.sh
And then set its `type` to `module`:
!factset global qalc type module
Alternatively, you can simply use the [`load`](Admin.md#load) command:
!load qalc qalc.sh
Now you have a `qalc` calculator in PBot!
<pragma-> !qalc 2 * 2
<PBot> 2 * 2 = 4
## Documentation for built-in modules
PBot comes several command-line modules included. Here is the documentation for most of them.
### 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.

View File

@ -1,37 +1,35 @@
QuickStart
==========
# QuickStart
<!-- md-toc-begin -->
* [Installation](#installation)
* [Installing Perl](#installing-perl)
* [Installing CPAN modules](#installing-cpan-modules)
* [Installing PBot](#installing-pbot)
* [git (recommended)](#git-recommended)
* [Download zip archive](#download-zip-archive)
* [First-time Configuration](#first-time-configuration)
* [Clone data-directory](#clone-data-directory)
* [Quick-start command](#quick-start-command)
* [Edit Registry](#edit-registry)
* [Recommended settings for IRC Networks](#recommended-settings-for-irc-networks)
* [Freenode](#freenode)
* [IRCnet](#ircnet)
* [Other networks](#other-networks)
* [Starting PBot](#starting-pbot)
* [Usage](#usage)
* [Overriding directories](#overriding-directories)
* [Overriding registry](#overriding-registry)
* [Additional Configuration](#additional-configuration)
* [Adding Channels](#adding-channels)
* [Adding Admins](#adding-admins)
* [Loading Plugins](#loading-plugins)
* [Further Reading](#further-reading)
* [Commands](#commands)
* [Factoids](#factoids)
* [Modules](#modules)
* [Installation](#installation)
* [Installing Perl](#installing-perl)
* [Installing CPAN modules](#installing-cpan-modules)
* [Installing PBot](#installing-pbot)
* [git (recommended)](#git-recommended)
* [Download zip archive](#download-zip-archive)
* [First-time Configuration](#first-time-configuration)
* [Clone data-directory](#clone-data-directory)
* [Quick-start command](#quick-start-command)
* [Edit Registry](#edit-registry)
* [Recommended settings for IRC Networks](#recommended-settings-for-irc-networks)
* [Freenode](#freenode)
* [IRCnet](#ircnet)
* [Other networks](#other-networks)
* [Starting PBot](#starting-pbot)
* [Usage](#usage)
* [Overriding directories](#overriding-directories)
* [Overriding registry](#overriding-registry)
* [Additional Configuration](#additional-configuration)
* [Adding Channels](#adding-channels)
* [Adding Admins](#adding-admins)
* [Loading Plugins](#loading-plugins)
* [Further Reading](#further-reading)
* [Commands](#commands)
* [Factoids](#factoids)
* [Modules](#modules)
<!-- md-toc-end -->
Installation
------------
## Installation
### Installing Perl
@ -70,8 +68,7 @@ The command to install with `git` is:
Alternatively, you may [download a ZIP archive](https://github.com/pragma-/pbot/archive/master.zip).
First-time Configuration
------------------------
## First-time Configuration
After git-cloning (or unpacking the ZIP archive) you should have a directory named
`pbot/` (or `pbot-master/`). It should contain at least these directories and files:
@ -173,8 +170,7 @@ Other networks are untested. They should be very similiar to either Freenode or
recommended settings should suffice. If you have any issues, please [report them here](https://github.com/pragma-/pbot/issues)
or in the `#pbot2` channel on the Freenode network.
Starting PBot
-------------
## Starting PBot
### Usage
@ -193,8 +189,7 @@ saved to the `registry` file. You do not need to use the override every time you
$ pbot irc.botnick=coolbot irc.server=irc.freenode.net irc.port=6667
Additional Configuration
------------------------
## Additional Configuration
Once you have launched PBot, you can type into the STDIN to execute commands within
the bot. Alternatively you can launch your own IRC client and `/msg` PBot.
@ -268,8 +263,7 @@ Currently loaded plugins may be listed with the `pluglist` command.
For more information, see the [Plugins documentation](Plugins.md).
Further Reading
---------------
## Further Reading
That should get you started. For further information about PBot, check out these topics.

View File

@ -1,15 +1,19 @@
Quotegrabs
----------
PBot can grab user messages and store/recall them for posterity.
# Quotegrabs
<!-- md-toc-begin -->
* [grab](#grab)
* [getq](#getq)
* [rq](#rq)
* [delq](#delq)
* [About](#about)
* [Commands](#commands)
* [grab](#grab)
* [getq](#getq)
* [rq](#rq)
* [delq](#delq)
<!-- md-toc-end -->
## About
PBot can grab user messages and store/recall them for posterity. This document
describes the Quotegrabs plugin.
## Commands
### 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).

View File

@ -1,5 +1,4 @@
Registry
========
# Registry
<!-- md-toc-begin -->
* [About](#about)