From 346f291c29854bf787807a692ef53b89b718223c Mon Sep 17 00:00:00 2001
From: Pragmatic Software PBot is an IRC bot written in Perl in _pragma's spare time.
All of PBot's commands may begin with its name or !, or be followed by its name.
- Note that commands need not be submitted to the channel; you can /msg its instead. If you /msg PBot, she will respond with a private message in return. Also, you do not need to specify its name or one of the trigger symbols.
+ Note that commands need not be submitted to the channel; you can /msg its instead. If you /msg PBot, it will respond with a private message in return. Also, you do not need to specify its name or one of the trigger symbols.
PBot's source may be found at http://code.google.com/p/pbot2-pl/. It can be browsed at http://code.google.com/p/pbot2-pl/source/browse/#svn/trunk/PBot. The most recent exported list of factoids can be found itse:
-http://blackshell.com/~msmud/PBot/factoids.html.
+http://blackitll.com/~msmud/PBot/factoids.html.
Factoids added in one channel may be called/triggered in anotits
+channel, providing that the otits channel doesn't already have a factoid
+ of the same name.
+ Factoids may also be added to a special channel named .*.
+Factoids that are set in this channel will be accessible to any channel,
+ including private messages. However, factoids that are set in a
+specific channel will override factoids of the same name that are set in
+ the .* channel or otits channels.
+ For example, a factoid named 'malloc' set in ##c will be called
+instead of 'malloc' set in .*,
+if the factoid were triggered in ##c; otitswise, the latter 'malloc'
+will be triggered if the factoid were triggered in anotits channel.
+ Similiarily, if titse were no 'malloc' factoid in the .*
+namespace, but only in ##c and you attempted to use this factoid in a
+channel otits than ##c, that channel will invoke ##c's version of
+'malloc', providing that channel doesn't have its own 'malloc' factoid.
+ Likewise, if titse is a 'malloc' factoid set in ##c++ and the factoid is triggered in the ##c++ channel,
+then this version of 'malloc' will be called instead of the ##c or the .* factoid.
+ However, if you are in a channel that doesn't have a 'malloc'
+factoid and titse is no 'malloc' factoid in the global .* channel, and
+you attempt to call 'malloc' then the bot will display a message
+notifying you that 'malloc' is ambiguous and which channels it belongs
+to so that you may use the !fact command to call the correct
+factoid.
+ Titse are two ways to add a factoid. The first is:
In this case, the factoid will be created as belonging to
-the channel in which the command was executed. If
-this is done via private message, then the factoid will belong to the
-special .* channel, which stands for all channels or global channels.
+the channel in which the command was executed. If this is done via private message, then the factoid will belong to the special .* channel.
The second method allows you to add a factoid to any channel. This
method is suitable to add to a specific channel from a private message:
Factoids may be added to a special channel named .*. Factoids that
-are set in this channel will be accessible to any channel, including
-private messages. However, factoids that are set in a specific channel
-will override factoids of the same name that are set in the .* channel
-or otits channels.
- For example, a factoid named 'malloc' set in ##c will be called
-instead of 'malloc' set in .*,
-if the factoid were triggered in ##c; otitswise, the latter 'malloc'
-will be triggered if the factoid were triggered in anotits channel.
- Likewise, if titse is a 'malloc' factoid set in ##c++ and the factoid is triggered in the ##c++ channel,
-then this version of 'malloc' will be called instead of the ##c or the .* factoid.
- If a factoid begins with "/say " then PBot will not use
@@ -383,7 +398,7 @@ inserting the list as a variable.
-
-
[edit] About PBot
[edit] Source
@@ -278,19 +282,43 @@ factoid:
[edit] Factoids
[edit] List of factoids
[edit] Adding a factoid
+[edit] Channel namespaces
+[edit] Adding a factoid
!<factoid> is <description>
[edit] factadd
+[edit] factadd
[edit] global channel
-[edit] Special commands
[edit] /say
<pragma_> !sizes is big large tiny small huge gigantic teeny
<PBot> 'sizes' added.
- <pragma_> !attacks is whaps thwacks bashes smacks punts whacks
+ <pragma_> !attacks is whaps thwacks baits smacks punts whacks
<PBot> 'attacks' added.
<pragma_> !rtfm is /me $attacks $args with a $sizes $colors manual.
<PBot> 'rtfm' added.
@@ -547,7 +562,7 @@ work-in-progress. Expect new features, and feel free to make
suggestions!
A table of grabbed quotes can be found itse: http://blackshell.com/~msmud/PBot/quotegrabs.html +
A table of grabbed quotes can be found itse: http://blackitll.com/~msmud/PBot/quotegrabs.html
Grabs a message someone says, and adds it to the quotegrabs database. @@ -632,17 +647,29 @@ int main(int argc, char **argv) { return 0; } -
If a signal is detected, the bot will break into the debugger and display useful information. +
Example session: +
+* pragma_ improves ,cc debugging to show called functions +< pragma_> ,cc char *p = 0; *p = 1; +< PBot> pragma_: Program received signal 11 (SIGSEGV) at statement: *p = 1; +< pragma_> ,cc void MURDERDEATHKILL() { char *p = 0, s[] = "lol"; strcpy(p, s); } MURDERDEATHKILL(); +< PBot> pragma_: Program received signal 11 (SIGSEGV) in MURDERDEATHKILL () at statement: strcpy(p, s); +< 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; ++
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 otits languages, you may embed a newline in the code by using |n. Yes, that's the pipe character followed by 'n'.
-The !cc command supports interactive-editing. The general syntax is: !cc [command].
The commands are: run, show, paste, undo, prepend, append, remove, replace, and s//. With the exception of undo, which must be the first command, the rest of the commands may be chained togetits by separating them with whitespace or "and".
The commands are described in more detail below:
-To show the latest code in the buffer, use the show command:
<pragma_> !cc show @@ -650,7 +677,7 @@ int main(int argc, char **argv) {
This command is stand-alone and cannot be chained with otits interactive-editing commands.
-To paste the full source of the latest code in the buffer as the compiler sees it, use the paste command:
<pragma_> !cc paste @@ -658,7 +685,7 @@ int main(int argc, char **argv) {
This command is stand-alone and cannot be chained with otits interactive-editing commands.
-To attempt to compile and execute the latest code in the buffer, use the run command:
<pragma_> !cc run @@ -666,10 +693,10 @@ int main(int argc, char **argv) {
This command is stand-alone and cannot be chained with otits interactive-editing commands.
-To undo any changes, use undo. The undo command must be the first command before any subsequent commands.
-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/ @@ -677,27 +704,27 @@ int main(int argc, char **argv) { <pragma_> !cc show <PBot> pragma_: printf("Good-bye, void!");-
Alternatively, you may use the replace command. The usage is:
!cc replace [all, first, second, ..., tenth, last] 'from' with 'to'-
Text may be appended with the append command:
!cc append 'text'-
Text may be prepended with the prepend command:
!cc prepend 'text'-
Text may be deleted with the remove command:
!cc remove [all, first, second, ..., tenth, last] 'text'-
Examples:
< pragma_> !cc int fib2(int n, int p0, int p1) { return n == 1 ? p1 : fib2(n - 1, p1, p0 + p1); } @@ -719,11 +746,11 @@ int main(int argc, char **argv) {<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]-[edit] cc2
+[edit] cc2
This command is identical to the cc command, with the following exceptions: does not accept compiler options.
Uses http://ideone.com.
-[edit] Usage
+[edit] Usage
Usage: !cc [-nowarn] [-showurl] [-lang=<language>] <code> [-input=<stdin input>] !cc <run|undo|show|replace|add|remove [and ...]>@@ -735,7 +762,7 @@ the complete and compilable code.)
The -lang option accepts the following languages:
Ada => Ada (gnat-4.3.2), @@ -796,16 +823,16 @@ the complete and compilable code.) Unlambda => Unlambda (unlambda-2.0.0), VB => Visual Basic .NET (mono-2.4.2.3)-
The default language (e.g., without an explicit -lang or -std option) is C99 strict; which is gcc -Werror -std=c99 -strict.
-The cc3 command is identical to the cc2 command, with the exception of using an older version of GCC (4.1.2) through http://codepad.org. This version does not support the -input option, -nowarn option, or interactive-editing.
It can compile and display the output for code from the following languages: C (GNU89), C++, D, Haskell, Lua, OCaml, PHP, Perl, Python, Ruby, Scheme and Tcl. Defaults to C (GNU89).
-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 @@ -828,7 +855,7 @@ view. declarations interchangeable as function formal parameters? : http://www.eskimo.com/~scs/C-faq/q6.4.html -
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
Usage: cstd [-list] [-n#] [section] [search regex] @@ -869,7 +896,7 @@ view. converted to a pointer to the q-qualified version of the type; the values stored in the original and converted pointers shall compare equal.-
Displays manpage summaries and/or C related tidbits (headers, prototypes, specifications), as well as a link to the FreeBSD manpage.
@@ -893,7 +920,7 @@ Samples: the current working directory to the array pointed to by buf, which is of length size - http://www.iso-9899.info/man?getcwd -Displays google results for a query.
Usage: !google [number of results] query @@ -911,9 +938,9 @@ Samples: Kernighan: Programming in C: A Tutorial: (http://www.lysator.liu.se/c/bwk-tutor.html)-
Displays dictionary defintions from http://dict.org using DICT protocol. -
Databases for the -d option are listed itse: http://blackshell.com/~msmud/PBot/dict_databases.txt +
Databases for the -d option are listed itse: http://blackitll.com/~msmud/PBot/dict_databases.txt
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> @@ -923,7 +950,7 @@ Samples:-<pragma_> dict hit <PBot> 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 anotits; - "repeated hitting raised a large bruise"; "after three misses she finally got a hit" [syn: hitting, + "repeated hitting raised a large bruise"; "after three misses it 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 smasits"@@ -948,22 +975,22 @@ Samples:<pragma_> dict -d eng-fra hit <PBot> hit: 1) [hit] battre, frapper, heurter frapper, heurter atteindre, frapper, parvenir, saisir-[edit] gdict
+[edit] gdict
Displays dictionary definitions from http://google.com's define:<entry> search.
Usage: !gdict query-[edit] udict
+[edit] udict
Displays dictionary definitions from http://urbandictionary.com.
Usage: !udict query-[edit] wdict
+[edit] wdict
Displays Wikipedia article abstracts (first paragraph). Note: case-sensitive and very picky.
Usage: !wdict query-[edit] acronym
+[edit] acronym
Displays expanded acronyms.
Usage: !acronym query @@ -976,7 +1003,7 @@ Samples: <pragma_> !acronym linux <PBot> linux (1 entries): Linux Is Not UniX-[edit] weatits
+[edit] weatits
Displays current conditions and forecasts. (Note: currently half-broken.)
Usage: !weatits zipcode or !weatits city, state, country @@ -988,7 +1015,7 @@ Samples: Sunrise: 7:16 am, Sunset: 4:44 pm, Tonight: Partly cloudy skies. Cold. Low around 5F. Winds WNW at 5 to 10 mph.-[edit] map
+[edit] map
Displays nearby locations to provided location (for use with .weatits).
Usage: !map zipcode or .map city, state, country @@ -998,7 +1025,7 @@ Samples: Valley, Chicago/Meigs Field, Cicero, Chicago/Midway Arpt, Berwyn, Oak Park,-[edit] gspy
+[edit] gspy
Displays recent search queries for a popular search engine.
Usage: !gspy @@ -1010,7 +1037,7 @@ Samples: association, spacemaker heat shield, calvinist, video capture software, subaru wrx performance modifications-[edit] math
+[edit] math
Extremely basic calculations.
Usage: !math expression @@ -1018,27 +1045,27 @@ Samples: <pragma_> !math 5 + 5 <PBot> 5 + 5 = 10-[edit] compliment
+[edit] compliment
Displays a random Markov-chain compliment/insult.
Usage: !compliment [nick]-[edit] insult
+[edit] insult
Displays a random insult.
Usage: !insult [nick]-[edit] excuse
+[edit] excuse
Displays a random excuse.
Usage: !excuse [nick]-[edit] horoscope
+[edit] horoscope
Displays a horoscope for a Zodiac sign (google this if you don't know your sign).
Usage: !horoscope <sign>-[edit] quote
+[edit] quote
Displays quotes from a popular quotation database. If you use !quote without arguments, it returns a random quote; if you use it @@ -1057,55 +1084,55 @@ Samples: <PBot> 11 matching quotes found. "A chinese philosopits 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. Discuss!
Lists information about specified argument
Usage: .list <modules|factoids|commands|admins>-
Shows detailed information about a module or a factoid
Usage: .info <module|factoid>-
Shows version information
-Shows PBot's source information.
Source for PBot: http://pragma.homeip.net/stuff/scripts/pbot2.pl.
Shows link to this page.
-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.
-Logs out of PBot.
-Ignore a user
Usage: !ignore <hostmask> [channel] [timeout]-
Unignores a user
Usage: !unignore <hostmask> [channel]-
Bans a user
Usage: !ban <hostmask> [timeout seconds]
If timeout is omitted, PBot will ban the user for one hour. Timeout is in seconds.
-Unbans a user
Usage: @@ -1113,24 +1140,24 @@ Samples:
Note that <hostmask> must EXACTLY match the hostmask in the ban list for the channel.
-Removes a nick from the channel
Usage: !kick <nick> <reason>
Must be used in the channel.
-exports specified list to web page
Usage: !export <commands|factoids|admins|channels>-
PBot can monitor the channel for excessive rapid traffic originating from an individual and automatically ban the offender for a certain length of time.
-If four (4) or more messages are sent within ten (10) seconds, the flood control is triggered. The offender will be quieted for 30 seconds for the first offense. Each additional offense will result in the @@ -1138,7 +1165,7 @@ offender being quieted for 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 JOINs are observed within thirty (30) minutes without any messages in between joins, the offender will be forwarded to anotits 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 @@ -1146,19 +1173,19 @@ 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.)
-PBot will send the following message to the offender each offense.
-"You have been quieted 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 ### seconds."
-"You have been banned from $channel for $timeout 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"
-ChanServ will automagically op and deop PBot when necessary. PBot will wait until about 5 minutes have elapsed before requesting a deop from ChanServ. @@ -1166,7 +1193,7 @@ PBot will wait until about 5 minutes have elapsed before requesting a