All pastes #25517 Raw Edit

Unnamed

public text v1 · immutable
#25517 ·published 2005-10-14 22:53 UTC
rendered paste body
using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
using AoLib.Net;
using AoLib.Utils;
 
namespace Aochatlibtest
{
    class Program
    {
        static void Main(string[] args)
        {
            Trace.Listeners.Add(new TextWriterTraceListener(Console.Out));
            Chat omgBot = new Chat();
            omgBot.Connect("daniel6", "mitnick", "Weseeu", Server.Atlantean);
            omgBot.StatusChangeEvent += new StatusChangeEventHandle(omgBot_StatusChangeEvent);
            omgBot.TellEvent += new TellEventHandler(omgBot_TellEvent);
            Console.ReadLine();
        }

        static void omgBot_TellEvent(object sender, TellEventArgs e)
        {
            Chat bot = (Chat)sender;
            if (e.Message == "Peekiri")
            {
                TextWindow window = new TextWindow();
                window.AppendColorString("#FF0000", "OMG RED");
                window.AppendItem("Roxxor", 455, 455, 4);
                bot.SendPrivateMessage(e.SenderID, window.ToString());
            }
        }

        static void omgBot_StatusChangeEvent(object sender, StatusChangeEventArgs e)
        {
            if (e.State == ChatState.Connected)
            {
                Chat bot = (Chat)sender;
                bot.SendPrivateMessage("Peekiri", "Hello cuty");
            }
        }
    }
}