[[project @ 2004-06-13 02:03:43 by unknown_lamer] unknown_lamer**20040613020344 Wrote most of the configuration section of the manual and implemented bot:ctcp-quote in bobot-utils.scm ] { hunk ./ChangeLog 1 +2004-06-12 Clinton Ebadi + + * scripts/bobot-utils.scm (ctcp-quote): Implemented ctcp-quote + +2004-05-28 Clinton Ebadi + + * bobot++.texinfo (bot.conf): Finished section + (server syntax): New section, documents the bot.conf SERVER syntax + (channel syntax): New section, documentes the bot.conf CHANNEL syntax + +2004-05-13 Clinton Ebadi + + * source/Main.C (real_main): std::exit instead of exit + hunk ./NEWS 13 +Version 2.1.5: Manual Stuff +- The Bot Configuration section of the manual has been completed. + hunk ./NEWS 101 - default config is either dir. You may also specify a specific config + default config in either dir. You may also specify a specific config hunk ./TODO 1 -2.2 will be released when most of these are done +2.2: +* Finish adding commands to Scheme for sending messages + (e.g. bot:send-CTCP to send a CTCP message) +* Add util functions for doing stuff like quoting CTCP messages +* Finish adding hooks/send hooks +* Write Texinfo manual +* DCC CHAT min user level +* Configuration Database +* Improve the help syst +* DCC FILE support (sending and recieving) +* XDCC file server script (requires DCC FILE support) hunk ./TODO 13 +2.4/3.0 (2.4 iff backwards compatibility is maintained, 3.0 otherwise): hunk ./TODO 15 -* Make String operator >> act like all other >>'s, and add getline? +* Eliminate String class hunk ./TODO 29 -* Finish adding commands to Scheme for sending messages - (e.g. bot:send-CTCP to send a CTCP message) -* Add util functions for doing stuff like quoting CTCP messages -* Finish adding hooks/send hooks hunk ./TODO 33 - support to be done easily + support to be done easily hunk ./TODO 40 -* DCC FILE support (this can be done as a script if a few changes are - made to the DCC support) - -Documentation: -* Work on Texinfo manual (especially scripting section) hunk ./TODO 41 -Other (post 2.2 release): +Definitely 3.0: hunk ./TODO 55 - implement that. + implement those. hunk ./aclocal.m4 1 -# generated automatically by aclocal 1.7.6 -*- Autoconf -*- +# generated automatically by aclocal 1.7.9 -*- Autoconf -*- hunk ./aclocal.m4 438 - [AM_AUTOMAKE_VERSION([1.7.6])]) + [AM_AUTOMAKE_VERSION([1.7.9])]) hunk ./bobot++.info 7 - Copyright 2002 Clinton Ebadi + Copyright 2002,2004 Clinton Ebadi hunk ./bobot++.info 21 - This document applies to version 2.1.0 of the program named Bobot++ + This document applies to version 2.1.5 of the program named Bobot++ hunk ./bobot++.info 23 - Copyright 2002 Clinton Ebadi + Copyright 2002,2004 Clinton Ebadi hunk ./bobot++.info 41 + --- The Detailed Node Listing --- + +Configuration + +* Configuration Files:: +* Configuration File Placement:: + +Configuration Files + +* bot.conf:: + +bot.conf + +* server syntax:: +* channel syntax:: + +Using Bobot++ + +* User Levels:: + +Scripting + +* Adding New Commands:: +* Hooks:: +* Scheme User Levels:: +* Sending Messages:: +* Misc Scripting Stuff:: + +Hooks + +* Creating a Hook:: +* Hook Types:: + +Sending Messages + +* High Level Message Functions:: +* Low Level Message Functions:: + hunk ./bobot++.info 99 -* Configuration File Syntax:: -* Configure File Placement:: +* Configuration Files:: +* Configuration File Placement:: hunk ./bobot++.info 103 -File: bobot++.info, Node: Configuration File Syntax, Next: Configure File Placement, Prev: Configuration, Up: Configuration +File: bobot++.info, Node: Configuration Files, Next: Configuration File Placement, Prev: Configuration, Up: Configuration hunk ./bobot++.info 105 -Configuration File Syntax -========================= +Configuration Files +=================== hunk ./bobot++.info 113 -File: bobot++.info, Node: bot.conf, Prev: Configuration File Syntax, Up: Configuration File Syntax +File: bobot++.info, Node: bot.conf, Prev: Configuration Files, Up: Configuration Files hunk ./bobot++.info 118 -bot.conf is the main configuration file for a Bobot++. The available +`bot.conf' contains key value pairs separated by `='. + + ` = ' + + Comments are started with a `#' and cause the entire line to be +ignored. _Note that this only works when the `#' is the first character +of the line_. + + bot.conf is the main configuration file for a Bobot++. The available hunk ./bobot++.info 145 - * LOGFILE <$LOGDIR/bot.log>: + * LOGFILE <$LOGDIR/bot.log>: Location of the bot logfile (set this + to `/dev/null' to disable logging). + + * SERVER : This specifies the server to connect to. Note that + this has a special syntax. + + * CHANNEL : This specifies a channel the bot will join when it + starts up. This also has a special syntax. + + +* Menu: + +* server syntax:: +* channel syntax:: + + +File: bobot++.info, Node: server syntax, Next: channel syntax, Prev: bot.conf, Up: bot.conf + +server syntax +............. + +SERVER = SERVER_NAME [PORT [PASSWORD]] + + This will make Bobot++ attempt to connect to SERVER_NAME on port +PORT with the password PASSWORD. SERVER_NAME should be the address of +the server. PORT and PASSWORD are optional. You may use more than one +server line; Bobot++ will attempt to connect to the first one and, if +it fails, will connect to the next one in the list. There is also a +command to cause the bot to cycle servers. At the present time Bobot++ +cannot connect to more than one server at a time. This is a planned +feature of 3.0 (which is a very long way away; the current structure of +the program would make it very difficult to add support for connecting +to multiple servers at a time in a usable manner). + + +File: bobot++.info, Node: channel syntax, Prev: server syntax, Up: bot.conf + +channel syntax +.............. + +CHANNEL = NAME:INITIAL_MODES:MODES_TO_KEEP:CHANNEL_KEY + + You may have any number of channel lines. When Bobot++ starts it will +attempt to join and gain ops in every channel listed. It will join NAME +and set the channel modes to INITIAL_MODES (e.g. "nt") if it is able to +gain operator status. It will then maintain MODES_TO_KEEP. If the +channel requires a key to enter simply set CHANNEL_KEY. Every argument +except for NAME is optional. + + A few example lines: + + `CHANNEL = #foo:nt:nt:bar' + + The bot will join `#foo' with the channel key `bar' and will then +maintain the modes `nt'. + + `CHANNEL = #bar:::' hunk ./bobot++.info 203 + The bot will join `#bar' and will not set any modes nor will it +attempt to maintain any modes. hunk ./bobot++.info 207 -File: bobot++.info, Node: Configure File Placement, Prev: Configuration File Syntax, Up: Configuration +File: bobot++.info, Node: Configuration File Placement, Prev: Configuration Files, Up: Configuration hunk ./bobot++.info 215 -you want to have your own personal configration, put it in +you want to have your own personal configuration, put it in hunk ./bobot++.info 656 -Node: Top517 -Node: Introduction1246 -Node: Configuration1434 -Node: Configuration File Syntax1817 -Node: bot.conf2024 -Node: Configure File Placement2856 -Node: Using the Bot3327 -Node: User Levels3498 -Node: Scripting4499 -Node: Adding New Commands5404 -Node: Hooks6668 -Node: Creating a Hook7639 -Node: Hook Types8775 -Node: Scheme User Levels12246 -Node: Sending Messages13372 -Node: High Level Message Functions13980 -Node: Low Level Message Functions14191 -Node: Misc Scripting Stuff14941 -Node: Concept Index15357 -Node: Function Index15539 -Node: Variable Index15800 +Node: Top522 +Node: Introduction1722 +Node: Configuration1910 +Node: Configuration Files2291 +Node: bot.conf2484 +Node: server syntax3889 +Node: channel syntax4737 +Node: Configuration File Placement5564 +Node: Using the Bot6034 +Node: User Levels6205 +Node: Scripting7206 +Node: Adding New Commands8111 +Node: Hooks9375 +Node: Creating a Hook10346 +Node: Hook Types11482 +Node: Scheme User Levels14953 +Node: Sending Messages16079 +Node: High Level Message Functions16687 +Node: Low Level Message Functions16898 +Node: Misc Scripting Stuff17648 +Node: Concept Index18064 +Node: Function Index18246 +Node: Variable Index18507 hunk ./bobot++.texinfo 12 -Copyright 2002 Clinton Ebadi +Copyright 2002,2004 Clinton Ebadi hunk ./bobot++.texinfo 28 -Copyright @copyright{} 2002 Clinton Ebadi +Copyright @copyright{} 2002,2004 Clinton Ebadi hunk ./bobot++.texinfo 45 -This document applies to version 2.1.0 of the program named +This document applies to version 2.1.5 of the program named hunk ./bobot++.texinfo 48 -Copyright 2002 Clinton Ebadi +Copyright 2002,2004 Clinton Ebadi hunk ./bobot++.texinfo 65 + +@detailmenu + --- The Detailed Node Listing --- + +Configuration + +* Configuration Files:: +* Configuration File Placement:: + +Configuration Files + +* bot.conf:: + +bot.conf + +* server syntax:: +* channel syntax:: + +Using Bobot++ + +* User Levels:: + +Scripting + +* Adding New Commands:: +* Hooks:: +* Scheme User Levels:: +* Sending Messages:: +* Misc Scripting Stuff:: + +Hooks + +* Creating a Hook:: +* Hook Types:: + +Sending Messages + +* High Level Message Functions:: +* Low Level Message Functions:: + +@end detailmenu hunk ./bobot++.texinfo 122 -* Configuration File Syntax:: -* Configure File Placement:: +* Configuration Files:: +* Configuration File Placement:: hunk ./bobot++.texinfo 126 -@node Configuration File Syntax, Configure File Placement, Configuration, Configuration -@section Configuration File Syntax +@node Configuration Files, Configuration File Placement, Configuration, Configuration +@section Configuration Files hunk ./bobot++.texinfo 133 -@node bot.conf, , Configuration File Syntax, Configuration File Syntax +@node bot.conf, , Configuration Files, Configuration Files hunk ./bobot++.texinfo 136 +@file{bot.conf} contains key value pairs separated by @code{=}. + +@code{ = } + +Comments are started with a @code{#} and cause the entire line to be +ignored. @emph{Note that this only works when the @code{#} is the first +character of the line}. + hunk ./bobot++.texinfo 161 -@item @var{logfile} <$LOGDIR/bot.log>: +@item @var{logfile} <$LOGDIR/bot.log>: Location of the bot logfile +(set this to @file{/dev/null} to disable logging). +@item @var{server} : This specifies the server to connect +to. Note that this has a special syntax. +@item @var{channel} : This specifies a channel the bot will join +when it starts up. This also has a special syntax. hunk ./bobot++.texinfo 170 -@node Configure File Placement, , Configuration File Syntax, Configuration +@menu +* server syntax:: +* channel syntax:: +@end menu + +@node server syntax, channel syntax, bot.conf, bot.conf +@subsubsection server syntax + +@var{server} = @var{server_name} [@var{port} [@var{password}]] + +This will make Bobot++ attempt to connect to @var{server_name} on port +@var{port} with the password @var{password}. @var{server_name} should +be the address of the server. @var{port} and @var{password} are +optional. You may use more than one server line; Bobot++ will attempt +to connect to the first one and, if it fails, will connect to the next +one in the list. There is also a command to cause the bot to cycle +servers. At the present time Bobot++ cannot connect to more than one +server at a time. This is a planned feature of 3.0 (which is a very +long way away; the current structure of the program would make it very +difficult to add support for connecting to multiple servers at a time +in a usable manner). + +@node channel syntax, , server syntax, bot.conf +@subsubsection channel syntax + +@var{channel} = +@var{name}:@var{initial_modes}:@var{modes_to_keep}:@var{channel_key} + +You may have any number of channel lines. When Bobot++ starts it will +attempt to join and gain ops in every channel listed. It will join +@var{name} and set the channel modes to @var{initial_modes} +(e.g. ``nt'') if it is able to gain operator status. It will then +maintain @var{modes_to_keep}. If the channel requires a key to enter +simply set @var{channel_key}. Every argument except for @var{name} is +optional. + +A few example lines: + +@code{@var{channel} = #foo:nt:nt:bar} + +The bot will join @code{#foo} with the channel key @code{bar} and will +then maintain the modes @code{nt}. + +@code{@var{channel} = #bar:::} + +The bot will join @code{#bar} and will not set any modes nor will it +attempt to maintain any modes. + +@node Configuration File Placement, , Configuration Files, Configuration hunk ./bobot++.texinfo 224 -not root or you want to have your own personal configration, put it in +not root or you want to have your own personal configuration, put it in hunk ./configure.ac 4 -AC_INIT([Bobot++], [2.1.4CVS], [clinton@unknownlamer.org], [bobotpp]) +AC_INIT([Bobot++], [2.1.5CVS], [clinton@unknownlamer.org], [bobotpp]) hunk ./scripts/bobot-utils.scm 12 +(use-modules (srfi srfi-13)) + hunk ./scripts/bobot-utils.scm 20 -;;; bot-log: Write as many messages as you want to the log. If the +;;; bot:log: Write as many messages as you want to the log. If the hunk ./scripts/bobot-utils.scm 29 - messages ) + messages) hunk ./scripts/bobot-utils.scm 98 -;;; returns the CTCP quoted message +;;; Returns the CTCP quoted message +;;; Input _MUST NOT_ contain the trailing \r\n +;;; (it is added by the message sending code) hunk ./scripts/bobot-utils.scm 102 - message) ; FIXME: fill me in + ;; TODO: Not very efficient, it may be worth reimplementing + (let ((ls (string->list message))) + (string-concatenate + (map (lambda (chr) ; CTCP level quoting + (case (char->integer chr) + ((#o134) (string (integer->char #o134) (integer->char #o134))) + ((#o01) (string (integer->char #o134) #\a)) ; X-DELIM + (else (string chr)))) + (string->list + (string-concatenate + (map (lambda (chr) ; Low-level + (let ((m-quote (integer->char #o20))) + (case chr + ((m-quote) (string m-quote m-quote)) + ((#\nul) (string m-quote #\0)) + ((#\nl) (string m-quote #\n)) + ((#\cr) (string m-quote #\r)) + (else (string chr))))) + ls))))))) + + hunk ./scripts/bobot-utils.scm 126 -;;; and will be removed in the 2.3 dev tree +;;; and will be removed in the 3.0 release hunk ./source/DCCManager.C 25 - cnx->get_bot()->logLine (temp); hunk ./source/Main.C 178 - exit(1); + std::exit(1); hunk ./source/Main.C 244 -int main(int argc, char **argv) { +int main(int argc, char **argv) +{ }