+2002-07-27 Clinton Ebadi <clinton@unknownlamer.org>
+
+ * source/Interp.C (Shutdown): Runs bot:exit-hook hooks
+ (Startup): New var for Scheme: bot:exit-hook. Calls the thunks
+ associated with the hook when Interp::Shutdown is called (bot exit).
+
2002-07-23 Clinton Ebadi <clinton@unknownlamer.org>
* source/BotInterp.H (Hook<): Changed behavior of Hook's <. If a
done
mostlyclean-aminfo:
- -rm -f bobot++.aux bobot++.cp bobot++.dvi bobot++.fn bobot++.ky bobot++.log \
- bobot++.pg bobot++.ps bobot++.toc bobot++.tp bobot++.vr
+ -rm -f bobot++.aux bobot++.cp bobot++.cps bobot++.dvi bobot++.fn bobot++.fns \
+ bobot++.ky bobot++.log bobot++.pg bobot++.ps bobot++.toc \
+ bobot++.tp bobot++.vr bobot++.vrs
maintainer-clean-aminfo:
cd $(srcdir) && \
-======================================================================
-====== This is a -*- text -*- file and ===============================
-====== User Visible Changes In Bobot++ ===============================
-======================================================================
+(-*- text -*-)
+User Visible Changes In Bobot++
-IMPORTANT NOTE:
-+====================================================================+
-| As of version 1.98 unknown_lamer is the new maintainer. |
-| Also as of version 1.98, you must have Guile 1.5.6+ or 1.6.x in |
-| order to compile scripting support. |
-+====================================================================+
+IMPORTANT NOTES:
+ As of version 1.98 unknown_lamer is the new maintainer. Also as of
+ version 1.98, you must have Guile 1.5.6+ or 1.6.x in order to
+ compile scripting support.
=====================================================================
====== The News =====================================================
- bobot-utils.scm is now autoloaded, so you don't need to
load it if you want to use its functions.
- Logs are now in ~/.bobotpp/logs/
-- bot-* procedures in Scheme are now bot:*. The onl bot-* functions
+- bot-* procedures in Scheme are now bot:*. The old bot-* functions
are defined as aliases in bobot-utils.scm
- You can now use lambda's for new commands (oops, I wasn't protecting
the objects from garbage collection)
THIS IS BOBOT++ VERSION 2.1 (this file is also -*- text -*-)
This is the unstable tree. 2.0 is what you want to use if you don't
-want your scripts to break every other day.
+want your scripts to break every other day. Then again, I'm not
+updated this every day and so far the code is mostly backwards
+compatible. The biggest change is that all bot-* functions are not
+bot:*. A simple 'perl -pi -e s/bot-/bot:/g SCRIPT1 SCRIPT2 .. SCRIPTN'
+should be enough to update your scripts. The bot-* functions are
+defined as aliases for the bot:* functions in bobot-utils.scm, which
+is autoloaded by bobot++.
The binary is now named bobotpp because of automake's choking on ++ in
-rule names. Make install isn't really needed because bobotpp reads
-it's config from the current dir. 2.1 will change this too.
+rule names. In order for the bot to work properly, you must 'make
+install' it so that bobot-utils.scm is installed and can be loaded for
+scripts to use.
2.1 is not guaranteed to compile anywhere.
Please read the doc in the "doc" directory.
-Also see bobot++.texinfo
+Also see bobot++.texinfo, which should be an ok set of docs on how to
+configure and use Bobot++, even if it is horribly incomplete. You
+should still read the old doc in the doc directory because it is more
+complete.
+
+bobotpp --help is also helpful.
This program is distributed under the terms of the GNU General Public
License version 2 or later. See the COPYING file for details.
* 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
+* Call hooks/public when bot sends a privmsg to a channel (read IRC
+ protocol spec for other stuff that might need this)
Networking:
* Add a networked interface to guile repl
* Hooks::
* Scheme User Levels::
* Sending Messages::
+* Misc Scripting Stuff::
\1f
File: bobot++.info, Node: Adding New Commands, Next: Hooks, Prev: Scripting, Up: Scripting
can use new commands you add.
\1f
-File: bobot++.info, Node: Sending Messages, Prev: Scheme User Levels, Up: Scripting
+File: bobot++.info, Node: Sending Messages, Next: Misc Scripting Stuff, Prev: Scheme User Levels, Up: Scripting
Sending Messages
================
`bot:ctcp-quote' the message!
+\1f
+File: bobot++.info, Node: Misc Scripting Stuff, Prev: Sending Messages, Up: Scripting
+
+Misc. Scripting Stuff
+=====================
+
+ These are a few useful things that I thought people writing scripts
+might want to know.
+
+ If you want to execute code when the bot exits, just do `add-hook!
+bot:exit-hook THUNK' where THUNK is an argumentless procedure (a
+thunk). When the bot exits your thunk will be called.
+
\1f
File: bobot++.info, Node: Concept Index, Next: Function Index, Prev: Scripting, Up: Top
Node: Using the Bot\7f2499
Node: User Levels\7f2673
Node: Scripting\7f3677
-Node: Adding New Commands\7f4560
-Node: Hooks\7f5803
-Node: Creating a Hook\7f6741
-Node: Hook Types\7f7533
-Node: Scheme User Levels\7f10006
-Node: Sending Messages\7f11135
-Node: High Level Message Functions\7f11703
-Node: Low Level Message Functions\7f11921
-Node: Concept Index\7f12680
-Node: Function Index\7f12862
-Node: Variable Index\7f13123
+Node: Adding New Commands\7f4585
+Node: Hooks\7f5828
+Node: Creating a Hook\7f6766
+Node: Hook Types\7f7558
+Node: Scheme User Levels\7f10031
+Node: Sending Messages\7f11160
+Node: High Level Message Functions\7f11757
+Node: Low Level Message Functions\7f11975
+Node: Misc Scripting Stuff\7f12734
+Node: Concept Index\7f13153
+Node: Function Index\7f13335
+Node: Variable Index\7f13596
\1f
End Tag Table
@author Clinton Ebadi
@page
-@vskip Opt plus 1filll
+@c @vskip O plus 1filll
Copyright @copyright{} 2002 Clinton Ebadi
Permission is granted to copy, distribute and/or modify this document
* Hooks::
* Scheme User Levels::
* Sending Messages::
+* Misc Scripting Stuff::
@end menu
@node Adding New Commands, Hooks, Scripting, Scripting
do with a script. As the scripting interface becomes more powerful,
you must think more about what users can use new commands you add.
-@node Sending Messages, , Scheme User Levels, Scripting
+@node Sending Messages, Misc Scripting Stuff, Scheme User Levels, Scripting
@section Sending Messages
There are several types of messages you can send with Bobot++ from
@end itemize
+@node Misc Scripting Stuff, , Sending Messages, Scripting
+@section Misc. Scripting Stuff
+
+These are a few useful things that I thought people writing scripts
+might want to know.
+
+If you want to execute code when the bot exits, just do
+@code{add-hook! bot:exit-hook @var{thunk}} where @var{thunk} is an
+argumentless procedure (a thunk). When the bot exits your thunk will
+be called.
+
@node Concept Index, Function Index, Scripting, Top
@unnumbered Concept Index
@printindex cp
@node Variable Index, , Function Index, Top
@unnumbered Variable Index
@printindex vr
+
+@bye
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.53 for Bobot++ 2.1CVS.
+# Generated by GNU Autoconf 2.53 for Bobot++ 2.1.1CVS.
#
# Report bugs to <clinton@unknownlamer.org>.
#
# Identity of this package.
PACKAGE_NAME='Bobot++'
PACKAGE_TARNAME='bobot--'
-PACKAGE_VERSION='2.1CVS'
-PACKAGE_STRING='Bobot++ 2.1CVS'
+PACKAGE_VERSION='2.1.1CVS'
+PACKAGE_STRING='Bobot++ 2.1.1CVS'
PACKAGE_BUGREPORT='clinton@unknownlamer.org'
# Factoring default headers for most tests.
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures Bobot++ 2.1CVS to adapt to many kinds of systems.
+\`configure' configures Bobot++ 2.1.1CVS to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of Bobot++ 2.1CVS:";;
+ short | recursive ) echo "Configuration of Bobot++ 2.1.1CVS:";;
esac
cat <<\_ACEOF
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
-Bobot++ configure 2.1CVS
+Bobot++ configure 2.1.1CVS
generated by GNU Autoconf 2.53
Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by Bobot++ $as_me 2.1CVS, which was
+It was created by Bobot++ $as_me 2.1.1CVS, which was
generated by GNU Autoconf 2.53. Invocation command line was
$ $0 $@
# Define the identity of the package.
PACKAGE=Bobot++
-VERSION=2.1.0CVS
+VERSION=2.1.1CVS
cat >>confdefs.h <<_ACEOF
#define PACKAGE "$PACKAGE"
} >&5
cat >&5 <<_CSEOF
-This file was extended by Bobot++ $as_me 2.1CVS, which was
+This file was extended by Bobot++ $as_me 2.1.1CVS, which was
generated by GNU Autoconf 2.53. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-Bobot++ config.status 2.1CVS
+Bobot++ config.status 2.1.1CVS
configured by $0, generated by GNU Autoconf 2.53,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
} >&5
cat >&5 <<_CSEOF
-This file was extended by Bobot++ $as_me 2.1CVS, which was
+This file was extended by Bobot++ $as_me 2.1.1CVS, which was
generated by GNU Autoconf 2.53. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-Bobot++ config.status 2.1CVS
+Bobot++ config.status 2.1.1CVS
configured by $0, generated by GNU Autoconf 2.53,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
} >&5
cat >&5 <<_CSEOF
-This file was extended by Bobot++ $as_me 2.1CVS, which was
+This file was extended by Bobot++ $as_me 2.1.1CVS, which was
generated by GNU Autoconf 2.53. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-Bobot++ config.status 2.1CVS
+Bobot++ config.status 2.1.1CVS
configured by $0, generated by GNU Autoconf 2.53,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
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.1CVS], [clinton@unknownlamer.org])
-AM_INIT_AUTOMAKE([Bobot++], [2.1.0CVS])
+AC_INIT([Bobot++], [2.1.1CVS], [clinton@unknownlamer.org])
+AM_INIT_AUTOMAKE([Bobot++], [2.1.1CVS])
AM_CONFIG_HEADER(config.h)
dnl Options
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
#include <fstream>
+#include <algorithm>
#include <iomanip>
#include <cstring>
#include <cstdlib>
void
Bot::destroy_user_functions ()
{
- for_each (userFunctions.begin (),
+ std::for_each (userFunctions.begin (),
userFunctions.end (),
erase_userf);
userFunctions.erase (userFunctions.begin (),
void
Interp::Startup()
{
-// scm_primitive_load_path(scm_makfrom0str("ice-9/boot-9.scm"));
+ // Hooks
+ scm_c_define ("bot:exit-hook", scm_make_hook (scm_long2num (0)));
// Symbols
// bot:user-*
void
Interp::Shutdown()
-{ }
+{
+ scm_c_run_hook (gh_lookup ("bot:exit-hook"), SCM_EOL);
+}
void
Interp::Execute(Bot *b, String command)
#endif
}
-// struct userFunctionsStruct userFunctionsInit[] = {
-// {
-// "ACTION", UserCommands::Action, User::USER, true}
-// ,
-// {
-// "ADDUSER", UserCommands::AddUser, User::FRIEND, false}
-// ,
-// {
-// "ADDSERVER", UserCommands::AddServer, User::FRIEND, false}
-// ,
-// {
-// "ADDSHIT", UserCommands::AddShit, User::FRIEND, false}
-// ,
-// {
-// "ALIAS", UserCommands::Alias, User::MASTER, false}
-// ,
-// {
-// "BAN", UserCommands::Ban, User::USER, true}
-// ,
-// {
-// "BANLIST", UserCommands::BanList, User::USER, true}
-// ,
-// // { "CHANGELEVEL", UserCommands::ChangeLevel, User::FRIEND, false },
-// {
-// "CHANNELS", UserCommands::Channels, User::FRIEND, false}
-// ,
-// {
-// "CYCLE", UserCommands::Cycle, User::FRIEND, true}
-// ,
-// {
-// "DCCLIST", UserCommands::DCCList, User::FRIEND, false}
-// ,
-// {
-// "DEBAN", UserCommands::Deban, User::USER, true}
-// ,
-// {
-// "DELSERVER", UserCommands::DelServer, User::FRIEND, false}
-// ,
-// {
-// "DELUSER", UserCommands::DelUser, User::FRIEND, false}
-// ,
-// {
-// "DELSHIT", UserCommands::DelShit, User::FRIEND, false}
-// ,
-// {
-// "DEOP", UserCommands::Deop, User::TRUSTED_USER, true}
-// ,
-// {
-// "DIE", UserCommands::Die, User::MASTER, false}
-// ,
-// {
-// "DO", UserCommands::Do, User::MASTER, false}
-// ,
-// #ifdef USESCRIPTS
-// {
-// "EXECUTE", UserCommands::Execute, User::MASTER, false}
-// ,
-// #endif
-// {
-// "HELP", UserCommands::Help, User::NONE, false}
-// ,
-// {
-// "IDENT", UserCommands::Ident, User::NONE, true}
-// ,
-// {
-// "INVITE", UserCommands::Invite, User::USER, true}
-// ,
-// {
-// "JOIN", UserCommands::Join, User::FRIEND, false}
-// ,
-// {
-// "KEEP", UserCommands::Keep, User::FRIEND, true}
-// ,
-// {
-// "KICK", UserCommands::Kick, User::USER, true}
-// ,
-// {
-// "KICKBAN", UserCommands::KickBan, User::USER, true}
-// ,
-// {
-// "LOAD", UserCommands::Load, User::FRIEND, false}
-// ,
-// #ifdef USESCRIPTS
-// {
-// "LOADSCRIPT", UserCommands::LoadScript, User::MASTER, false}
-// ,
-// #endif
-// {
-// "LOCK", UserCommands::Lock, User::FRIEND, true}
-// ,
-// {
-// "MODE", UserCommands::Mode, User::FRIEND, true}
-// ,
-// {
-// "MSG", UserCommands::Msg, User::USER, false}
-// ,
-// {
-// "NAMES", UserCommands::Names, User::USER, true}
-// ,
-// {
-// "NEXTSERVER", UserCommands::NextServer, User::FRIEND, false}
-// ,
-// {
-// "NICK", UserCommands::Nick, User::FRIEND, false}
-// ,
-// {
-// "NSLOOKUP", UserCommands::NsLookup, User::USER, false}
-// ,
-// {
-// "OP", UserCommands::Op, User::TRUSTED_USER, true}
-// ,
-// {
-// "PART", UserCommands::Part, User::FRIEND, true}
-// ,
-// {
-// "PASSWORD", UserCommands::Password, User::USER, true}
-// ,
-// {
-// "RECONNECT", UserCommands::Reconnect, User::FRIEND, false}
-// ,
-// {
-// "RSPYMESSAGE", UserCommands::RSpyMessage, User::USER, false}
-// ,
-// {
-// "SAVE", UserCommands::Save, User::FRIEND, false}
-// ,
-// {
-// "SAY", UserCommands::Say, User::USER, true}
-// ,
-// {
-// "SERVER", UserCommands::Server, User::FRIEND, false}
-// ,
-// {
-// "SERVERLIST", UserCommands::ServerList, User::FRIEND, false}
-// ,
-// {
-// "SETVERSION", UserCommands::SetVersion, User::MASTER, false}
-// ,
-// {
-// "SHITLIST", UserCommands::ShitList, User::FRIEND, false}
-// ,
-// {
-// "SPYLIST", UserCommands::SpyList, User::USER, false}
-// ,
-// {
-// "SPYMESSAGE", UserCommands::SpyMessage, User::USER, false}
-// ,
-// {
-// "STATS", UserCommands::Stats, User::FRIEND, true}
-// ,
-// {
-// "TBAN", UserCommands::TBan, User::USER, true}
-// ,
-// {
-// "TKBAN", UserCommands::TKBan, User::USER, true}
-// ,
-// {
-// "TOPIC", UserCommands::Topic, User::USER, true}
-// ,
-// {
-// "UNLOCK", UserCommands::Unlock, User::FRIEND, true}
-// ,
-// {
-// "USERLIST", UserCommands::UserList, User::FRIEND, false}
-// ,
-// {
-// "WHO", UserCommands::Who, User::NONE, true}
-// ,
-// {
-// "WHOIS", UserCommands::Whois, User::FRIEND, true}
-// ,
-// {
-// "", 0, 0, false}
-// };
void
Parser::parseMessage (ServerConnection * cnx,
Person * from, String to, String parameters)