Script:  GreetWondeR
Version: 1.4.1
Finished on: Tue May 25 17:30:00 MEST 1999
Required: Eggdrop 1.3.x
Author:  Wingman <Wingman@Defiant.vilstal.net>
         http://defiant.vilstal.net/~wingman/

Please send any suggestions and bugreports to:
Wingman@Defiant.vilstal.net

If u want to contact me on IRC, use irc.webbernet.net or irc.stealth.net 
(IRCNet) and go to channel(s) #Star_Trek or #Quake2.ger. (or Undernet@#Eggdrop)

 ------------------------------------------------------------------------------
|   [introduction] [install] [features] [a short guide] [history] [credits]    |
 ------------------------------------------------------------------------------

INTRODUCTION:
-------------
First of all - i should say sorry, cause of my english - it's not the best ;).
If u want to edit any of the messages, which are integrated in the tcl, send
your suggestions and i'll add/remove/modify them as soon as possible.
There a lot of greet.tcl's on sodre.net, eggdrop.net or tclslave.net, but i 
didn't like them very much. So why don't write your own tcl? :). A few of the 
scripts are coded very well and some are even better (coded) than this. But this
tcl is highly configurable through dcc chat/partyline and this - i think - is 
very important for any tcl. 

INSTALL:
--------
There are 2 ways of installing greetwonder.tcl
1. edit the header of greetwonder.tcl to your comfort (SETTINGS)
--
2. execute ./greetinstall <eggdrop config-file>
3. .rehash (DCC)
OR
2. vi (or an editor of your choice) <eggdrop config-file>
3. scroll down till the end of the config file and add the line:
   source scripts/greetwonder.tcl
   (don't forget to check, if greetwonder.tcl is in directory scripts!)
4. .rehash (DCC)  

FEATURES:
---------
 - full multi channel support
 - each chan owner can set individual greets for his chan...
 - supports flag greets
 - can either msg/notice all users, just non-users or only known users
 - greets can be turned off
 - all settings can be changed via dcc
 - simple floot protection (in case of flood joins, the tcl will shut
   down itself and restart at a certain number of mins)
 - supports var replacing, e.g. if u add a greet
   ".+greet Welcome greet-nick to greet-chan - For a help try /msg greet-botnick
   help"
   and let's say Wingman joins #Eggdrop, he'll see:
   Welcome Wingman to #Eggdrop - For a help try /msg Eggie help
 - and many more... (try .greethelp for a commandlist)

A SHORT GUIDE (it's the same as .greethelp guide) 
-------------

1. If you want to add a greet for #test, which should get all users...
  .+greet #test Hi greet-nick - Welcome to greet-chan
   .greetwho #test all

2. If you want flag specific greets, try...
   .+greet #test +n Hi greet-nick - You are an Owner on greet-chan!
   You can define up to x lines (x is defined at the top of the tcl) for every 
   flag or greet.

3. If you want to greet a nick with a specific line, then use...
   .+greetnick Nickname pub Hi Nick, what's up?
   (Only nicknames, which are in the userlist are allowed)

4. A feature of this tcl is its varreplacing:
   greet-nick, greet-chan and greet-botnick are replaced by the tcl vars,
   which means, if let's say Wingman joins #Eggdrop and the Botnick
   is Eggie, he will see (if there's greet like
   Hi greet-nick! Welcome to greet-chan - For a help try /msg greet-botnick help
   Hi Wingman! Welcome to #Eggdrop - For a help try /msg Eggie help

HISTORY/CHANGES 
---------------

Version 1.0.0
 - uhm, added a lot of stuff and fixed a lot of bugs ;)

Version 1.0.1
 Foundby   Fixedby   What...
 Cocko     Wingman   FIXED: forgot a close $file at +greet, whick 'caused
                            a tcl error: too many open files
           Wingman   FIXED: modified .greetstatus
Cocko      Wingman   FIXED: forgot a ) in proc greet:join *grmml*
Wingman    Wingman   FIXED: nick was not greeted, if a nick-greet was set...
Wingman    Wingman   FIXED: f%#ck typo... unkown -> unknown, 'cause of this
                            typo, it's hard to update without removing all
                            greets...
Cocko      Wingman   NEW: he's really lazy... ;) modified -greet, now u don't
                          need to enter the whole greet text, just the first
                          words...
           Wingman   NEW: .greetnickview for a list of nick-greets
           Wingman   NEW: added .+/-greetnick <handle> (<how> <text>)
           Wingman   NEW: rewrote the init code for a better update of older
                          versions
					  
Version 1.0.2
 Foundby   Fixedby   What...
 Wingman   Wingman   FIXED: greet(max) didn't work anymore after update to
                            .+greet <flags>
 Wingman   Wingman   FIXED: again - rewriting of the init code 'cause of this
                            lame typo (unkown -> unknown)...
 Cocko     Wingman   FIXED: and again...forgot a close $file in greet:join
 Cocko     Wingman   FIXED: global +o did`nt get the chan +o greet...
 Wingman   Wingman   FIXED: forgot check at .greetstatus, if file exists
                            $greet(nicks)
 Wingman   Wingman   FIXED: forgot to remove a exec rm (part of the old code),
                            which 'caused a tcl error, if u del all greets
                            on #chan and tried a .greetview...
 Cocko     Wingman   FIXED: argh, bug in getvar... (close $file ;))
 Wingman   Wingman   FIXED: .greethelp -> greetwho [channel] <0/1/2> should be
                            greetwho [channel] <all/known/unknown>
 Cocko     Wingman   FIXED: forgot a global greet in the flood subroutines,
                            which cause a tcl error and a seg fault :)
 Wingman   Wingman   FIXED: nick-greet -> matched $nick and not $handle
           Wingman   FIXED: tried to shorten the proc greet:join code...
           Wingman   NEW: moved .greetall -> greetwho <all/known/unknown>
           Wingman   NEW: added .greetreset for a complete greet reset

Version 1.0.3
 Foundby   Fixedby   What...
 Wingman   Wingman   FIXED: *grrrr* on first start of eggdrop, [channel] == ""
                     this suxx ->> let's write proc [channels] new :)
                     Usage: getchannels
                     returns: a list of the channel, the bot (should) be on
                              (gets chaninfo from chanfile)
	   Wingman   NEW: moved name SimpleGreet -> GreetWondeR
                          _Simple_ did'nt get it anymore ;)
           Wingman   NEW: added GreetWondeR motd (can be turned off via .gmotd)
           Wingman   NEW: modified .+greet, now all flags are allowed
           Wingman   NEW: rewrote the init code 'cause of now supporting all
                          flags...
           Wingman   NEW: rewrote greetsaving (+/-greet) and greetstatus
           Wingman   NEW: rewrote the greet code...
                          Now there are no more file-readings on joins
           Wingman   NEW: Added a short introduction (.greethelp guide)

Version 1.0.4
 Foundby   Fixedby   What...
 Wingman   Wingman   FIXED: .+greet <noflags> greet and there are $greet(max)
                            <flag> greets saved, no more <noflag> greets are
                            allowed. fixed
 Wingman   Wingman   FIXED: .greetview didn't show the <noflag> greets
 Cocko     Wingman   FIXED: in proc:join greetb was not definied, if there
                            were no <nonflag> greets saved. fixed
 Cocko     Wingman   FIXED: greetnicks now with Varreplacings...
	   Wingman   NEW: moved proc init -> greet:init (no more confusion
                          with other tcl's)
           Wingman   NEW: added eggdrop version test (now the tcl will not
                          not run on eggdrops < 1.3)
---
Version 1.1
 Foundby   Fixedby   What...
           Wingman   FIXED: hmmm, i guess unbind is a very unstabil tcl command
                            the recoding of the flood code didn't fix it - even
                            on a system with tcl8.0, there are tcl crashes...
                            I've removed the unbind commands and handle the
                            flood protect over vars...
           Wingman   FIXED: removed some debugging putlogs
           Wingman   FIXED: ecoded flood code - now handling over bind flud
           Wingman   FIXED: .+greet +n bla [test] bl -> greet = bla {[test]} bl
                            this sucks ;) - added proc lend { start string }
                            Usage: lend <startnumber> <text>
                            returns: words from <startnr> to end from <text>
                            (similar to [lrange] but w/o endnumber)
	   Wingman   NEW: moved history + a short guide to file gw_info.txt
           Wingman   NEW: bind'ed .greet n|n to owner only
           Wingman   NEW: added proc getfile
           Wingman   NEW: moved tcl name greetwonder[ver].tcl -> greetwonder.tcl
           Wingman   NEW: moved infofile gw_info.txt          -> greetwonder.txt
           Wingman   NEW: removed var greet(flood) joins:secs
           Wingman   NEW: added var greet(init) 0/1 -> extended startup screen?
           Wingman   NEW: modified greetstatus

Version 1.2 
  Foundby   Fixedby   What...
  Wingman   Wingman   FIXED: .+greet +n {a b} c -> sets greet to "a b c"
  Wingman   Wingman   FIXED: forgot the cmd putlog in proc gmotd (fixed)
  Wingman   Wingman   FIXED: 2 typos in the settings "sould" -> "should"
  Wingman   Wingman   FIXED: .greetstatus sometimes didn't "set c" (fixed)
  Wingman   Wingman   FIXED: .greetreset showed some putlogs, which d only be
                             available on a .rehash (fixed)
  Wingman   Wingman   FIXED: if console was *, then $chan == * (fixed)
  Wingman   Wingman   NEW: did some modifications on .greetstatus 
  Wingman   Wingman   NEW: Now greetwonder can be runned on eggdrops != 1.3.x 
                           But don't blame me, if a cmd doesn't work. If u find
		           an error, send a mail :)
  Wingman   Wingman   NEW: moved bindings to procs (no longer listed at the top)
  Wingman                  modified .greethow [channel]. Now you can change each
                           flag-greet to a diff. way of greeting (msg/notice)
                           -> .greethow [channel] [flag] <msg/notice>
            Wingman   NEW: added proc greet:debug, writes debug file on an error
                           and suggests to send this file to my email adress
                           Usage: greet:debug <handle> <idx> <command> <arg>
                           (writes Egg Version, date, time, handle, command, arg
                           and greet.dat to greet-debug.date)
  Wingman             NEW: modified .greetview
  Wingman             NEW: removed .chaninfo modification (now: standard)
  Wingman             NEW: moved [flag] -> [+flag] (a bit confusing coz [flag] 
                           didn't work...)
  Wingman             NEW: 1.3.27 (and above?) adds putlogs itself :-/
		           -> proc greet:putlog. checks if version >= 1.3.27*
                           if match -> then no putlogs, else putlog cmd
Version 1.3
  Foundby   Fixedby   What...
  Wingman   Wingman   FIXED: smaller bugs (typos etc.)
  Wingman   Wingman   FIXED: forgot a ] in greet:join (1.2+greet:joinfix)
  Wingman   Wingman   FIXED: .-greetnick <nick> did'nt worked in some cases
  Wingman   Wingman   FIXED: .greetnickview got confused cause of -greetnick
  Wingman   Wingman   FIXED: the Greet-MOTD didn't work with |n users
  Wingman   Wingman   FIXED: in file greet(data), the new version was added
                             at the top, but the old headers were not removed
  Wingman             NEW: moved proc greet:sucks -> greet:replace
                           usage: greet:replace <nick> <chan> <line>
			   returns: string
  Wingman             NEW: moved (nick), (chan) and (botnick) to greet-nick
                           greet-chan and greet-botnick. Now these strings are
			   replaced by the proc vars (also if there's a char 
			   in front of or at the end of the word).
  Wingman             NEW: .+greetnick <nick> <msg/notice/pub/act> <text>
                           Now nicks can be greeted via /me (ACTION)
  Wingman             NEW: added Init Updater - (nick), (chan) and (botnick) are
                           replaced by greet-nick, greet-chan, greet-botnick

Version 1.4
  Foundby   Fixedby   What...
  Wingman   Wingman   FIXED: in some cases nicks were not nick-greeted
  Wingman   Wingman   FIXED: nick file was not updated 
  Wingman   Wingman   FIXED: .+greet #chan test blubb -> only blubb was saved
  Wingman   Wingman   FIXED: .+greet #chan +m -> Added  (+m users) for #chan
            Wingman   NEW: recoded .greetreset
	    Wingman   NEW: greet:init (completly new coded)
            Wingman   NEW: Added NEW/FIXED to all version (.txt)
            Wingman   NEW: directory structure:
	                   /greet/ --> channels --> chan1.dat
			                        --> chan2.dat
			                        --> [...]
				   nicks.dat
				   greet.dat 
           Wingman    NEW: set greet(delay) <seconds>
	                   Delay time before reshowing the greet
           Wingman    NEW: Removed: set greet(init) <1/0>
           Wingman    NEW: .+greetfile [channel] [flag] <filename>
	                   Imports greets from a file (this command is
			   global owners only coz there's no line limit)
           Wingman    NEW: scriptwide flag check -> only "abcdefghijklmnopqrst
	                   uvwxyz1234567890" (with [toupper]) allowed
           Wingman    NEW: added GreetWondeR Installer:
	                   Usage: ./greetinstall <eggdrop configfile>
           Wingman    NEW: added INSTALL in the .txt

Version 1.4.1
  Foundby   Fixedby   What...
  HERZ      HERZ      FIXED: ./greetinstall -> typo (should be writable instead
                             of writeable)
  Whilor    Wingman   FIXED: The tcl thought, 1.0.4b is hacked...
  Whilor    Wingman   FIXED: (again) little typo in greet:init line 266:
                             should be chan instead of chanz.

CREDITS
-------
Cocko - Thx for the suggestions and the betatesting/bugreportings ;)
^AP^  - he's my tcl teacher =)
Sara  - She was the first, which mail'ed cause of this tcl ;) 
