mainloop (IrcBot)

    # File rbot.rb, line 226
      def mainloop
        # idle thread
        # main thread
        while(true)
          connect
          while(true)
            if(@socket.select(0.2))
              reply = @socket.gets
              break unless reply
              @client.process(reply)
            end
            @timer.tick
          end
          puts "disconnected"
          @channels.clear
          puts "waiting to reconnect"
          sleep 5
        end
      end