Esempio n. 1
0
 public static void _Part(IRCClient sender, Client clt, Channel chan)
 {
     if (clt.Nick != sender.Nick)
     {
         sender.SendMessage(chan, "Bye, bye {0}", clt);
     }
 }
Esempio n. 2
0
 public static void _Join(IRCClient sender, Client clt, Channel chan)
 {
     if (clt.Nick == sender.Nick)
     {
         sender.SendMessage(chan, "Hey! I just joined " + chan);
     }
     else
     {
         sender.SendMessage(chan, "Hey " + clt + "! Welcome in " + chan + " :)");
     }
 }
Esempio n. 3
0
        public static void _Msg(IRCClient sender, Client clt, object target, string msg)
        {
            if (msg.ToLower().StartsWith(sender.Nick.ToLower() + " "))
            {
                string   m     = msg.Remove(0, sender.Nick.Length + 1).ToLower();
                string[] split = m.Split(new char[] { ' ' }, 2);
                switch (split[0])
                {
                case "quit":
                    if (clt.Nick != "Metty")
                    {
                        sender.SendKick(target as Channel, clt, "F**k off!");
                        return;
                    }

                    sender.SendMessage(target, "Yes, SIR!");
                    sender.Disconnect("Executing order 666 from " + clt);
                    break;

                case "join":
                    if (split.Length < 2)
                    {
                        return;
                    }
                    sender.SendMessage(target, "I'll do so!");
                    sender.SendJoin(split[1]);
                    break;

                case "part":
                    if (split.Length < 2)
                    {
                        return;
                    }
                    sender.SendMessage(target, ":/ .... okay " + clt);
                    sender.SendMessage(split[1], ":(...goodbye!");
                    sender.SendPart(split[1]);
                    break;

                default:
                    sender.SendMessage(target, "Mhmhmh " + clt + "?");
                    break;
                }
            }
            else if (msg.ToLower() == sender.Nick.ToLower())
            {
                sender.SendMessage(target, "Yep " + clt + "?");
            }
        }
Esempio n. 4
0
        public static void Main(string[] args)
        {
            IRCClient c = new IRCClient();

            c.Debug    = true;
            c.Nick     = "MettysBot";
            c.RealName = "RealName";
            c.Ident    = "Ident";
            c.Connect("irc.quakenet.org", 6666);

            c.OnConnect += new Handler(_Con);
            c.OnJoin    += new JoinHandler(_Join);
            c.OnMessage += new MessageHandler((_Msg));
            c.OnPart    += new JoinHandler((_Part));
            c.OnMode    += new ModeHandler((_Mode));

            while (true)
            {
                Thread.Sleep(100);
            }
        }
Esempio n. 5
0
 public static void _Mode(IRCClient sender, Client clt, object loc, string mode)
 {
     sender.SendMessage(loc, B(clt + " set mode: " + mode));
 }
Esempio n. 6
0
 public static void _Con(IRCClient sender)
 {
     sender.SendJoin("#uthgard");
 }