Class to manage connections to IRC servers, and the sending and receiving of data to them.
Exemplo n.º 1
0
        /// <summary>
        /// Constructor for MoronBot.
        /// This is where:
        ///  - All of the Bot's Functions are loaded.
        ///  - Settings is initialized from xml.
        ///  - The initial connection to the server is made.
        /// </summary>
        public MoronBot()
        {
            if (!LoadXML("settings.xml"))
            {
                SaveXML("settings.xml");
            }

            LoadFunctions();

            //PluginLoader.WatchDirectory(Settings.Instance.FunctionPath, FuncDirChanged);

            Nick = Settings.Instance.Nick;

            cwIRC = CwIRC.Interface.Instance;

            cwIRC.MessageReceived += CwIRC_MessageReceived;
            cwIRC.Connect(Settings.Instance.Server, Settings.Instance.Port);
            cwIRC.NICK(Nick);
            cwIRC.USER(Nick, "Nope", "Whatever", "MoronBot 0.1.6");
            cwIRC.SendData("PASS mOrOnBoTuS");
            Say("identify mOrOnBoTuS", "NickServ");

            cwIRC.JOIN(Settings.Instance.Channel);

            connectionTimer.Elapsed += new System.Timers.ElapsedEventHandler(connectionTimer_Elapsed);
            connectionTimer.Interval = 120000;
            connectionTimer.Enabled  = true;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Constructor for MoronBot.
        /// This is where: 
        ///  - All of the Bot's Functions are loaded.
        ///  - Settings is initialized from xml.
        ///  - The initial connection to the server is made.
        /// </summary>
        public MoronBot()
        {
            if (!LoadXML("settings.xml"))
            {
                SaveXML("settings.xml");
            }

            LoadFunctions();

            //PluginLoader.WatchDirectory(Settings.Instance.FunctionPath, FuncDirChanged);

            Nick = Settings.Instance.Nick;

            cwIRC = CwIRC.Interface.Instance;

            cwIRC.MessageReceived += CwIRC_MessageReceived;
            cwIRC.Connect(Settings.Instance.Server, Settings.Instance.Port);
            cwIRC.NICK(Nick);
            cwIRC.USER(Nick, "Nope", "Whatever", "MoronBot 0.1.6");
            cwIRC.SendData("PASS mOrOnBoTuS");
            Say("identify mOrOnBoTuS", "NickServ");

            cwIRC.JOIN(Settings.Instance.Channel);

            connectionTimer.Elapsed += new System.Timers.ElapsedEventHandler(connectionTimer_Elapsed);
            connectionTimer.Interval = 120000;
            connectionTimer.Enabled = true;
        }
Exemplo n.º 3
0
 public static void Assign(Interface face)
 {
     lock (padlock)
     {
         instance = face;
     }
 }