[cvslog] Module eggdrop1.6: Change committed
cvslog
eggdev@eggheads.org
Tue Dec 18 11:22:01 2001
CVSROOT : /usr/local/cvsroot
Module : eggdrop1.6
Commit time: 2001-12-18 17:21:45 UTC
Commited by: Jeff Fisher <guppy@techmonkeys.org>
Modified files:
doc/BUG-REPORT doc/CONTENTS doc/MODULES doc/UPDATES1.6
doc/patch.howto doc/tcl-commands.doc doc/text-substitutions.doc
doc/tricks doc/settings/CONTENTS doc/settings/mod.compress
doc/settings/mod.transfer src/patch.h
Log message:
more doc updates! yay
---------------------- diff included ----------------------
Index: eggdrop1.6/doc/BUG-REPORT
diff -u eggdrop1.6/doc/BUG-REPORT:1.12 eggdrop1.6/doc/BUG-REPORT:1.13
--- eggdrop1.6/doc/BUG-REPORT:1.12 Sun Nov 11 14:24:44 2001
+++ eggdrop1.6/doc/BUG-REPORT Tue Dec 18 11:21:34 2001
@@ -88,8 +88,8 @@
4.1) The logged last context (example: Last context: userent.c/973 []):
4.2) If the bot wrote to the file DEBUG, copy the text -contents- of
- that file here (NOTE: It should be about 20 lines of info, could
- be a few lines more):
+ that file here (NOTE: It should be about 20 lines of info, but it
+ could be a few lines more):
4.3) Your comments and a description of the bug:
Index: eggdrop1.6/doc/CONTENTS
diff -u eggdrop1.6/doc/CONTENTS:1.10 eggdrop1.6/doc/CONTENTS:1.11
--- eggdrop1.6/doc/CONTENTS:1.10 Sun Nov 11 14:24:44 2001
+++ eggdrop1.6/doc/CONTENTS Tue Dec 18 11:21:34 2001
@@ -1,58 +1,61 @@
Contents of the doc/ directory:
settings/
- documentation for all config file settings
+ This directory contains documentation for all config file and module
+ settings.
man1/
- unix man pages
+ This contains Unix man page files.
html/
- all doc files in html
+ An HTML version of Eggdrop's documentation is provided in this directory.
AUTHORS
- a list of eggdrop developers and contributors
+ A list of Eggdrop developers and contributors is in this file.
BOTNET
- a guide to flags and bot user file sharing
+ This is a guide to flags and bot user file sharing.
BUG-REPORT
- a guide to sending bug-reports
+ Fill out this form and e-mail it to bugs@eggheads.org if you find a bug
+ in Eggdrop.
compiling.FAQ
- if you have troubles compiling your eggdrop, take a look
- in this file
-
-CONTENTS
- this file
+ If you have trouble compiling your eggdrop, take a look
+ in this file.
eggdrop.doc
- the primary documentation on running an eggdrop bot -- to be used
- AFTER you get it compiled (unfinished, but a good starter course)
+ The primary documentation on running an eggdrop bot (to be used
+ AFTER you get it compiled) is in this file. It is unfinished, but
+ a good starter course.
KNOWN-PROBLEMS
- i.e. things that are broken, but aren't getting fixed anytime soon
+ See this file for a list of things that are broken but aren't getting
+ fixed anytime soon
MODULES
- module information (not finished yet, but getting there).
+ Information on writing eggdrop modules can be found in this document.
patch.howto
- a how-to on applying and making patches to eggdrop
- (patches are a popular way to fix bugs in programs)
+ This is a how-to on applying and creating eggdrop patches.
tcl-commands.doc
- documentation for eggdrop/Tcl script programmers
+ Documentation on eggdrop Tcl commands available to scripters can be
+ found here.
text-substitutions.doc
- documentation for the motd file
+ This contains documentation on %-variables that can be used in help, MOTS,
+ and BANNER files.
tricks
- some advanced tips on making eggdrop do what you want it to do
+ Some advanced tips on making eggdrop do what you want it to do can be found
+ here. It also contains tweaking tips for your config file.
UPDATES1.6
- a list of what's changed in 1.6 versions
+ This is a complete list of changes made to eggdrop 1.6.
UPDATES1.5
- a list of what's changed in 1.5 versions
+ This is a complete list of changes made to eggdrop 1.5.
UPDATES.pre1.5
- a list of what's changed in pre 1.5 versions
\ No newline at end of file
+ This is a complete list of changes made to eggdrop before version 1.5.
\ No newline at end of file
Index: eggdrop1.6/doc/MODULES
diff -u eggdrop1.6/doc/MODULES:1.14 eggdrop1.6/doc/MODULES:1.15
--- eggdrop1.6/doc/MODULES:1.14 Thu Dec 13 23:38:12 2001
+++ eggdrop1.6/doc/MODULES Tue Dec 18 11:21:34 2001
@@ -1,180 +1,215 @@
-EGGDROP MODULE INFORMATION 13 Dec 2001
+EGGDROP MODULE INFORMATION 18 Dec 2001
INDEX
-I WHAT ARE MODULES?
-II WHY USE MODULES?
-III HOW TO USE MODULES?
-IV CURRENT MODULES
-V PROGRAMMING MODULES
-VI WHAT TO DO WITH A MODULE?
+I. WHAT ARE MODULES?
+II. WHY USE MODULES?
+III. HOW TO INSTALL A MODULE
+IV. MODULES INCLUDED WITH EGGDROP
+V. PROGRAMMING MODULES
+VI. WHAT TO DO WITH A MODULE?
-I. WHAT ARE MODULES?
-Modules are portions of code which are loaded separately to the
-bot itself, which provided extra services. e.g. filesys module
-provides the entire file system.
-II. WHY USE MODULES?
+I. WHAT ARE MODULES?
-It allows the core eggdrop, that which is minimally required to be
-reduced, and allows C coders to add their own enhancements to the
-bot without recompiling the whole thing.
+ Modules are portions of code which are loaded separately to the
+ bot itself and provide extra services. For example, the filesys
+ module provides the entire file system.
-III. HOW TO USE MODULES
+II. WHY USE MODULES?
-Run ./configure as normal, then 'make' to make the eggdrop
-with module support, this will also compile the modules.
+ Modules allow C coders to add their own enhancements to the
+ bot without recompiling the whole thing, and without increasing
+ the size of the eggdrop core.
-The list of modules compiled is adjustable by
- (a) specifying `--disable-mod-MODULE' parameters to the configure
- script, where MODULE is the module you want to disable.
+III. HOW TO INSTALL A MODULE
- (b) the interactive module selection tool called during a normal
- ./configure run. (this may be disabled by specifying the
- parameter `--disable-modconf')
+ Please note that these are only basic instructions for compiling and
+ installing a module. Please read any and all directions included with
+ the module you wish to install.
- (c) calling `make reconfig' after a successful configure run,
- which calls the interactive module selection tool again.
+ 1. Download and un-tar the eggdrop source code.
-Next do one of two things to load the module:
+ 2. Place the new module in its own directory (in the format of
+ (modulename).mod) in src/mod.
- from the partyline (as an owner) type:
- .loadmod <module-name>
- or in a Tcl script:
- loadmodule <module-name>
+ 3. Run ./configure (from eggdrop1.6.x/).
- module-name is the part BEFORE .so, e.g filesys.so module
- you type '.loadmod filesys'.
+ 4. Type 'make config' or 'make iconfig'.
-Normally you will want to add the loadmodule statement to your
-bot's configuration file instead of typing it every time the bot
-start.
+ 5. Type 'make'.
-To see your currently running modules type '.module'.
+ 6. Copy the compiled module file (modulename.so) into your bot's
+ modules folder.
+ 7. Add 'loadmodule modulename' to your eggdrop.conf file (do not
+ add the .so suffix).
+
+ 8. Rehash or restart your bot.
-IV. CURRENT MODULES
+ To see your currently running modules type '.module'.
-assoc Assoc support.
-blowfish Encryption support needed for encrypting your users' passwords.
- Also needed for the wire module below. This module can't be
- unloaded once it's loaded.
-channels Provides channel related support for the bot, without it, it
- will just sit on irc, it can respond to msg & ctcp commands,
- but that's all.
-compress This module provides an zlib support for compress transfer of
- files via the botnet. For Example, compressed userfile transfers
- are possible now.
-console This module provides storage of console settings when you exit
- the bot (or .store).
-ctcp This provides the normal ctcp replies that you'd expect.
-dns This module provides asynchronous dns support which avoids
- blocking on dns lookups. Especially useful for busy hub bots.
-filesys The file system. If you unload it all users currently using
- the it will be disconnected from the bot.
-irc This module provides ALL NORMAL IRC INTERACTION, if you want
- the normal join & maintain channels stuff, this is the module.
-notes This provides support for storing of notes for users from each
- other. Notes between currently online users is supported in
- the core, this is only for storing the notes for later
- retrieval, direct user->user notes are built-in.
-seen This module provides seen commands via msg, on channel or via
- dcc, similar to the various scripts.
-server This provides the core server support (removing this is
- equivalent to the old NO_IRC define).
-share Userfile sharing.
-transfer Handles the transfer of files via botnet or dcc, this is
- REQUIRED for file sharing.
-uptime Compete with other bots to see who has the highest uptime.
-wire An encrypted partyline communication.
-woobie Just a fun, bizarre test module which serves as an example for
- module programming.
+IV. MODULES INCLUDED WITH EGGDROP
-V. PROGRAMMING MODULES
+ assoc This module provides assoc support, i.e. naming channels on
+ the botnet.
-WARNING:
- This section is very likely to be out of date. It was not updated
- for quite some time. The most reliable way to learn about module
- programming is to take a deep look at the other available modules.
+ blowfish Eggdrop can encrypt your userfile, so users can have secure
+ passwords. Please note that when you change your encryption
+ method later (i.e. using other modules like a md5 module),
+ you can't use your current userfile anymore. Eggdrop will not
+ start without an encryption module.
-Note: This is for a simple module of 1 source file, if you're doing a
- multiple source file module, you shouldn't need to read this
- anyway ;)
+ channels This module provides channel related support for the bot.
+ Without it, you wont be able to make the bot join a channel
+ or save channel specific userfile information.
-(a) Create a src/mod/MODULE.mod directory in your eggdrop distro
- (where MODULE is the module name) and cd to it.
+ compress This module provides provides support for file compression.
+ This allows the bot to transfer compressed user files and,
+ therefore, save a significant amount of bandwidth.
-(b) Copy the file `Makefile' from src/mod/woobie.mod and replace all
- occurrences of `woobie' with your module name. This should ensure
- that your module gets compiled.
+ console This module provides storage of console settings when you exit
+ the bot or type .store on the partyline.
-(c) Next you want to create a file called MODULE.c (again MODULE is the
- module name), and here's where the work starts :)
+ ctcp This module provides the normal ctcp replies that you'd expect.
+ Without it loaded, CTCP CHAT will not work.
- (1) Things you need to include in your source code.
+ dns This module provides asynchronous dns support. This will avoid
+ long periods where the bot just hangs there, waiting for a
+ hostname to resolve, which will often let it timeout on all
+ other connections.
- (i) #define MODULE_NAME "module-name"
+ filesys This module provides an area within the bot where users can
+ store files. With this module, the bot is usable as a file
+ server.
- You MUST use this, it's required by several short cuts in the
- code, it's gotta be the name you will be using in .loadmod
+ irc This module provides basic IRC support for your bot. You have
+ to load this if you want your bot to come on IRC.
- (ii) #define MAKING_MODULENAME
- You MUST also include this, or else the module won't work.
- MODULENAME is the name of your module(MODULE_NAME), but in
- caps
+ notes This module provides support for storing of notes for users
+ from each other. Note sending between currently online users
+ is supported in the core, this is only for storing the notes
+ for later retrieval.
- (iii) #include "../module.h"
+ seen This module provides very basic seen commands via msg, on
+ channel or via dcc. This module works only for users in the
+ bot's userlist. If you are looking for a better and more
+ advanced seen module, try the gseen module by G'Quann. You
+ can find it at http://www.visions-of-fantasy.de/gseen.mod/.
- This provides all the accessible functions in eggdrop,
- examine closely src/mod/module.h to find a list of functions
- available.
+ server This module provides the core server support. You have to load
+ this if you want your bot to come on IRC. Not loading this is
+ equivalent to the old NO_IRC define.
- (iv) and other standard c include files you might need (Note
- stdio.h string.h stdlib.h & sys/types.h are already included)
+ share This module provides userfile sharing support between two
+ directly linked bots.
+
+ transfer The transfer module provides dcc send/get support and userfile
+ transfer support for userfile sharing.
+
+ uptime This module reports uptime statistics to http://uptime.eggheads.org.
+ Go look and see what your uptime is! It takes about 9 hours to
+ show up, so if your bot isn't listed, try again later. See
+ doc/settings/mod.uptime for more information, including details
+ on what information is sent to the uptime server.
+
+ wire This module provides all the standard .wire commands via dcc.
+ It is an encrypted partyline communication tool, compatible
+ with wire.tcl.
+
+ woobie This is for demonstrative purposes only. If you are looking for starting
+ point in writing modules, woobie is the right thing.
+
+
+V. PROGRAMMING MODULES
+
+ WARNING:
+ This section is very likely to be out of date. It was not updated
+ for quite some time. The most reliable way to learn about module
+ programming is to take a deep look at the other available modules.
+
+ Note: This is for a simple module of 1 source file. If you're doing a
+ multiple source file module, you shouldn't need to read this
+ anyway. ;)
+
+ (a) Create a src/mod/MODULE.mod directory in your eggdrop distro
+ (where MODULE is the module name) and cd to it.
+
+ (b) Copy the file `Makefile' from src/mod/woobie.mod and replace all
+ occurrences of `woobie' with your module name. This should ensure
+ that your module gets compiled.
+
+ (c) Next, you want to create a file called MODULE.c (again MODULE is the
+ module name), and here's where the work starts. :)
+
+ (1) Things you need to include in your source code:
+
+ (i) #define MODULE_NAME "module-name"
+
+ You MUST use this. It's required by several short cuts in the
+ code, and it's got to be the name you will be using in .loadmod
+
+ (ii) #define MAKING_MODULENAME
+ You MUST also include this, or else the module won't work.
+ MODULENAME is the name of your module(MODULE_NAME), but in
+ caps.
+
+ (iii) #include "../module.h"
+
+ This provides all the accessible functions in eggdrop.
+ Examine src/mod/module.h closely to find a list of functions
+ available.
+
+ (iv) #include any other standard c include files you might need (Note
+ stdio.h string.h stdlib.h & sys/types.h are already included).
(v) Function *global;
- This variable provides access to all the eggdrop functions, without
- it you can't call any eggdrop functions (heck, the module wont
- even load)
+ This variable provides access to all the eggdrop functions; without
+ it, you can't call any eggdrop functions (heck, the module wont even
+ load).
- (2) CORE functions every module needs.
+ (2) CORE functions every module needs.
-*SIDENOTE* I suggest in a single source file module you define all
-functions/variables (except global & module_start) as static, this will
-drastically reduce the size of modules on decent systems.
+ *SIDENOTE* I suggest that in a single source file module, you define all
+ functions/variables (except global & module_start) as static. This will
+ drastically reduce the size of modules on decent systems.
- In each of these cases MODULE = module name
+ In each of these cases, MODULE refers to the name of your module.
(i) char *MODULE_start(Function *func_table)
- - this module is called when the module is first loaded,
- you MUST do serveral things in this function
- (a) global = func_table; (so you can make eggdrop calls)
- (b) module_register(MODULE_NAME, MODULE_table, major, minor);
- this records details about the module for other modules
- & eggdrop itself to access, major is a major version number,
- minor is a minor version number, MODULE_table is a function
- table (see below)
- (c) module_depend(MODULE_NAME, "another-module", major, minor);
- this lets eggdrop know that your module NEEDS "another-module"
- of major version 'major' and at least minor version 'minor'
- to run and hence should try to load it if it's not already here
- this will return 1 on success, or 0 if it cant be done
- (at which stage you should return an error)
- (d) any other initialization stuff you desire, see below for
- various things you can do.
- (e) a return value of some sort, returning NULL implies the module
- loaded successfully, and so the bot can continue.
- return a non-NULL STRING is an error message, the module
- (and any other dependant modules) will stop loading
- and an error will be returned.
+ - This function is called when the module is first loaded.
+ You MUST do several things in this function:
+ (a) global = func_table; (so you can make eggdrop calls)
+
+ (b) module_register(MODULE_NAME, MODULE_table, major, minor);
+ This records details about the module for other modules
+ and eggdrop itself to access. Major is a major version
+ number, minor is a minor version number, and MODULE_table
+ is a function table (see below).
+
+ (c) module_depend(MODULE_NAME, "another-module", major, minor);
+ This lets eggdrop know that your module NEEDS "another-module"
+ of major version 'major' and at least minor version 'minor'
+ to run, and hence should try to load it if it's not already
+ here. This will return 1 on success, or 0 if it can't be done
+ (at which stage you should return an error).
+
+ (d) Any other initialization stuff you desire should be included
+ in this function. See below for various things you can do.
+
+ (e) a return value of some sort
+ Returning NULL implies the module loaded successfully,
+ therefor the bot can continue. Returning a non-NULL STRING
+ is an error message. The module (and any other dependant
+ modules) will stop loading and an error will be returned.
(ii) static Function *MODULE_table = {
MODULE_start,
@@ -184,168 +219,217 @@
any_other_functions,
you_want_to_export
};
- ok, it's not a function, it's a list of functions, which any
+ Ok, it's not a function. It's a list of functions which any
other module can call up, so you can provide services for other
modules (e.g. transfer has raw_dcc_send in it's table to allow
- the filesys to send files to others)
- the first 4 functions are FIXED, you MUST have them, they
- provide important system info.
+ the filesys to send files to others). The first 4 functions are
+ FIXED. You MUST have them; they provide important system info.
(iii) static char *MODULE_close ()
- - this is called when the module is unloaded..
- apart from tidying any relevant data (I suggest you be thorough,
- we don't want any trailing garbage from modules) you MUST do the
- following:
- (a) module_undepend(MODULE_NAME);
- this lets eggdrop know your module no longer depends on
- any other modules.
- (b) return a value, NULL implies success, non-NULL STRING implies
- the module cannot be unloaded for some reason and hence
- the bot should leave it in (see blowfish for an example)
+ - This is called when the module is unloaded.
+ Apart from tidying any relevant data (I suggest you be thorough,
+ we don't want any trailing garbage from modules), you MUST do
+ the following:
+
+ (a) module_undepend(MODULE_NAME);
+ This lets eggdrop know your module no longer depends on
+ any other modules.
+
+ (b) Return a value. NULL implies success; any non-NULL STRING
+ implies that the module cannot be unloaded for some reason,
+ and hence the bot should not unload it (see blowfish for
+ an example).
(iv) static int MODULE_expmem ()
- this should tally all memory you allocate/deallocate within
- the module (using modmalloc & modfree), it's used by memory
- debugging to track memory faults, and by .status to total up
- memory usage.
+ This should tally all memory you allocate/deallocate within
+ the module (using modmalloc & modfree). It's used by memory
+ debugging to track memory faults, and it is used by .status
+ to total up memory usage.
(v) static void MODULE_report (int idx)
- this should provide a relatively short report of module status
- (for .module/.status)
+ This should provide a relatively short report of the module's
+ status (for .module/.status).
+
+ (3) AVAILABLE FUNCTIONS
+
+ (i) Reliable ones:
+ You can RELY on these functions being available. This is just a
+ short list of the ones you need to make a mildly useful module.
+ A good portion of the remaining eggdrop functions are available,
+ check src/mod/module.h for more information.
+
+ void *nmalloc (int a);
+
+ - allocates a bytes
+
+ void nfree (void *a);
+
+ - frees a modmalloc'd block
+
+ context;
+
+ - actually a #define; records the current position in
+ execution (for debugging)
+
+ void dprintf (int idx,char *format, ... )
+
+ - just like normal printf; outputs to a dcc/socket/server
+
+ idx is a normal dcc idx OR if < 0 is a sock #
+
+ other options:
+ DP_LOG (send to log file)
+ DP_STDOUT (send to stdout)
+ DP_MODE (send via mode queue to server) *fast*
+ DP_SERVER (send via normal queue to server) *normal*
+ DP_HELP (send via help queue to server) - use this
+ for mass outputs to users
+
+ int module_register ( char *module_name,
+ Function *function_table,
+ int major, int minor )
+
+ - see above
+
+ const module_entry *module_find ( char *module_name, int major, int minor);
+
+ - look for a module (matching major, >= minor), and return
+ info about it.
+
+ Members of module_entry:
+
+ char *name; - module name (duh)
+ int major; - real major version
+ int minor; - real minor version
+ Function *funcs; - function table (see above)
+
+ int module_depend ( char *module_name, char *needed_module,
+ int major, int minor )
+
+ - marks your module (module_name) as dependent upon
+ needed_module (matching major, >= minor) and tries to
+ load the required module if it's not already loaded.
+ returns 1 on success
+
+ int module_undepend ( char *module_name)
+
+ - marks your module (module_name) as no longer needing any
+ of it's dependencies
+
+ void module_rename (char *old_module_name, char *new_module_name)
+
+ - renames a module
+
+ void add_hook (int hook_num, Function *funcs)
+ void del_hook (int hook_num, Function *funcs)
+
+ - used for adding removing hooks into eggdrop code on
+ various events, these functions are called depending
+ on the hook
+
+ Valid hooks:
+
+ HOOK_SECONDLY - called every second
+ HOOK_MINUTELY - called every minute
+ HOOK_5MINUTELY - called every 5 minutes
+ HOOK_HOURLY - called every hour (hourly-updates
+ minutes past)
+ HOOK_DAILY - called when the logfiles are switched
+ HOOK_READ_USERFILE - called when the userfile is read
+ HOOK_USERFILE - called when the userfile is written
+ HOOK_PRE_REHASH - called just *before* rehash
+ HOOK_REHASH - called just after rehash
+ HOOK_IDLE - called whenever the dcc connections
+ have been idle for a whole second
+ HOOK_BACKUP - called when a user/channel file
+ backup is done
+ HOOK_LOADED - called when eggdrop is first loaded
+ HOOK_DIE - called when eggdrop is about to die
+
+
+ char *module_load ( char *module_name );
+
+ - tries to load the given module; returns 0 on success, or
+ an error message
+
+ char *module_unload ( char *module_name );
+
+ - tries to unload the given module; returns 0 on success, or
+ an error message
+
+
+ void add_tcl_commands(tcl_cmds *tab);
+ void rem_tcl_commands(tcl_cmds *tab);
+
+ - provides a quick way to create and remove a list of Tcl
+ commands. the table is in the form:
+
+ { char *func_name, Function *function_to_call }
+
+ These are normal Tcl commands (as done in tcl*.c).
+ Use { 0, 0 } to indicate the end of the list.
+
+ void add_tcl_ints(tcl_ints *);
+ void rem_tcl_ints(tcl_ints *);
+
+ - provides a way to add/remove links from c variables to Tcl
+ variables (add checks to see if the Tcl variable already
+ exists and copies it over the C one). the format of table is:
+
+ { char *variable_name, int *variable, int readonly }
+
+ Use {0,0,0}; to indicate the end of the list.
+
+ void add_tcl_strings(tcl_strings *);
+ void rem_tcl_strings(tcl_strings *);
+
+ - provides a way to add/remove links from c strings to Tcl
+ strings (also copies existing Tcl values). the format is:
+
+ { char * variable_name, char *string, int length, int flags }
+
+ Use { 0, 0, 0, 0 } to indicate the end of the list.
+
+ length: set to 0 if you want a const string.
+
+ flags: use STR_DIR if you want a / constantly appended;
+ use STR_PROTECT if you want the variable set
+ in the config file, not during normal usage.
+
+ void putlog (int logmode, char *channel, char *format, ... )
+
+ - logs a comment. see src/eggdrop.h for logmodes.
+
+ void add_builtins (p_tcl_hash_list table, cmd_t *cc);
+ void rem_builtins (p_tcl_hash_list table, cmd_t *cc);
+
+ - the method of adding/remove bindings for Tcl hash tables
+
+ Table is a hash table you find with find_hash_table.
+
+ cc format:
+
+ { char *command, char *flags, Function *function }
+
+ terminate with { 0, 0, 0, 0 }
+
+ this is EXACTLY like a bind command in Tcl (heck, tcl_bind
+ calls the same function this does).
- (c) AVAILABLE FUNCTIONS - this is what ppl want no? :)
- (i) reliable ones, you can RELY on these functions being available,
- they may move in the tables for the moment (since it's a work
- in progress) but they will be there...
- This is just a short list of the ones you need to make
- a mildly useful module, a goodly portion of the remaining
- eggdrop functions are available, check src/mod/module.h for
- info.
-
-void *nmalloc (int a); - allocates a bytes
-void nfree (void *a); - frees a modmalloc'd block
- context; - actually a #define, records the current
- - position in execution, for debugging
-void dprintf (int idx,char *format, ... ) - just like normal printf,
- outputs to a dcc/socket/server,
- idx is a normal dcc idx OR if < 0 is a sock #
- OR one of: DP_LOG (send to log file)
- DP_STDOUT (send to stdout)
- DP_MODE (send via mode queue to server) *fast*
- DP_SERVER (send via normal queue to server) *normal*
- DP_HELP (send via help queue to server) - use this
- for mass outputs to users
-
-int module_register ( char *module_name,
- Function *function_table,
- int major, int minor )
- - see above for what/who/why/etc
-const module_entry *module_find ( char *module_name, int major, int minor);
- - look for a module, (matching major, >= minor) and return
- info about it....members of module_entry...
- char *name; - module name (duh)
- int major; - real major version
- int minor; - real minor version
- Function *funcs; - function table (see above)
-
-int module_depend ( char *module_name, char *needed_module,
- int major, int minor )
- - marks your module (module_name) as needing needed_module
- (matching major, >= minor) and tries to load said module
- if it's not already loaded. returns 1 on success
-int module_undepend ( char *module_name)
- - marks your module as no longer needing any of it's
- dependencies
-void module_rename (char *old_module_name, char *new_module_name)
- - renames a module, this works so that for example, you
- could have efnet.so, undernet.so, ircnet.so & dalnet.so
- and they called all rename themselves as server.so which
- is what you really want
-
-void add_hook (int hook_num, Function *funcs)
-void del_hook (int hook_num, Function *funcs)
-
-used for adding removing hooks into eggdrop code, on various events, these
-functions are called, depending on the hook
-
-valid hooks:
-
-HOOK_SECONDLY - called every second
-HOOK_MINUTELY - called every minute
-HOOK_5MINUTELY - called every 5 minutes
-HOOK_HOURLY - called every hour, (at hourly-updates minutes past)
-HOOK_DAILY - called every day, when the logfiles are switched
-HOOK_READ_USERFILE - called when the userfile is read
-HOOK_USERFILE - called when the userfile is written
-HOOK_PRE_REHASH - called just *before* rehash
-HOOK_REHASH - called just after rehash
-HOOK_IDLE - called whenever the dcc connections have been idle
- for a whole second
-HOOK_BACKUP - called when a user/channel file backup is done
-HOOK_LOADED - called when eggdrop is first loaded
-HOOK_DIE - called when eggdrop is about to die
-
-char *module_load ( char *module_name ); tries to load the given module,
- returns 0 on success, or an error msg
-
-char *module_unload ( char *module_name ); tries to unload the given module,
- returns as above.
-
-void add_tcl_commands(tcl_cmds *tab);
-void rem_tcl_commands(tcl_cmds *tab);
- provides a quick way to load & unload a list of Tcl commands, the
- table is in the form :
- { char *func_name, Function *function_to_call }
- these are normal Tcl commands (as done in tcl*.c)
- use { 0, 0 } to indicate the end of the list
-
-void add_tcl_ints(tcl_ints *);
-void rem_tcl_ints(tcl_ints *);
- provides a way to add/remove links from c variables to Tcl variables
- (add checks to see if the Tcl already exists and copies it over the C one)
- format of table is :
- { char *variable_name, int *variable, int readonly }
- terminate with {0,0,0};
-
-void add_tcl_strings(tcl_strings *);
-void rem_tcl_strings(tcl_strings *);
- provides a way to add/remove links from c strings to Tcl strings
- (also copies exists Tcl values)
- format:
- { char * variable_name, char *string, int length, int flags }
- terminate with { 0, 0, 0, 0 }
- length: set to 0 if you want a const string.
- flags: use STR_DIR if you want a / constantly appended,
- use STR_PROTECT if you want the variable on set in the configfile,
- not during normal usage.
-
-void putlog (int logmode, char *channel, char *format, ... )
- logs a comment, see src/eggdrop.h for logmodes, channel makes
- a channel or "*" for all.
-
-void add_builtins (p_tcl_hash_list table, cmd_t *cc);
-void rem_builtins (p_tcl_hash_list table, cmd_t *cc);
- the method of adding/remove bindings for Tcl hash tables.
- table is a hash table you find with find_hash_table,
- cc format:
- { char *command, char *flags, Function *function }
- terminate with { 0, 0, 0, 0 }
- this is EXACTLY like a bind command in Tcl, (heck, tcl_bind calls
- the same function this does),
- function is called with exactly the same args as a Tcl binding is
- (except for dcc which does include the handle in C) with type conversion
- taken into account (e.g. idx's are ints)
- return much the same as Tcl bindings, use int 0/1 for those
- which require 0/1 or char * for those which require a string (e.g. filt)
- or nothing if no return is required.
- return is also in src/tclhash.c
+ function is called with exactly the same args as a Tcl
+ binding is (except for dcc, which does include the handle
+ in C) with type conversion taken into account (e.g. idx's
+ are ints). return is much the same as Tcl bindings, use int
+ 0/1 for those which require 0/1, or char * for those which
+ require a string (e.g. filt). return nothing if no return
+ is required. return is also in src/tclhash.c
-VI. WHAT TO DO WITH A MODULE?
+VI. WHAT TO DO WITH A MODULE?
If you have written a module and feel that you wish to share it with the
rest of the eggdrop community, upload it to the incoming directory on
incoming.eggheads.org(/incoming/modules/1.6). Place a nice descriptive
- text with it and it'll make its way to the modules directory on
- ftp.eggheads.org. Don't forget to mention in your text file which
- version eggdrop the module is writen for.
+ text with it, and it'll make its way to the modules directory on
+ ftp.eggheads.org. Don't forget to mention in your text file which
+ version eggdrop the module is written for.
\ No newline at end of file
Index: eggdrop1.6/doc/UPDATES1.6
diff -u eggdrop1.6/doc/UPDATES1.6:1.252 eggdrop1.6/doc/UPDATES1.6:1.253
--- eggdrop1.6/doc/UPDATES1.6:1.252 Tue Dec 18 11:19:25 2001
+++ eggdrop1.6/doc/UPDATES1.6 Tue Dec 18 11:21:34 2001
@@ -1,10 +1,11 @@
-$Id: UPDATES1.6,v 1.252 2001/12/18 17:19:25 guppy Exp $
+$Id: UPDATES1.6,v 1.253 2001/12/18 17:21:34 guppy Exp $
Changes in eggdrop: (since v1.6.0)
----------------------------------
1.6.8
Found by Fixed by What...
+ Wcc yet more documentation updates
ziffie BHAB Documentation doesn't cover how to connect to servers with
a password; documentation added to sample config files.
|^Raven^| guppy made tcl_hand2nick _a lot_ faster
Index: eggdrop1.6/doc/patch.howto
diff -u eggdrop1.6/doc/patch.howto:1.9 eggdrop1.6/doc/patch.howto:1.10
--- eggdrop1.6/doc/patch.howto:1.9 Sun Nov 4 22:08:26 2001
+++ eggdrop1.6/doc/patch.howto Tue Dec 18 11:21:35 2001
@@ -1,15 +1,13 @@
-PATCH HOWTO v1.2 29 May 2000
-
+PATCH HOWTO v1.3 18 Dec 2001
INDEX
-I. ABOUT THIS DOCUMENT
-II. TERMS USED
-III. APPLYING A PATCH
-IV. DOING AND SUBMITTING PATCH
-V. DOWNLOADING A PATCH
-
+I. ABOUT THIS DOCUMENT
+II. TERMS USED
+III. APPLYING A PATCH
+IV. CREATING AND SUBMITTING A PATCH
+V. DOWNLOADING A PATCH
@@ -17,81 +15,70 @@
I. ABOUT THIS DOCUMENT
-The purpose of this document is to show you what a patch is and how you
-can apply a patch.
-
-
-
+ The purpose of this document is to show you what a patch is and how you
+ can apply a patch.
II. TERMS USED
-The following are some common terms used in this document.
-If applicable, there is also the associated command named.
-
-
- patch
- A patch is an update for a sourcecode of a program (here eggdrop). Be
- careful, every patch is designed for a special eggdrop version and
- cannot be applied on every bot!
-
-
-
-
-
-III. APPLYING A PATCH
-
-To apply a patch to an eggdrop you have to get first the sourcecode of
-it (you should always keep a tar.gz archive with the source of your
-current eggdrop on your shell). In the next step you have to change to
-your current source directory (i.e.: /home/user/eggdrop1.6.0/) and type
-the following command:
-
-patch -p1 < ../path.to.the/patch
-
-Once this is complete, execute the following command:
+ The following are some common terms used in this document.
+ If applicable, there is also the associated command named.
+
+ patch
+ A patch is an update for a sourcecode of a program (here eggdrop). Be
+ careful, every patch is designed for a special eggdrop version and
+ cannot be applied on every bot!
-find . -name "*.rej" -print
-If it returns a list with filenames ending with .rej extension then the
-patch didn't apply properly. Ensure that the patch is intended for your
-version and that you have the original source. You should also try to
-re-download the patch to ensure, that the patch is not corrupted.
+III. APPLYING A PATCH
-If the patch applied properly the only thing left to do is to recompile
-your eggdrop and install the new modules and binaries.
+ To apply a patch to an eggdrop, you have to first obtain the eggdrop
+ sourcecode. You should always keep a tar.gz archive with the source of
+ your current eggdrop on your shell. In the next step, you have to change
+ to your source directory (i.e.: /home/user/eggdrop1.6.0/) and type
+ the following command:
+ patch -p1 < ../path.to.the/patch
+ Once this is complete, execute the following command:
+ find . -name "*.rej" -print
+ If it returns a list with filenames ending with .rej extension, then the
+ patch didn't apply properly. Ensure that the patch is intended for your
+ version and that you have the original source. You should also try to
+ re-download the patch to ensure that the patch is not corrupted.
-IV. DOING AND SUBMITTING PATCH
+ If the patch applied properly, the only thing left to do is to recompile
+ your eggdrop and install the new modules and binaries.
-If you fixed a bug and changed something in eggdrop's source code it would
-be really nice to let the dev team know about it, so they can apply it to next
-eggdrop release.
-There are several steps to submit a patch to the eggdev team:
-1. make a directory with orig. source tree and one with modified source tree
-2. do a 'diff -bur eggdrop1.6.original eggdrop1.6.modified > myfirst.patch'
-3. send an email to patches@eggheads.org with the patch attached and a detailed
- description of what you changed and why you changed it. Don't forget to write
- for which botversion your patch was made. Please send a second email with
- same info to eggdev@eggheads.org, this time without the patch attached.
+IV. CREATING AND SUBMITTING A PATCH
+ If you fixed a bug and changed something in eggdrop's source code, it would
+ be really nice to let the dev team know about it, so they can possibly apply
+ it to next release of eggdrop.
-Please, never patch src/patch.h or one of the UPDATES files. We will do it.
-Thank you.
+ There are several steps to submit a patch to the eggdev team:
+ 1. Create a directory with original source tree and one with modified source tree.
+ 2. Run 'diff -bur eggdrop1.6.original eggdrop1.6.modified > patchname.patch'. If
+ your changes created any new files, use 'diff -burN' instead.
+ 3. Send an email to patches@eggheads.org with the patch attached. The body should
+ contain a detailed description of what you changed and why you changed it. Don't
+ forget to include the botversion for which your patch was made. Also, please send
+ a second email with same info to eggdev@eggheads.org, this time without the patch
+ attached.
-V. DOWNLOADING A PATCH
+ Please, never patch src/patch.h or one of the UPDATES files. We will do it.
+ Thank you.
-All patches for eggdrop1.6.x can be found on ftp.eggheads.org in
-/pub/eggdrop/patches/1.6
+V. DOWNLOADING A PATCH
+All patches for eggdrop1.6.x can be found at the following location:
-Hope that this document helped you in some way...
+ftp.eggheads.org/pub/eggdrop/patches/1.6
Index: eggdrop1.6/doc/settings/CONTENTS
diff -u eggdrop1.6/doc/settings/CONTENTS:1.1 eggdrop1.6/doc/settings/CONTENTS:1.2
--- eggdrop1.6/doc/settings/CONTENTS:1.1 Thu Dec 13 23:44:52 2001
+++ eggdrop1.6/doc/settings/CONTENTS Tue Dec 18 11:21:35 2001
@@ -52,7 +52,4 @@
Documentation for the wire module is provided in this file.
mod.woobie
- Documentation for the woobie module is provided in this file.
-
-tricks
- This document contains tweaking tips for your config file.
\ No newline at end of file
+ Documentation for the woobie module is provided in this file.
\ No newline at end of file
Index: eggdrop1.6/doc/settings/mod.compress
diff -u eggdrop1.6/doc/settings/mod.compress:1.4 eggdrop1.6/doc/settings/mod.compress:1.5
--- eggdrop1.6/doc/settings/mod.compress:1.4 Thu Dec 13 23:43:11 2001
+++ eggdrop1.6/doc/settings/mod.compress Tue Dec 18 11:21:35 2001
@@ -1,7 +1,7 @@
##### COMPRESS MODULE #####
This module provides provides support for file compression. This allows the
-bot to transfer compressed user files and therefore save a significant amount
+bot to transfer compressed user files and, therefore, save a significant amount
of bandwidth.
This module requires: share
Index: eggdrop1.6/doc/settings/mod.transfer
diff -u eggdrop1.6/doc/settings/mod.transfer:1.4 eggdrop1.6/doc/settings/mod.transfer:1.5
--- eggdrop1.6/doc/settings/mod.transfer:1.4 Thu Dec 13 23:43:11 2001
+++ eggdrop1.6/doc/settings/mod.transfer Tue Dec 18 11:21:35 2001
@@ -1,8 +1,7 @@
##### TRANSFER MODULE #####
The transfer module provides dcc send/get support and userfile transfer
-support for userfile sharing. Un-comment the next line to load it if you
-need this functionality.
+support for userfile sharing.
This module requires: none
Index: eggdrop1.6/doc/tcl-commands.doc
diff -u eggdrop1.6/doc/tcl-commands.doc:1.58 eggdrop1.6/doc/tcl-commands.doc:1.59
--- eggdrop1.6/doc/tcl-commands.doc:1.58 Sun Nov 11 14:24:44 2001
+++ eggdrop1.6/doc/tcl-commands.doc Tue Dec 18 11:21:35 2001
@@ -1291,17 +1291,17 @@
is considered parsed; otherwise the bot will use the text returned
from the proc and continue parsing that
-| (29) NEED (stackable)
-| bind need <flags> <mask> <proc>
-| procname <channel> <type>
-|
-| this bind is triggered on certain events, like when the bot needs
-| operator status or the key for a channel; the types are: op, unban,
-| invite, and key; the <mask> in the bind is matched against
-| "#channel type" and can contain wildcards; flags are ignored
-|
-| example: bind need - "% op" needop < handles only need op
-| bind need - "*" needall < handles all needs
+ (29) NEED (stackable)
+ bind need <flags> <mask> <proc>
+ procname <channel> <type>
+
+ this bind is triggered on certain events, like when the bot needs
+ operator status or the key for a channel; the types are: op, unban,
+ invite, and key; the <mask> in the bind is matched against
+ "#channel type" and can contain wildcards; flags are ignored
+
+ example: bind need - "% op" needop < handles only need op
+ bind need - "*" needall < handles all needs
(30) FLUD (stackable)
bind flud <flags> <type> <proc>
Index: eggdrop1.6/doc/text-substitutions.doc
diff -u eggdrop1.6/doc/text-substitutions.doc:1.6 eggdrop1.6/doc/text-substitutions.doc:1.7
--- eggdrop1.6/doc/text-substitutions.doc:1.6 Sun Dec 2 01:17:24 2001
+++ eggdrop1.6/doc/text-substitutions.doc Tue Dec 18 11:21:35 2001
@@ -6,31 +6,48 @@
There are a few %-variables you can insert into the motd, which will
be interpreted by eggdrop:
+There are four variables that can be used to format text:
+
%b display bold
%v display inverse
%_ display underline
%f display flashing via telnet, bold underline via irc
+
+These variables will be replaced in the MOTD by their respective values:
+
%B bot's nickname (i.e., "LamestBot")
%V current eggdrop version (i.e., "eggdrop v1.6.0")
%E long form of %V (i.e., "Eggdrop v1.6.0 (c)1997 Robey Pointer (c)1999, 2000 Eggheads")
%C channels the bot is on (i.e., "#lamest, #botnetcentral")
- %A whatever is set in 'admin' (see 'set admin')
- %n whatever is set in 'network' (see 'set network')
+ %A whatever is set in the config file by 'set admin'
+ %n whatever is set in the config file by 'set network'
%T the current time (i.e., "15:00")
%N the current user's nickname (i.e., "Robey")
- %U the current operating system the bot is on
+ %U the current operating system the bot is running on
%% a percent sign ("%")
You can also encode messages which can only be read by people
with certain flags:
- %{+m}Only masters would see this.%{-}
- %{+A}Only people with user flag #A see this.%{-}
- %{+b}This is only displayed to users doing a remote '.motd'
- from another bot.%{-}
- %{+|m}Only channel masters would see this.%{-}
- Other extended % commands are:
+ %{+m}
+ Only masters would see this.
+ %{-}
+
+ %{+A}
+ Only people with user flag A see this.
+ %{-}
+
+ %{+b}
+ This is only displayed to users doing a remote '.motd' from another bot.
+ %{-}
+
+ %{+|m}
+ Only channel masters would see this.
+ %{-}
+
+ Other variables:
+
%{cols=N} start splitting output into N columns
- %{cols=N/W} same, but use a screen width of W
+ %{cols=N/W} same as above, but use a screen width of W
%{end} end calumniated or restricted (i.e. %{+m}) block
- %{center} center the following text (70 columns)
+ %{center} center the following text (70 columns)
\ No newline at end of file
Index: eggdrop1.6/doc/tricks
diff -u eggdrop1.6/doc/tricks:1.7 eggdrop1.6/doc/tricks:1.8
--- eggdrop1.6/doc/tricks:1.7 Sun Nov 11 14:24:45 2001
+++ eggdrop1.6/doc/tricks Tue Dec 18 11:21:35 2001
@@ -1,47 +1,74 @@
-Some little tricks that you may or may not know about...
+Here are some little tricks that you may or may not know about.
-* You can "lock" a user's info line by putting a '@' as the first letter.
+- You can "lock" a user's info line by putting an '@' as the first letter.
They won't be able to change it any more.
-* '.status all' will dump out virtually everything you have configured on
- your bot
+- '.status all' will dump out virtually everything you have configured on
+ your bot.
-* Tcl has a command 'info body <proc>' that will list the contents of a
- proc. 'info args <proc>' shows what you have defined as the parameters
+- Tcl has a command 'info body <proc>' that will list the contents of a
+ proc. 'info args <proc>' shows what you have defined as the parameters
for the proc.
-* You can rename a built-in command by binding over it. To rename '.status'
+- You can rename a built-in command by binding over it. To rename '.status'
to '.report', you'd do:
unbind dcc - status *dcc:status
bind dcc m report *dcc:status
+
The first line removes the built-in binding on '.status', and the second
line binds '.report' to the built-in status function. Other built-in command
examples include:
+
unbind msg - status *msg:status
bind msg m report *msg:status
- and:
+
+ Also:
+
unbind fil - share *fil:share
bind fil m link *fil:share
-* You can unlink all bots and clear out the botnet info from memory by
- using '.unlink *'. It erases all channel assoc's and everything.
+- You can unlink all bots and clear out the botnet info from memory by
+ using '.unlink *'. It erases all channel assoc's and everything.
-* You can automagically make a ban sticky by adding a * as the first
+- You can automatically make a ban sticky by adding a * as the first
character in the ban reason.
-* You can add a user with a static hostmask when using .adduser by prefixing
- their nick by !.
- i.e. with a hostmask of drummer!ident@some.host.com
+- You can add a user with a static hostmask when using .adduser by prefixing
+ their nick with '!'.
+
+ For example, with a hostmask of drummer!ident@some.host.com:
+
.adduser drummer
- uses *!ident@*.host.com
+ Hostmask: *!ident@*.host.com
.adduser !drummer
- uses *!ident@some.host.com
+ Hostmask: *!ident@some.host.com
-* If you don't want your logfiles to be deleted after two days and
+- If you don't want your logfiles to be deleted after two days and
don't want the bot to create a new logfile each new day, then set
'keep-all-logs' to 0 and 'switch-logfiles-at' to 2500 in your bot
- config file to make it keeping one logfile all the time. However this
- is not recommended on high traffic channels.
+ config file to make it keeping one logfile all the time. However,
+ this is not recommended on high traffic channels.
+
+- You can modify eggdrop's output in the partyline, kick messages,
+ and other texts by editing core.english.lang in the language directory.
+
+As your botnet grows bigger, and you have to maintain more and more bots
+with their config files, you might render these little tweaking tips useful:
-* You can modify eggdrop's output in partyline, kick msg and other texts by
- editing core.english.lang in the language directory.
+- Config file split:
+ You can export parts of your config file to separate files. For example,
+ if you have several config files which differ from themselves only by
+ the nickname and the used servers, you can export them to an own file
+ and link it with the 'source' Tcl command, similar to a script. The
+ advantage of this is that you have to edit/upload only the small file
+ instead of the big one. This technique is also useful if you want to
+ maintain the same channel settings, etc.
+
+- Variable usage in the config file:
+ You can use variables in your config file, since it's really just a plain
+ Tcl file. For example, you can set 'userfile' and 'chanfile' to "yourbot.user"
+ and "yourbot.chan" using the following method:
+
+ set myvar "yourbot"
+ set userfile "$myvar.user"
+ set chanfile "$myvar.chan"
\ No newline at end of file
Index: eggdrop1.6/src/patch.h
diff -u eggdrop1.6/src/patch.h:1.629 eggdrop1.6/src/patch.h:1.630
--- eggdrop1.6/src/patch.h:1.629 Tue Dec 18 11:19:26 2001
+++ eggdrop1.6/src/patch.h Tue Dec 18 11:21:35 2001
@@ -10,7 +10,7 @@
* statement, leave the rest of the file alone, this allows better
* overlapping patches.
*
- * $Id: patch.h,v 1.629 2001/12/18 17:19:26 guppy Exp $
+ * $Id: patch.h,v 1.630 2001/12/18 17:21:35 guppy Exp $
*/
/*
* Copyright (C) 1997 Robey Pointer
@@ -41,12 +41,12 @@
*
*
*/
-patch("1008695570"); /* current unixtime */
+patch("1008696001"); /* current unixtime */
/*
*
*
*/
-patch("servdocfix");
+patch("docupdates");
/*
*
*
----------------------- End of diff -----------------------