Exemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ClientInstance"/> class.
 /// </summary>
 /// <param name="prototype">The prototype.</param>
 /// <param name="runner">The runner.</param>
 public ClientInstance(ObjectInstance prototype, ScriptRunner runner)
     : base(prototype, runner)
 {
     client = new IrcClient();
     client.Message += new EventHandler<IrcMessageEventArgs>(client_Message);
     client.ChannelJoin += new EventHandler<IrcChannelEventArgs>(client_ChannelJoin);
     client.Disconnect += new EventHandler<EventArgs>(client_Disconnect);
     client.SslValidate += new EventHandler<SslValidateEventArgs>(client_SslValidate);
     PopulateFunctions();
 }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            IrcClient client = new IrcClient();
            client.Nick = "egtesterny";
            client.FullName = "egtesterny";
            client.SslValidate += new System.EventHandler<SslValidateEventArgs>(client_SslValidate);
            client.ConnectAsync("irc.irchighway.net", 9999, true).ContinueWith(task =>
            {
                client.Channels.JoinAsync("#egbottester").ContinueWith(task2 =>
                {
                    var channel = task2.Result;

                    client.SendMessage(channel, "/whois Alxandr");
                    client.SendMessage(channel, "/whois egupdates");
                }).Wait();
            }).Wait();
            client.Message += new System.EventHandler<IrcMessageEventArgs>(client_Message);
            new ManualResetEvent(false).WaitOne();
        }