#Please note: Local setting must be lower than the max_connections setting of the server for this script to be of any use

#name of the server the bot should kill non chatters from
assign server spud
#how many users the bot allows on the server before it starts killing
assign local 70

xecho 12ChatOnlyBot 2Loaded
xecho 747474747474
xecho 474747474747
xecho 7412C2arbon121674
xecho 474747474747
xecho 747474747474

assign longest 0
assign killme blah

alias chatonly
{
timer -ref co 2
 {
 kill $killme Server full, not in a room \($server\)
 ^assign -killme
 ^assign -longest
 ^assign longest 0
 ^assign killme blah
 ^admin stats
 ^on ^10115 "*"
  {
  if ([$0] > [$local])
   {
   ^guser $server
   ^on ^832 "*"
    {
    ^whois $0
    ^on ^who "*"
     {
     if (([$rmatch($3 *#*)]  < 1) && ([$2] > [$longest]) && (([$1] == ["User"]) || ([$1] == ["Leech"])))
      {
      assign -killme
      assign -longest
      assign killme $0
      assign longest $2
      }
     }
    }
   }
  }
 chatonly
 }
}

chatonly