/*
	The NEW Universal Mode Stripper, 1994

	This script is just an intellectual exercise:  It isnt intended
	to be useful.  If you really want to use a mode stripper, just
	/set mode_stripper ON and then watch for /on MODE_STRIPPED.
	see the HELP for /on MODE_STRIPPED for more information.

	Dont be daunted by the size of the alias.  Its actually
	pretty efficient.
*/

/* DONT MESS WITH THESE or youll be sorry... */
@ takeargs = [bovk]
@ noargs = [aimnpst]
@ msign = [+-]

alias modes {
        @ nick = [$0]
        @ channel = [$1]
        @ modestring = [$2]
        @ argindex = 3
        fec ($modestring) x
        {
                if (index($msign $x) > -1)
                { 
			@ sign = x 
		}
                {
			if (x == [l]) 
			{
				if (sign == [+]) 
				{
                        		hook MODE $nick $channel +l $($argindex)
                        		@ argindex++
                   		} 
				{ 
                        		hook MODE $nick $channel -l
                   		}
                 	}
                 	{
				if (index($takeargs $x) > -1) 
				{
                         		hook MODE $nick $channel $sign$x $($argindex)
                         		@ argindex++
                 		}
                 		{
					if (index($noargs $x) > -1)
                         		{
						hook MODE $nick $channel $sign$x
					}
				}
			}
		}
       }
}
on #-mode -10 * modes $*

#hop'94
