###################
# LOL's Toolz 3.6 #
###################

ALL AMELIORATIONS, CORRECTIONS AND BUGS REPORT ARE VERY WELCOME !!!!
IF YOU MODIFY MY SCRIPT, NO PROBLEMS, BUT MAIL ME YOUR MODIFICATIONS AND KEEP
MY NAME AS THE ORIGINAL AUTOR.

THANKS FOR BUGS REPORT AND ENGLISH ERRORS (NOT MY FIRST LANGUAGE ;)

GET THE  LATEST VERSION AT: ftp:\\ftp.sodre.net/pub/eggdrop/scripts1.3/

                    LOL <lol@mail.dotcom.fr>


#####################
# SHORT DESCRIPTION #
#####################

TYPE |         COMMAND         |               DESCRIPTION               | FLAGS
DCC    .userlist [flags]         Sort the users of the bot.                n
DCC    .join <#chan> [chan pass] Join or create a new chan.                n
DCC    .part <#chan>             Part a chan but not remove it of the bot. m|m
DCC    .security                 Security risk with dynamic IP.            m|m
DCC    .addop <nick> <#chan> [handle] [f] Op an user in the bot.           m|m
DCC    .delop <nick> <#chan>     Deop an user of the bot.                  m|m
DCC    .addvoice <nick> <#chan> [handle] [f] Voice an user in the bot.     m|m
DCC    .delvoice <nick> <#chan>  Devoice an user of the bot.               m|m
DCC    .chanlist <#chan>         List the users of a chan.                 o|o
DCC    .mode <#chan> <flags>     Put the requested flags at a chan.        o|o
DCC    .help-lol [chan or msg]   This help and more...                     -
CHAN   !banmask <mask> [time] [reason] Ban a mask (time 0 = perm ban).     m|m
CHAN   !ban <nick> [time] [reason] Ban an user (time 0 = perm ban).        m|m
CHAN   !unban <mask>             Unban a mask.                             m|m
CHAN   !mode <flags>             Put the requested flags at a chan.        m|m
CHAN   !addop <nick> [handle] [f] See .addop.                              m|m
CHAN   !delop <nick>             See .delop.                               m|m
CHAN   !addvoice <nick> [handle] [f] See .advoice.                         m|m
CHAN   !delvoice <nick>          See .delvoice..                           m|m
CHAN   !op [nick]                Op an user.                               o|o
CHAN   !deop [nick]              Deop an user.                             o|o
CHAN   !voice [nick]             Voice an user.                            o|o
CHAN   !devoice [nick]           Devoice an user.                          o|o
CHAN   !whois <nick>             Show the handle of an user.               o|o
CHAN   !quick <nick> [reason]    Kick an user and ban him 7 seconds.       o|o
CHAN   !topic <topic>            Set a new topic.                          o|o
CHAN   !kick <nick> [reason]     Kick an user.                             v|v
CHAN   !stats                    Show channel stats.                       v|v
CHAN   !cigarette [nick]         Offer a cigarette :)                      v|v
CHAN   !rose [nick]              Offer a superb rose :)                    v|v
CHAN   !pastaga [nick]           Give a glass of pastaga :)                v|v
CHAN   !beer [nick]              Give a fresh beer :)                      v|v
CHAN   !coke [nick]              Give a fresh coke :)                      v|v
CHAN   !penalty [nick]           Shoot a penalty (french joke).            v|v
CHAN   !seen <nick>              Show the last time the user was online.   -
CHAN   !help                     Help in chan.                             -
CHAN   !time                     Show the actual time.                     -
CHAN   !troubles                 An help to resolve the problems.          -
MSG    join <pass> <#chan> [chan pass] Join or create a new chan.          n
MSG    remove <pass> <#chan>     Remove a chan and chan's users.           n
MSG    part <pass> <#chan>       Part a chan but not remove it of the bot. m|m
MSG    banmask <pass> <mask> <#chan> [time] [reason] See !banmask.         m|m
MSG    addop <pass> <nick> <#chan> [handle] [f] See .addop.                m|m
MSG    delop <pass> <nick> <#chan> See .delop.                             m|m
MSG    addvoice <pass> <nick> <#chan> [handle] [f] See.addvoice.           m|m
MSG    delvoice <pass> <nick> <#chan> See.delvoice.                        m|m
MSG    ban <pass> <nick> <#chan> [time] [reason] See !ban.                 o|o
MSG    unban <pass> <mask> <#chan> See !unban.                             o|o
MSG    mode <pass> <#chan> <flags> See !mode.                              o|o
MSG    key <pass> <#chan>          Send the key of a chan where you are op.o|o
MSG    whois <pass> <nick> <#chan> Show the handle of an user.             o|o
MSG    invite <pass> [#chan]       Invite you in a chan.                   o|o
MSG    msg <pass> <#chan or nick> <message> Send a message.                o|o
MSG    help                        Bot help + LoL's toolz msg help.        -

With the parameter "security=1", the bot warn the masters when they join the 
party-line about the use of auto-op and problems of the user mask. I have make
this options because i had some problems with masters that put auto-op at
anybody.

The parameter "nopass=1", check if the user as a password set when he join a chan.
The advantage of that, it's that an user set quickly is password even if he not
remember that he hasn't still set one. Disvantage: if an user join the chan with
a mask that match the user mask, the bot ask him to set a password and he can take
the place of the true user.

"welcome=1", show simply a welcome line for the non users of the bot:
Welcome on chan nick !!! Type !help for more...

With the parameter "chankey=1", the bot remember the password of the channel, and
if anybody change it, the bot change it too. With this option, the bot can always 
rejoin the chan after a kick for example.


###################
# BIG DESCRIPTION #
###################

MSG: invite <password> [#chan]

If you don't give a chan parameter, the bot check all the chan, it is on, and verify
if you are operator on some of them. If there is only a chan where you can be invited,
the bot invite you, but if there is more than one chan, the bot return a list of the
chan where you can be invited. Next you need to use "invite password #chan" to be invited.
The bot can't invite you on all the chan, because IRC protocol limits that.


PUB (or MSG): !addop (!addvoice) <nickname> [handle] [f]

It's probably the more powerful fonction of my script, there is some possibilities
to use it.

1_ !addop nick 
If the user is not in the bot, he will be added with +o flags for the chan, and the party-line
flags. If the user exist, only the +o flags for the chan will be added. If the nick
match an already existent handle in the bot, the bot return that it can't add nick.

2_ !addop nick handle
In the case where the nick|handle already exist in the bot, or if you want to set a 
different handle that the nick, you can use this syntaxe. If the handle parameter match
an already existent handle, the bot refuse to perform the commands.

3_ !addop nick handle f
The f flags is the force flag. The bot will perform the command even if the handle
already exist: First the bot will add the new user mask at the existent user, and then
add the +o chan flags.

Each time an user is added the bot said him the description of the situation, and ask
him to set a password.


Priority with chan commands (!deop, !kick, !ban, !voice, !devoice)

All these commands are restricted for the simple +o, when one of theses commands
if performed, first the bot check the flags of the victim. If the victim has the
+m or +b flags, the bot check the flags of the command's user, if he hasn't the
+m flags or more, the bot refuse to execute the command. There is one exeption: the
!voice command is performed on a master or a bot, if he is not oped. In the case where
he is already oped the same restrictions as above are used.


###################
# Version History #
###################

1.0 First private release.
2.0 First public release.
2.0a Fix a little bug in !OP function.
2.0b Fix a little bug in .mode and msg mode functions.
2.5 Added msg invite function (replacement of the bot function)
       Replaced: invite <pass> <#chan>
       By: invite <pass> [#chan]
       If there is only a chan where you can be invited, the bot invite you.
       If there is many chans, the bot give you a list.
    Ameliorations in chan parameters.
    Ameliorations in .join and .part commands.
    Bind .+chan with .join and .-chan with .part
    Some bugs fixed.
    New chan option: if chan is given => #chan.
2.6 Added msg join and part functions.
    Change little things ;)
    Bind j for join and p for part too.
    Unbinded .+chan with .join and .-chan with .part :)
2.6a Same as 2.6, i have uploaded 2.6 in ascii mode and i can't overwrite it :)
2.7 Littles changes.
2.8 When you ban an op, the  bot deop it first (Evite unban before kick).
    You can use channel password in join command, and the key will be stored in
    the chan settings.
2.9 Join and part better, part will no more delete chan monitoring.
    Fix bug in password recording for chans.
    Quick deop an op before to ban and kick him (Evite unban before kick).
    Msg help updated.
    Added auto-update chankey.
    *!user@host => *!*user@host (to evite ~).
3.0 New jokes.
    New party-line help.
    Replaced some chan notice by msg notice.
    Added reason in ban and banmask commands.
    Fixed little bug in msg ban.
    Lifting of some functions (ban, unban...).
    When you use the msg commands, it now respond in msg windows.
    Bot welcome himself no more when it join a chan.
    When you set a pass with mode command, the bot remember the pass.
    New function: msg key, send the enter key of a chan, if you are op.
3.0a Fixed mode function don't react with chankey parameter.
3.1 First implentation of an internal seen script, don't need no more seen module.
    Some others little changes.
    Some changes in !op !voice....
3.2 Quiet party-line.
    Little changes in addop addvoice functions.
3.5 Added chan stats.
    Quiet !op !deop !voice !devoice, because there was lot of text with chan
    that have more than one bot.
    Lot of ameliorations in !deop and !voice !devoice.
    Added msg command: msg <password> <#chan or nick> <message>
    Added msg command: remove <password> <#chan>
3.6 Added test to see if eggdrop is at least a 1.3.0, if not => Warning message ! 
    Some changes in jokes.
    Added joke: !cigarette (Thanks to Boolere)
    More power for voiced users:
       All the jokes.
       !stats.
       !kick (Work only with op only and normal users.)