[project @ 2002-07-07 02:33:51 by unknown_lamer]
[clinton/bobotpp.git] / doc / index.html
diff --git a/doc/index.html b/doc/index.html
new file mode 100644 (file)
index 0000000..b05ba84
--- /dev/null
@@ -0,0 +1,547 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<html>
+  <head>
+    <title>Bobot++ - an IRC bot</title>
+  </head>
+
+  <body bgcolor="white">
+    <h1>Bobot++ - an IRC bot</h1>
+
+    <p>First, if you don't know what is a bot or if you don't know what 
+      is IRC, you're at the wrong place, sorry :-)</p>
+
+    <h2>Introduction</h2>
+
+    <p>The <em>bobot++</em> is an IRC bot written in C++. This is the
+      evolution of the <em><a
+          href="http://www.via.ecp.fr/~hugo/bobot.html">bobot</a></em>
+      that I wrote in C with <a
+        href="http://www.via.ecp.fr/~hugo/">Bartman</a>.</p>
+
+    <p>The <em>bobot</em> was a powerful bot, but it was limited to an
+      unique channel, and an unique bot per process. The
+      <em>bobot++</em> is designed to support as many channels as you
+      want (in the limit of 20 channels, but this limit is set by the
+      servers). Moreover, it will support multithreading easily (all
+      the objects are thread-safe).</p>
+
+    <p>Here is a non comprehensive list of the <em>bobot++</em>'s
+      features:</p>
+
+    <ul>
+      <li>No backdoor: there is no backdoors in the
+        <em>bobot++</em>. You are free to believe me or not, but
+        unlike many other bots, this one has no backdoor. Note that
+        there is an hidden command, but this command is not designed to
+        take control of the bot,</li>
+      <li>Multichannel: A <em>bobot++</em> can join as many channels
+        as you want,</li>
+      <li>Flood control: It will ignore people flooding it,</li>
+      <li>Output rate control and priority handling: The
+        <em>bobot++</em> will send its commands to the server at the
+        highest possible rate (ie as fast as possible without making
+        an ``excess flood''). The most important commands (MODE's,
+        etc.) are sent first,</li>
+      <li>Time dependant commands: you can ban people for a fixed
+        amount of time. This is really useful in order not to fill the 
+        banlist, [NOT YET FINISHED]</li>
+      <li>Complex online help system: each user can have the list of
+        the commands he can execute. Each command has its description
+        in the help system,</li>
+      <li>Four user levels (user, trusted user, friend and master),
+        three different protections (no kick, no ban and no deop) and
+        possible auto-op. Note that trusted user is created to permit
+        the use of wildcards on dangerous commands such as
+        <tt>kick</tt>, or <tt>ban</tt>,</li>
+      <li>Support for combined join and channel op of 2.9 servers on
+        IRCNet (this feature will be suppressed from the servers, but
+        it may remain useful...),</li>
+      <li>Logging of commands and events,</li>
+      <li>``Intelligent'' ban and deban,</li>
+      <li>Password protection on accounts, expiration dates on user
+        accounts,</li>
+      <li>Anti-spoof: one can not acquire operator priviledges spoofing
+        the bot</li>
+    </ul>
+
+    <h2>Downloading the bobot++</h2>
+
+    <p>You can get the latest version of the bobot++ from this site
+      <em>only</em>. Here is the current version:</p>
+
+    <p><a href="bobot++.1.0.tgz">Download the 1.0 version</a></p>
+    <p><a href="bobot++.1.2.tgz">Download the 1.2 version</a></p>
+    <p><a href="bobot++.1.4.tgz">Download the 1.4 version</a></p>
+
+    <p>Note that revision numbers 1.1 and 1.3 were development
+      versions only.</p>
+
+    <h2>Change log</h2>
+
+    <p>Changes since version 1.2:</p>
+
+    <ul>
+      <li>Fixed a memory leak in the <tt>UserList::load()</tt>
+        function.</li>
+      <li>Added antispoofing code (the bot pings before
+        auto-opping)</li>
+      <li>Added password protection of user accounts.</li>
+      <li>Added expiration on user accounts</li>
+    </ul>
+
+    <h2>Compiling the bobot++</h2>
+
+    <p>Compiling the <em>bobot++</em> is rather simple. You will only
+      need an Un*x-like system and a C++ compiler supporting the
+      Standard Template Library (STL).</p>
+
+    <p>The <em>bobot++</em> compiles fine under the following
+      operating systems:</p>
+
+    <ul>
+      <li>Linux 2.0.x and g++ version 2.7.2.3,</li>
+      <li>HP-UX version 9.x and 10.x and g++ version 2.7.2,</li>
+      <li>SunOS 4.1 and g++.</li>
+    </ul>
+
+    <p>It should compile easily on many other POSIX compliant
+      systems.</p>
+
+    <p>First, you will have to edit the <tt>Makefile</tt> if your C++
+      compiler is not g++. Change the line:</p>
+
+    <pre>CXX=g++</pre>
+
+    <p>With some Un*ces, you will have to link the program with some
+      extra libraries. Change the line:</p>
+
+    <pre>LIBS=</pre>
+
+    <p>For example, you will need this line with Solaris:</p>
+
+    <pre>LIBS=-lsocket -lnsl</pre>
+
+    <p>Then you should be ready to compile the program. Type
+      <tt>make</tt> at the prompt. If you get an error, please try and 
+      fix it before emailing me...</p>
+
+    <p>Now, you should have a executable file named <tt>bobot++</tt>
+      in the directory. This is it! We will have to configure the bot, 
+      now...</p>
+
+    <h2>Configuring the bobot++</h2>
+
+    <h4>General configuration</h4>
+
+    <p>Edit the example file <tt>bot.conf</tt> to suit your needs. The 
+      comments in the file should be self explanatory...</p>
+
+    <p>Here is an example:</p>
+
+    <pre>nick = Bobot
+username = bot
+cmdchar = !
+userlist = bot.users
+logfile = log
+server = irc.eurecom.fr
+server = irc.emn.fr
+server = irc.enst.fr
+server = salambo.enserb.u-bordeaux.fr
+channel = #test1
+channel = #test2 key</pre>
+
+    <p>The bot will be named <em>Bobot</em>, more precisely
+      <em>Bobot!bot@your.machine.com</em>. Its command char will be
+      '!'. It will find its user list in the file <tt>bot.users</tt>,
+      and it will have three servers in its server list. The log will
+      be written to the file <tt>log</tt>. It will join two channels:
+      #test1 and #test2 with <tt>key</tt> as the channel key
+      (remember, the +k mode for channels...).</p>
+
+    <p>If you omit one of these configuration options, a default value 
+      will be used.</p>
+
+    <p>Comments begin with ``#'' (at the first column only), and here
+      is the meaning of all configuration options. Note that there are 
+      synonyms.</p>
+
+    <table border="1">
+      <tr>
+        <th>Syntax</th>
+        <th>Default value</th>
+        <th>Meaning</th>
+      </tr>
+      <tr>
+        <td>NICK=&lt;nickname&gt;<br>
+          NICKNAME=&lt;nickname&gt;</td>
+        <td>Bobot</td>
+        <td>This is the nickname of the bot</td>
+      </tr>
+      <tr>
+        <td>USERNAME=&lt;username&gt;</td>
+        <td>bot</td>
+        <td>The username of the bot, if there is no <tt>identd</tt> daemon</td>
+      </tr>
+      <tr>
+        <td>IRCNAME=&lt;ircname&gt;<br>
+        REALNAME=&lt;ircname&gt;</td>
+        <td>I'm a bobot++!</td>
+        <td>The ircname of the bot</td>
+      </tr>
+      <tr>
+        <td>CMDCHAR=&lt;command&nbsp;char&gt;<br>
+        COMMAND=&lt;command char&gt;</td>
+        <td>!</td>
+        <td>The command char of the bot</td>
+      </tr>
+      <tr>
+        <td>USERLIST=&lt;file&nbsp;name&gt;</td>
+        <td>bot.users</td>
+        <td>The userlist file</td>
+      </tr>
+      <tr>
+        <td>LOGFILE=&lt;file&nbsp;name&gt;</td>
+        <td>log</td>
+        <td>The log file (may be set to <tt>/dev/null</tt> if you do
+          not want to log...</td>
+      </tr>
+      <tr>
+        <td>SERVER=&lt;server&nbsp;name&gt;&nbsp;[&lt;port&gt;&nbsp;[&lt;password&gt;]]</td>
+        <td>None</td>
+        <td>The server the bot will try to connect to, on the port
+          specified, and optionally with a password. You can put any 
+          number of SERVER lines</td>
+      </tr>
+      <tr>
+        <td>CHANNEL=&lt;channel&nbsp;name&gt;&nbsp;[&lt;channel&nbsp;key&gt;]</td>
+        <td>None</td>
+        <td>The channel the bot will join on startup. You can put any
+          number of CHANNEL lines</td>
+      </tr>
+    </table>
+
+    <h4>You are the master of the bot</h4>
+
+    <p>Yes! But the bot does not know who you are yet. Edit the file
+      <tt>bot.users</tt> (or whatever your userlist file is) and put
+      in a line like this one:</p>
+
+    <pre>&lt;your adress&gt;:#*:4:0:0:-1:*NONE*</pre>
+
+    <p>where &lt;your adress&gt; is composed with your IRC address. It 
+      should be something like that:</p>
+
+    <pre>*!*username@*.domain.com</pre>
+
+    <p>if you connect on IRC from <tt>machine.domaine.com</tt>, with
+      <tt>username</tt> as login.</p>
+
+    <p>For me, this is <tt>*!*bernard@*.cma.fr</tt>.</p>
+
+    <p>Now, you can run the bot:</p>
+
+    <pre>./bobot++</pre>
+
+    <p>Note that there are certain command line options that you can
+      see with:</p>
+
+    <pre>./bobot++ -h</pre>
+
+    <h2>Using the <em>bobot++</em></h2>
+
+    <h4>Adding people on the userlist</h4>
+
+    <p>Of course, you will want to add people on the userlist, as well 
+      as other bots. The <tt>adduser</tt> command is for you, then!
+      Its syntax is:</p>
+
+    <pre>!adduser &lt;nick&gt;|&lt;mask&gt; &lt;channel&nbsp;mask&gt; &lt;level&gt; &lt;prot&gt; &lt;aop&gt;</pre>
+
+    <p>Note that ``!'' is the command char of the bot, and it may be
+      different according to the configuration you chose.<br>
+      The meaning of the different options is rather simple:</p>
+
+    <table border="1">
+      <tr>
+        <td align="center">&lt;nick&gt;</td>
+        <td>The nickname of the person to add. The bot will generate a
+          mask matching this person. If the mask is not accurate
+          enough, you should use...</td>
+      </tr>
+      <tr>
+        <td align="center">&lt;mask&gt;</td>
+        <td>...to select the mask you really want. I remind you that
+          the mask is a regular expression designed to match
+          <em>nick!username@hostname</em></td>
+      </tr>
+      <tr>
+        <td align="center">&lt;channel&nbsp;mask&gt</td>
+        <td>This is a mask representing channels where this account is
+          available. You can put ``*'' for every channels, ``#*'' for
+          every non-local channels, etc.</td>
+      </tr>
+      <tr>
+        <td align="center">&lt;level&gt;</td>
+        <td><table width="100%" border="1">
+            <tr>
+              <td>0</td>
+              <td>No level - Impossible to execute commands. This is
+                for bots, for example.</td>
+            </tr>
+            <tr>
+              <td>1</td>
+              <td>User level - Will be able to execute many of the
+                commands, but will not be able to use masks on kicks
+                and on bans.</td>
+            </tr>
+            <tr>
+              <td>2</td>
+              <td>Trusted user level - Exactly the same commands as
+                the ``User'' level, except that the user will be able
+                to use masks on bans and kicks.</td>
+            </tr>
+            <tr>
+              <td>3</td>
+              <td>Friend level - Can do everything on the bot, except
+                stopping it. Be careful of who your friends are :-)</td>
+            </tr>
+            <tr>
+              <td>4</td>
+              <td>Master level - Can do everything on the bot.</td>
+            </tr>
+          </table>
+        </td>
+      </tr>
+      <tr>
+        <td align="center">&lt;protection&gt;</td>
+        <td><table width="100%" border="1">
+            <tr>
+              <td>0</td>
+              <td>No protection - for nearly everybody.</td>
+            </tr>
+            <tr>
+              <td>1</td>
+              <td>No ban - it will be impossible to ban the user,
+                directly or indirectly.</td>
+            </tr>
+            <tr>
+              <td>2</td>
+              <td>No kick - if the user is kicked, there will be a
+                revenge.</td>
+            </tr>
+            <tr>
+              <td>3</td>
+              <td>No deop - The bot will insure that the user can not
+                be deopped. Useful for bots.</td>
+            </tr>
+          </table>
+        </td>
+      </tr>
+      <tr>
+        <td align="center">&lt;aop&gt;</td>
+        <td><table width="100%" border="1">
+            <tr>
+              <td>0</td>
+              <td>No auto-op on join.</td>
+            </tr>
+            <tr>
+              <td>1</td>
+              <td>Auto-op on join. For bots, and optionnaly other
+                users. It depends on the policy of your channel.</td>
+            </tr>
+          </table>
+        </td>
+      </tr>
+    </table>
+
+    <p>Here are two examples:</p>
+
+    <pre>!adduser eb #* 2 1 0
+!adduser *!*test@138.195.*.* #test 0 3 1
+!save</pre>
+
+    <p>We first add ``eb'' (me!) to the userlist, for every non-local 
+      channel, at level 2 (trusted user), with no-ban protection and
+      no auto-op.</p>
+
+    <p>Then we add every user matching ``*!*test@138.195.*.*'' to the
+      userlist for channel ``#test'', with level 0 (no level),
+      protection 3 (no-deop) and auto-op on join. It is probably
+      another bot.</p>
+
+    <p>Finally, we save the changes to the userlist. Note that this is 
+      not mandatory, since the userlist is saved when the bot
+      <tt>!die</tt>s, but if the bot is killed or if there is a bug
+      (yes, there <em>are</em> bugs :-), all your changes would not
+      have been saved.</p>
+
+    <h4>Issuing a command (like for example a kick)</h4>
+
+    <p>The <em>bobot++</em> supports two types of commands: those who
+      affect a channel (kick, ban, topic...) and those who don't.</p>
+
+    <p>For commands which need a channel name, the channel name can be 
+      optionnaly put after the name of the command. This is mandatory
+      if the command is made directly to the bot, with a private
+      message.</p>
+
+    <p>Suppose the bot is on two channels, <tt>#test1</tt> and
+      <tt>#test2</tt>. You are on channel <tt>#test1</tt>. Here is the 
+      behavior of the bot:</p>
+
+    <table border="1">
+      <tr>
+        <td><tt>#test1&gt; !kick foo reason</tt></td>
+        <td>This will kick <em>foo</em> out of channel
+          <tt>#test1</tt>.</td>
+      </tr>
+      <tr>
+        <td><tt>#test1&gt; !kick #test1 foo reason</tt></td>
+        <td>This will also kick <em>foo</em> out of channel
+          <tt>#test1</tt>.</td>
+      </tr>
+      <tr>
+        <td><tt>#test1&gt; !kick #test2 foo reason</tt></td>
+        <td>This will kick <em>foo</em> out of channel
+          <tt>#test2</tt>.</td>
+      </tr>
+      <tr>
+        <td><tt>-&gt; *bot* !kick #test1 foo reason</tt></td>
+        <td>This will kick <em>foo</em> out of channel
+          <tt>#test1</tt>.</td>
+      </tr>
+      <tr>
+        <td><tt>-&gt; *bot* !kick #test2 foo reason</tt></td>
+        <td>This will kick <em>foo</em> out of channel
+          <tt>#test2</tt>.</td>
+      </tr>
+      <tr>
+        <td><tt>-&gt; *bot* !kick foo reason</tt></td>
+        <td>This will <em>not</em> work. The bot has no way to know to 
+          which channel this command applies to.
+      </tr>
+    </table>
+
+    <p>Is this clear enough? This is rather compelling, I know, but I
+      have not found a better way to do this.</p>
+
+    <h4>Spying the bot</h4>
+
+    <p>I hate people that kick others <em>via</em> the bots, and using 
+      a private message to the bot. There is no good way to really
+      know what others do. Furthermore, some private messages can be
+      sent to the bot and this can be funny. That is why I made a
+      command to spy bot's private messages.</p>
+
+    <p>There is a ``spylist'' on the bot that every user can read with 
+      the command <tt>!spylist</tt>. To be added to the spylist, you
+      should use the <tt>!spymessage</tt> command. To be removed, this 
+      is the <tt>!rspymessage</tt> command.</p>
+
+    <p>Note that password control on the bot is not yet implemented,
+      so there is no danger of knowing the password of other people. I 
+      will improve the spylist later in order not to be able to see
+      others' password.</p>
+
+    <h4>Intelligent ban and deban</h4>
+
+    <p>Note what happens if you try:</p>
+
+    <pre>!ban *.a.a
+!ban *.b.a
+!ban *.c.a
+!ban *.d.a</pre>
+
+    <p>Then</p>
+
+    <pre>!ban *.a</pre>
+
+    <p>Fine, isn't it? If we didn't do that, the server would not
+      accept the last ban. Try also <tt>!deban *</tt> (use it when the 
+      banlist is full!).</p>
+
+    <h4>Getting help on other commands</h4>
+
+    <p>The <tt>!help</tt> command without arguments will give you all
+      the commands you can issue. For a master, this will give
+      you (this may change in the future):</p>
+
+    <pre>-Bobot- Available topics for you are:
+-Bobot- ACTION ADDUSER ADDSERVER BAN CHANNELS CYCLE DEBAN DELSERVER DEOP
+        DIE HELP INVITE JOIN KICK KICKBAN LOCK NAMES NEXTSERVER NICK
+        NSLOOKUP OP PART RECONNECT RSPYMESSAGE SAVE SAY SERVER SERVERLIST
+        SPYLIST SPYMESSAGE TOPIC UNLOCK USERLIST WHO WHOIS
+-Bobot- Use HELP &lt;command&gt; for help about &lt;command&gt;</pre>
+
+    <p>If you want help about the <tt>!kick</tt> command, use
+      <tt>!help kick</tt>:</p>
+
+    <pre>-Bobot- Help for KICK:
+-Bobot- KICK [&lt;channel&gt;] &lt;mask&gt;|&lt;nick&gt; [&lt;reason&gt;]
+-Bobot- Kicks &lt;mask&gt; or &lt;nick&gt; out of &lt;channel&gt;, because of &lt;reason&gt;.
+-Bobot- You need to be a trusted user to use a &lt;mask&gt;.
+-Bobot- End of help.</pre>
+
+    <p>Then you have the tools to explore the <em>bobot++</em> in
+      details. Good luck!</p>
+
+    <h2>Bugs, questions, etc.</h2>
+
+    <p>If you find a bug or a strange behaviour of the bot, please try 
+      to reproduce it, and then send me a mail describing the problem
+      <em>in details</em>.</p>
+
+    <p>If you have suggestions about new features, please tell
+      me. If you added features yourself, send me your patch!</p>
+
+    <p>Note that I will not answer to configuration or compilation
+      problems...</p>
+
+    <h2>Plans for the future</h2>
+
+    <p>Here is what I plan to add to the <em>bobot++</em>:</p>
+
+    <ul>
+      <li>Scripting support with Guile, the GNU Scheme
+        interpreter;</li>
+      <li>Bot control via telnet, or a java applet;</li>
+      <li>DCC Send and Get (we will be able to use the bot as a
+        file server);</li>
+      <li>Shitlist, like on the <em>bobot</em>;</li>
+      <li>Dynamic settings;</li>
+      <li>Other ideas?</li>
+    </ul>
+
+    <h2>Why use Guile?</h2>
+
+    <p>Guile is the GNU Scheme interpreter. In a future release of the
+      <em>bobot++</em>, I plan to add scripting support using this
+      interpreter.</p>
+
+    <p>So, why did I chose Guile, instead of Tcl or Python?</p>
+
+    <p>One of the main features of Guile is that it will be easy to
+      extend the interpreter in order to translate Python, Tcl or
+      Perl to Scheme code. So, you will have the choice of the
+      language! If you prefer Python instead of Perl or Tcl, use
+      Python. If you prefer CTax (a language similar to C), all right!
+      I hope that religious wars opposing those languages will soon be
+      over...</p>
+    <p>Moreover, as Guile is GNU code, it is <em>really</em> a free
+      software, and will keep this status.</p>
+
+    <p>Finally, it is an excellent product, so why shouldn't we use
+      it?</p>
+
+
+    <hr>
+    <address><a href="mailto:bernard@isia.cma.fr">Etienne
+        BERNARD</a></address>
+    
+    <!-- Created: Fri Mar  6 18:45:32 CET 1998 -->
+    <!-- hhmts start -->
+Last modified: Sat Mar 21 13:32:54 CET 1998
+<!-- hhmts end -->
+  </body>
+</html>