Wrote most of the configuration section of the manual and implemented bot:ctcp-quote in bobot-utils.scm
+2004-06-12 Clinton Ebadi <clinton@unknownlamer.org>
+
+ * scripts/bobot-utils.scm (ctcp-quote): Implemented ctcp-quote
+
+2004-05-28 Clinton Ebadi <clinton@unknownlamer.org>
+
+ * 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 <clinton@unknownlamer.org>
+
+ * source/Main.C (real_main): std::exit instead of exit
+
2004-05-12 Clinton Ebadi <clinton@unknownlamer.org>
* source/DCCConnection.C (DCCConnection): Intialized `nuh' in the
====== The News =====================================================
=====================================================================
+Version 2.1.5: Manual Stuff
+- The Bot Configuration section of the manual has been completed.
+
Version 2.1.4: DCC Support Enhancements
- Internal Change: DCCConnection is now an abstract class
- Internal Change: DCCChatConnection provides the functionality of
before non-fallthrough hooks.
- The default config is read from ~/.bobotpp/config/default/ or
/etc/bobotpp/default/ if the user config is not found. Put your
- default config is either dir. You may also specify a specific config
+ default config in either dir. You may also specify a specific config
under these dirs using the --config or -c arg to bobotpp (see
bobotpp --help for the full list of commands you may use and how to
use them).
-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)
+2.4/3.0 (2.4 iff backwards compatibility is maintained, 3.0 otherwise):
General:
-* Make String operator >> act like all other >>'s, and add getline?
+* Eliminate String class
* Finish converting UserCommands to use Commands
* Audit code and see what data in classes should be made private and
have getters/setters added (e.g. logFileName in Bot--if this is
- At least allow all hooks of a type with the same name field to be
deleted at once (also all hooks with the same name). Also allow
deleting based on the regexp
-* 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
Networking:
* Add a networked interface to guile repl
- This can be done as a script, but requires non-coop threads
- support to be done easily
+ support to be done easily
- Admins only
- Telnet
- Store authorized users and passwords in bot.telnet file
- Bot master can add new telnet users
- MUST HAVE PASSWORD
- Maybe use SSL?
-* 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)
-Other (post 2.2 release):
+Definitely 3.0:
* Remove gh_* when Guile 1.8 is released
* Make it possible to use Scheme functions in the Parser itself
* Replace large select-loop in Bot::waitForInput with multithreaded
- To clarify: There will be one thread for DCCs and another thread
for the current irc server connection, each with its own select
loop. There may also be a thread for the network repls if I
- implement that.
\ No newline at end of file
+ implement those.
\ No newline at end of file
-# generated automatically by aclocal 1.7.6 -*- Autoconf -*-
+# generated automatically by aclocal 1.7.9 -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
# Free Software Foundation, Inc.
# Call AM_AUTOMAKE_VERSION so it can be traced.
# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
- [AM_AUTOMAKE_VERSION([1.7.6])])
+ [AM_AUTOMAKE_VERSION([1.7.9])])
# Helper functions for option handling. -*- Autoconf -*-
This file documents Bobot++ by Clinton Ebadi and Etienne Bernard
(original author, no longer works on program).
- Copyright 2002 Clinton Ebadi
+ Copyright 2002,2004 Clinton Ebadi
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1 or
This document describes Bobot++ by Clinton Ebadi and Etienne Bernard
(original author, no longer works on program).
- 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++
- Copyright 2002 Clinton Ebadi
+ Copyright 2002,2004 Clinton Ebadi
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1 or
* Function Index::
* Variable Index::
+ --- 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::
+
\1f
File: bobot++.info, Node: Introduction, Next: Configuration, Prev: Top, Up: Top
* Menu:
-* Configuration File Syntax::
-* Configure File Placement::
+* Configuration Files::
+* Configuration File Placement::
\1f
-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
-Configuration File Syntax
-=========================
+Configuration Files
+===================
* Menu:
* bot.conf::
\1f
-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
bot.conf
--------
-bot.conf is the main configuration file for a Bobot++. The available
+`bot.conf' contains key value pairs separated by `='.
+
+ `<key> = <value>'
+
+ 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
configuration variables are listed below in the format "VARIABLE
<default-value>: description"
* SHITLIST <bot.shit>: Name of the file where the shitlist is stored
- * LOGFILE <$LOGDIR/bot.log>:
+ * LOGFILE <$LOGDIR/bot.log>: Location of the bot logfile (set this
+ to `/dev/null' to disable logging).
+
+ * SERVER <None>: This specifies the server to connect to. Note that
+ this has a special syntax.
+
+ * CHANNEL <None>: This specifies a channel the bot will join when it
+ starts up. This also has a special syntax.
+
+
+* Menu:
+
+* server syntax::
+* channel syntax::
+
+\1f
+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).
+
+\1f
+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:::'
+ The bot will join `#bar' and will not set any modes nor will it
+attempt to maintain any modes.
\1f
-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
Configuration File Placement
============================
Bobot++ will look in `/etc/bobotpp/default/' for its default config if
none is specified on the command line. Put the configuration files you
want to be loaded by default in this directory. If you are not root or
-you want to have your own personal configration, put it in
+you want to have your own personal configuration, put it in
`~/.bobotpp/config/default/'.
\1f
\1f
Tag Table:
-Node: Top\7f517
-Node: Introduction\7f1246
-Node: Configuration\7f1434
-Node: Configuration File Syntax\7f1817
-Node: bot.conf\7f2024
-Node: Configure File Placement\7f2856
-Node: Using the Bot\7f3327
-Node: User Levels\7f3498
-Node: Scripting\7f4499
-Node: Adding New Commands\7f5404
-Node: Hooks\7f6668
-Node: Creating a Hook\7f7639
-Node: Hook Types\7f8775
-Node: Scheme User Levels\7f12246
-Node: Sending Messages\7f13372
-Node: High Level Message Functions\7f13980
-Node: Low Level Message Functions\7f14191
-Node: Misc Scripting Stuff\7f14941
-Node: Concept Index\7f15357
-Node: Function Index\7f15539
-Node: Variable Index\7f15800
+Node: Top\7f522
+Node: Introduction\7f1722
+Node: Configuration\7f1910
+Node: Configuration Files\7f2291
+Node: bot.conf\7f2484
+Node: server syntax\7f3889
+Node: channel syntax\7f4737
+Node: Configuration File Placement\7f5564
+Node: Using the Bot\7f6034
+Node: User Levels\7f6205
+Node: Scripting\7f7206
+Node: Adding New Commands\7f8111
+Node: Hooks\7f9375
+Node: Creating a Hook\7f10346
+Node: Hook Types\7f11482
+Node: Scheme User Levels\7f14953
+Node: Sending Messages\7f16079
+Node: High Level Message Functions\7f16687
+Node: Low Level Message Functions\7f16898
+Node: Misc Scripting Stuff\7f17648
+Node: Concept Index\7f18064
+Node: Function Index\7f18246
+Node: Variable Index\7f18507
\1f
End Tag Table
This file documents Bobot++ by Clinton Ebadi and Etienne Bernard
(original author, no longer works on program).
-Copyright 2002 Clinton Ebadi
+Copyright 2002,2004 Clinton Ebadi
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1 or
@page
@vskip O plus 1filll
-Copyright @copyright{} 2002 Clinton Ebadi
+Copyright @copyright{} 2002,2004 Clinton Ebadi
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1 or
This document describes Bobot++ by Clinton Ebadi and Etienne Bernard
(original author, no longer works on program).
-This document applies to version 2.1.0 of the program named
+This document applies to version 2.1.5 of the program named
Bobot++
-Copyright 2002 Clinton Ebadi
+Copyright 2002,2004 Clinton Ebadi
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1 or
* Concept Index::
* Function Index::
* Variable Index::
+
+@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
@end menu
@node Introduction, Configuration, Top, Top
@file{examples} directory for an example configuration.
@menu
-* Configuration File Syntax::
-* Configure File Placement::
+* Configuration Files::
+* Configuration File Placement::
@end menu
-@node Configuration File Syntax, Configure File Placement, Configuration, Configuration
-@section Configuration File Syntax
+@node Configuration Files, Configuration File Placement, Configuration, Configuration
+@section Configuration Files
@menu
* bot.conf::
@end menu
-@node bot.conf, , Configuration File Syntax, Configuration File Syntax
+@node bot.conf, , Configuration Files, Configuration Files
@subsection bot.conf
+@file{bot.conf} contains key value pairs separated by @code{=}.
+
+@code{<key> = <value>}
+
+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}.
+
bot.conf is the main configuration file for a Bobot++. The available
configuration variables are listed below in the format ``@var{variable}
<default-value>: description''
stored
@item @var{shitlist} <bot.shit>: Name of the file where the shitlist is
stored
-@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} <None>: This specifies the server to connect
+to. Note that this has a special syntax.
+@item @var{channel} <None>: This specifies a channel the bot will join
+when it starts up. This also has a special syntax.
@end itemize
-@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
@section Configuration File Placement
Bobot++ will look in @file{/etc/bobotpp/default/} for its default
config if none is specified on the command line. Put the configuration
files you want to be loaded by default in this directory. If you are
-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
@file{~/.bobotpp/config/default/}.
@node Using the Bot, Scripting, Configuration, Top
dnl Process this file with autoconf to produce a configure script.
AC_PRERQ(2.50)
dnl AC_INIT(source/Makefile.in)
-AC_INIT([Bobot++], [2.1.4CVS], [clinton@unknownlamer.org], [bobotpp])
+AC_INIT([Bobot++], [2.1.5CVS], [clinton@unknownlamer.org], [bobotpp])
AM_INIT_AUTOMAKE
AM_CONFIG_HEADER(config.h)
(module-use! (resolve-module '(guile-user) #f)
the-bot-module)
+(use-modules (srfi srfi-13))
+
(define-public %bot:loadpath (list
(string-append (getenv "HOME")
"/.bobotpp/scripts/")
bot:sys-scripts-dir))
(define-public %bot:load-extensions %load-extensions)
-;;; 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
;;; arg is a thunk it will be executed and it's output will be
;;; written to the log
(define-public (bot:log . messages)
(if (thunk? x)
(display (x) (bot-logport))
(display x (bot-logport))))
- messages )
+ messages)
(bot:flushport))
(define-public (bot:load file)
;;; Message sending utils
-;;; 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)
(define-public (ctcp-quote message)
- 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)))))))
+
+
;;; DEPRECATED FUNCTION NAMES
;;; These are provided for backwards compatibility
-;;; and will be removed in the 2.3 dev tree
+;;; and will be removed in the 3.0 release
(define-public bot-load bot:load)
(define-public bot-action bot:action)
{
DCCPerson *person = new DCCPerson (cnx);
String temp = person->getAddress ();
- cnx->get_bot()->logLine (temp);
if (dcc_map[temp])
delete dcc_map[temp];
dcc_map[person->getAddress ()] = person;
break;
default:
print_short_help (argv[0]);
- exit(1);
+ std::exit(1);
}
DIR * temp;
} // static functions and data
-int main(int argc, char **argv) {
+int main(int argc, char **argv)
+{
#ifdef USESCRIPTS
scm_boot_guile (argc, argv, real_main, 0);
#else