public void run()
    {
        seqNo = (int)Math.floor(Math.random() * 65535D);
        logMessage("Starting for \"" + botID + "\".");
        try
        {
            connection = new Socket("toc.oscar.aol.com", 21);
            connection.setSoTimeout(10000);
            in = new DataInputStream(connection.getInputStream());
            out = new DataOutputStream(new BufferedOutputStream(connection.getOutputStream()));
        }
        catch(Exception exception)
        {
            signoff("1");
            return;
        }
        try
        {
            out.writeBytes("FLAPON\r\n\r\n");
            out.flush();
            byte abyte0[] = new byte[10];
            in.readFully(abyte0);
            out.writeByte(42);
            out.writeByte(1);
            out.writeShort(seqNo);
            seqNo = seqNo + 1 & 0xffff;
            out.writeShort(name.length() + 8);
            out.writeInt(1);
            out.writeShort(1);
            out.writeShort(name.length());
            out.writeBytes(name);
            out.flush();
            frameSend("toc_signon login.oscar.aol.com 5190 " + name + " " + imRoast(pass) + " english alicebot\0");
            in.skip(0L);
            short word0 = in.readShort();
            abyte0 = new byte[word0];
            in.readFully(abyte0);
            if(String.valueOf(abyte0).startsWith("ERROR"))
            {
                logMessage("Signon error.");
                signoff("2");
                return;
            }
            in.skip(0L);
            word0 = in.readShort();
            abyte0 = new byte[word0];
            in.readFully(abyte0);
            online = true;
            sendBuddies();
            frameSend("toc_init_done\0");
            logMessage("Logon complete.");
            connection.setSoTimeout(3000);
        }
        catch(InterruptedIOException interruptedioexception)
        {
            online = false;
            signoff("2.5");
        }
        catch(IOException ioexception)
        {
            online = false;
            signoff("3");
        }
        do
            try
            {
                do
                {
                    in.skip(0L);
                    short word1 = in.readShort();
                    byte abyte1[] = new byte[word1];
                    in.readFully(abyte1);
                    fromAIM(abyte1);
                } while(true);
            }
            catch(InterruptedIOException interruptedioexception1)
            {
                Log.devinfo("AliceAIM: Error*: " + interruptedioexception1, Log.LISTENERS);
            }
            catch(IOException ioexception1)
            {
                Log.devinfo("AliceAIM: Error**: " + ioexception1, Log.LISTENERS);
                signoff("4");
                return;
            }
        while(true);
    }