                     MudBot version 2.07 by Drow
                     ---------------------------

1- Introduction
2- Installation
3- Some help
4- Copyright
--------------------------------------------------------------------------
Introduction
--------------------------------------------------------------------------
QUICK INSTALL: Just read the "installation and start the bot" section.

This bot has been made to be a friendly channel bot. It is very
customizable and has many commands. It should work fine on Linux,
MKlinux, SunOS, Solaris, FreeBSD and DEC Alpha but unfortunatly does not
work on BSDi or AIX. Read below for notes about SunOS, MKlinux, FreeBSD 
and Alpha. You should go read the MudBot manual at the webpage for full
help. If you have questions, ask me at drow@wildstar.net

The official web site is http://www.mudbot.org
Mirror site is http://www.wildstar.net/~drow

This bot has been made by Drow, with some socket / parse 
functions by WildThang

--------------------------------------------------------------------------
Installation
--------------------------------------------------------------------------

Installing and start the bot:
-----------------------------
untar it
run config with the proper option (or Xconfig)
edit config.h
change the *.file to match you
syntax for user.file is: level:nick:u@h:pass:validate:autoop:email: 
make clean (note: nevermind an error on that command)
make (note: there will be warnings but shouldnt be any error here)
edit "reloadbot" script, and set it up for your bot
use a crontab with that script
mudbot server.name port
/msg botname !validate your-password

Note: You have to make clean then make at each change you make in config.h
Note: See umodes.txt for info on how to set the UMODES for Undernet IRC
Note: All the *.file files must never contain blank lines. They must
be either empty (0 bytes) or contain proper syntax.

Installing a crontab:
---------------------
Even if it's supposed to restart on server error, you should
put the bot on a crontab. Here is how most works:
% crontab -<enter>
<enter>
5,10,15,20,25,30,35,40,45,50,55 * * * * /home/ur_login/mudbot/reloadbot
<ctrl+d>
Don't forget to edit reloadbot.

Note for SunOS/Solaris users:
-----------------------------
For SunOS, do the following before making the bot:
add the following to config.h:
#define FNDELAY O_NONBLOCK
And to the Makefile:
LIBS = -lsocket -lresolv -lnsl
You might also need to #undef POSIX in vars.h
Then everything should compile ok.

Note for DEC Alpha users:
-------------------------
Add -lcrypt in the config for all 'cc -o -w' and in the Makefile beside
'LIBS='.

Note for FreeBSD users:
-----------------------
Add -lcrypt to the Makefile.
You might also need to #undef POSIX in vars.h

Note for MKlinux users:
-----------------------
Add -lcrypt in the config at the 'LIBS=' part.

Xconfig for Xwindows system
---------------------------
You can run Xconfig from an Xwindows system if you have tcl7.5 and tk4.1
installed.

Mailing list
------------
MudBot now has a mailing list!
Send mail to majordomo@sn.no with 'subscribe mudbot-irc' in the body.
To mail the list, email mudbot-irc@sn.no
 
--------------------------------------------------------------------------
Some help
--------------------------------------------------------------------------

Vote command:
-------------
You can now vote on different subjects
Just put the first line of vote.file as the vote subjects, and the next
lines with the choices, up to 9 choices. Anyone can then vote by typing
!vote in a channel.

FTP manager:
------------
You can manage a system's anonymous FTP server from IRC. Use the ftp
command to know what to do. A known bug is when the system uses a
'colorfull' ls command. In that case it might not work with FTP. You
should be able to get and compile an other version from:
ftp://gatekeeper.dec.com/pub/BSD/FreeBSD/FreeBSD-current/src/bin/ls

Use as IRC client:
------------------
You can use MudBot as an IRC client to do limited functions with the
bot. Just change:
#define BACKGROUND
and
#undef VIEW
for:
#undef BACKGROUND
and
#define VIEW
DO NOT PUT A CRONTAB IF YOU'RE USING IT AS IRC CLIENT!!

Commands:
---------
All commands are done via /msg or in a channel (note even in a channel
you need to specify the channel name ie. !kick #channel nick)
/msg botname !command param
Type /msg botname !help  for a list of commands
You can get help on some commands with !help <command>
Before anything, you must validate:
/msg botname !validate your-pass

Local file:
-----------
You can add users to have access to certain channels only
by doing the following:
!adduser nick u@h level pass autoop email
!rehash
revaliate yourself....
!addlocal nick channel1 channel2 channel3 ... dummy
the dummy is VERY important. You can add up to 5 channels.
Then to get op, just type /msg botname !up #channel pass
You can use !locallist to list all local users or !findlocal
to find everyone that have local access to it.

Aliases:
--------
This is the scripting part of MudBot. You can list scripts you want
to load in alias.file:
<script-name> <type>
There are many examples with this version of MudBot. Here are two of them:

report-script.mudscript is a script that reports everything the bot sees
in the REPORTS channel. To make the bot load it, add:
report-script.mudscript script
in alias.file

bar-help.mudscript is a script that auto-msg everyone that joins a channel
To include it add:
bar-help.mudscript script
in alias.file
Note that alias.file is a place to list scripts you want the bot to load.
You must *not* put any scripting commands in it.

* Basic scripting:
Syntax: <code><word> <level> <thing to say>
Example:
:bbl 0 Come back soon!
Anyone saying bbl would make the bot say "Come back soon".
You can also use * and ? in those like: *mudbot*
* on_word:
Syntax: on_word <word> <level> <raw command>
Example:
on_word *fuck* 0 KICK $channel $nick :Don't use this word here!
This will make the bot kick when someone has 'fuck' in a sentence.
* on_connect:
Syntax: on_connect <raw command>
Example:
on_connect PRIVMSG $reports :My-Script up and ready!
* on_wallops:
Syntax: on_wallops <nick> <raw command>
Example:
on_wallops PRIVMSG $nick :You like wallops hey?
* on_nick
Syntax: on_nick <new nick> <raw commands>
Example:
on_nick * PRIVMSG $word 0 :You like to change nicks?
* on_join:
Syntax: on_join <channel> <nick> <raw command>
Example:
on_join #* *fuck* KICK $channel $nick :Dont use that nick here!
* on_part:
Syntax: on_part <channel> <raw command>
Example:
on_part #* NOTICE $nick :Come back soon!
* on_botnick:
Syntax: on_botnick <level> <on word> <raw command>
This is when someone says the bot's nick in the begining of a sentence.
Example:
on_botnick 0 * PRIVMSG $channel :Sup?
* on_numeric:
Syntax: on_numeric <numeric> <raw command>
Example:
on_numeric 475 PRIVMSG $reports :I cant go there! it needs a key!
* on_mode:
Syntax: on_mode <channel> <mode> <dont react when bot is> <raw command>
Example:
on_mode #* *+b* 1 NOTICE $nick :Hey! why do you ban on MY channel??
put a 0 to make the bot reacts even if it makes the mode change, 1 if not.
* on_topic
Syntax: on_topic <raw command>
Example:
on_topic TOPIC $channel :This is the best channel, and DONT CHANGE MY TOPIC!
* on_kick
Syntax: on_kick <channel> <raw command>
Example:
on_kick #* KICK $channel $nick :I do the kicking around here!
* on_quit
Syntax: on_quit <nick> <raw command>
Example:
on_quit * PRIVMSG $reports :Blah... $nick left :(
* if
Syntax: if <mask|mask_from_file> <com type> <masked u@h|file> <raw command>
Example:
if mask JOIN *@lame.isp.com KICK $channel $nick :We dont want your kind here
* ifnot
Syntax: ifnot <mask|mask_from_file> <com type> <masked u@h|file> <raw command>
Example:
ifnot mask_from_file JOIN lamers.file MODE $channel +v $nick

In all the on_... you can use * and ? in the word, and $channel, $nick,
$userhost, $word <#>, $timer <timer number (1 to 200)> <time before
activation in secs> <raw command> (note that $channel and $nick are
available within $timer), $string <word #>, $cmdchar, $botnick, $exec
<shell program> and $reports in the raw command. Where $reports is the
channel you defined as REPORTS in config.h, and $string shows every word
you said after <word #>. $m is also available for on_word as a /me, and
$tcl to run tcl scripts (note that eggdrop's scripts aren't supported, as
they are all eggdrop addons, and not native tcl).
Note that the 'if' and 'ifnot' if used with a file, the file must contain
a list of <masked user@host> <dummy data>. See the addons-script.mudscript
script for an example. 

More on MudScripts is available at http://www.mudbot.org/mudscripts

Sharing user files:
-------------------
It is now possible for a bot to send his userfile to an other bot. You
must do a !leaf command on the receiving bot, and a !share command on the
sending bot. THE LEAF BOT'S USERFILE WILL BE ERASED AND REPLACED. You must
define SHARE_USERFILE in config.h for this to work.

Interactive web interface:
--------------------------
It's now possible for anyone to send commands to the bot as level 1 user.
All you have to do is define INTER_WEB in config.h, and have root move the
writetext.cgi into the system's cgi-bin dir. There, I suggest you make
him/her change the owner to the owner of httpd, usualy 'nobody' (chown
nobody /whatever/httpd/cgi-bin/writetext.cgi), set it the exec flag (chmod
755 /whatever/httpd/cgi-bin/writetext.cgi) and create a directory in your
MudBot's dir with the same owner as the http server is, also called
'nobody' (mkdir /home/your-login/mudbot/writetext; chown nobody
/home/your-login/mudbot/writetext)
That's all! Sorry it is so complex but the way httpd works, on most
systems you cant have a cgi in your own directory, it has to be in the
system's cgi-bin. Note that each mudbot must have his writetext.cgi.
That part of MudBot is still in a beta state and can contain bugs.
Mail me if you find any. I'll try to add password auth stuff so users can
send more then level 1 commands from the web.
Here is a mail you could send your root asking for all that I just said:
To: root
Subject: a new bot
Dear root,
 Could you do the following things to improve my enjoyment of IRC please:
cp /home/<my-account>/mudbot/writetext.cgi /<htdocs-root>/cgi-bin/writetext.cgi
chown nobody /<htdocs-root>/cgi-bin/writetext.cgi
chmod 755 /<htdocs-root>/cgi-bin/writetext.cgi
mkdir /home/<my-account>/mudbot/writetext
chown nobody /home/<my-account>/mudbot/writetext
 Thanks for this great shell your running....     Signed: User #01

Command line:
-------------
Syntax: mudbot [-hfvc|<server name> <port>]
-h             help
-f             redirect output to output.file
-v             version
-c             check config (also available with config -check)

TCL:
----
MudBot now supports TCL scripts in MudScript's on_word, on_part, on_join, 
on_connect, on_quit. Note that it does not support eggdrop's scripts since
most are only eggdrop's addons and not native TCL. Many TCL scripts are
included in this version of MudBot. All are included in 
addons-script.mudscript. You can try them out by including that
MudScript (See the "aliases" section) and use the !help+ command. Also
see the MudBot's web page for more. The command passed to a TCL script is
what you write after the command to start it. All commands the script
wants to return must go in a special file: .tcl_tmp.file. Note that the
bot will execute any command in that file, so it can be a security risk if
other people have write access to your account. You can disable TCL
support by changing: 
#define TCL_INT "tclsh"
by:
#undef TCL_INT
in vars.h

Scan:
-----
With the !addscan, !scan and !clearscan commands, you can add a masked
nick!user@host to the bot list, and every time a nick!user@host matching
it enters a channel, it will record it. !scan <masked nick!user@host> will
say everyone recorded by the bot maching that. !clearscan will reset the
scanning list of n!u@h to nothing.

--------------------------------------------------------------------------
Copyright
--------------------------------------------------------------------------

This bot has been made by Drow (drow@wildstar.net)
This bot and all its files are copyright 1997 by Patrick Lambert. You
can copy it in its full form, without modifying or removing any file.
You can modify it for *personal use* only. I don't want people to get
this code from other sources that could have backdoors or bugs in it,
so please head this warning.
There is no warranty, implied or whatever.
You are responsible of what you do with it or what it does to you
or your system.
