Exemplo n.º 1
0
        static void Main(string[] args)
        {
            string channel = args[0];
            string rnick   = args[1];
            string rmsg    = args[2];

            try
            {
                string   sender    = rnick;
                string   query     = rmsg.Remove(0, 9);
                string[] parsenick = query.Split('>');
                string   recipient = parsenick[0];
                string   message   = parsenick[1].Replace("~", "");
                ObsidianFunctions.Functions ObsidFunc = new ObsidianFunctions.Functions();
                bool nickonline = ObsidFunc.isOnline(recipient);
                if (nickonline == true)
                {
                    Console.WriteLine("PRIVMSG " + recipient + " :" + message);
                }
                else if (nickonline == false)
                {
                    Console.WriteLine("PRIVMSG " + sender + " :" + ObsidFunc.addMessage(sender, recipient, message));
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("PRIVMSG " + channel + " :" + ex.ToString());
            }
        }
Exemplo n.º 2
0
 static void Main(string[] args)
 {
     string channel = args[0];
     string rnick = args[1];
     string rmsg = args[2];
     try
     {
     string sender = rnick;
     string query = rmsg.Remove(0, 9);
     string[] parsenick = query.Split('>');
     string recipient = parsenick[0];
     string message = parsenick[1].Replace("~", "");
     ObsidianFunctions.Functions ObsidFunc = new ObsidianFunctions.Functions();
     bool nickonline = ObsidFunc.isOnline(recipient);
     if (nickonline == true)
     {
     Console.WriteLine("PRIVMSG " + recipient + " :" + message);
     }
     else if (nickonline == false)
     {
     Console.WriteLine("PRIVMSG " + sender + " :" + ObsidFunc.addMessage(sender, recipient, message));
     }
     }
     catch (Exception ex)
     {
     Console.WriteLine("PRIVMSG " + channel + " :" + ex.ToString());
     }
 }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            string channel = args[0];
            string rnick   = args[1];
            string rmsg    = args[2];

            try
            {
                ObsidianFunctions.Functions ObsidFunc = new ObsidianFunctions.Functions();
                bool nickuser = ObsidFunc.isActiveUser(rnick);
                if (nickuser == true)
                {
                    string   query     = rmsg.Remove(0, 14);
                    string[] blacklist = ObsidFunc.addBlacklist(query);
                    string   newlist   = String.Join(":", blacklist);
                    Console.WriteLine("PRIVMSG " + channel + " :" + newlist);
                }
                else
                {
                    Console.WriteLine("PRIVMSG " + channel + " :Insufficient permissions!");
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("PRIVMSG " + channel + " :" + ex.ToString());
            }
        }
Exemplo n.º 4
0
        public void activateUser()
        {
            StreamReader sr2 = new StreamReader(".activeusers");
            old = sr2.ReadToEnd();
            sr2.Close();
            System.IO.StreamReader sr = new StreamReader("users.bin");
            string[] registeredusers = sr.ReadToEnd().Split(':');
            sr.Close();
            foreach (string x in registeredusers)
            {
                if (x == rnick)
                {
                    string query = rmsg.Remove(0, 8);
                    int indexuser = Array.IndexOf(registeredusers, rnick);
                    ObsidianFunctions.Functions obsidfunc = new ObsidianFunctions.Functions();
                    bool passcorrect = obsidfunc.isVerified(indexuser, query);
                    StreamWriter sw = new StreamWriter(".activeusers");
                    if (passcorrect == true)
                    {
                        sw.Write(old + rnick + ":");
                        send("PRIVMSG " + rnick + " :Success! You are logged in!");
                    }

                    sw.Close();
                }
            }
        }
Exemplo n.º 5
0
        static void Main(string[] args)
        {
            AIMLbot.Bot  chatBot;
            AIMLbot.User chatUser;
            string       channel = args[0];
            string       rnick   = args[1];
            string       rmsg    = args[2];

            try
            {
                if (rmsg.StartsWith("!") == false)
                {
                    string query = rmsg;
                    ObsidianFunctions.Functions ObsidFunc = new ObsidianFunctions.Functions();
                    chatBot = new AIMLbot.Bot();
                    chatBot.loadSettings();
                    chatUser = new AIMLbot.User(rnick, chatBot);
                    chatBot.loadAIMLFromFiles();
                    chatBot.isAcceptingUserInput = true;
                    AIMLbot.Request r   = new AIMLbot.Request(query, chatUser, chatBot);
                    AIMLbot.Result  res = chatBot.Chat(r);
                    Console.WriteLine("PRIVMSG " + rnick + " :" + res.Output);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("PRIVMSG " + rnick + " :" + ex.ToString());
            }
        }
Exemplo n.º 6
0
 static void Main(string[] args)
 {
     string channel = args[0];
     string rnick = args[1];
     string rmsg = args[2];
     //try
     //{
     ObsidianFunctions.Functions ObsidFunc = new ObsidianFunctions.Functions();
     bool nickuser = ObsidFunc.isActiveUser(rnick);
     if (nickuser == true)
     {
     System.IO.StreamReader sr = new System.IO.StreamReader("messages.bin");
     string messageread = sr.ReadToEnd();
     sr.Close();
     Console.WriteLine("PRIVMSG " + rnick + " :" + messageread.Trim());
     }
     else
     {
     Console.WriteLine("PRIVMSG " + channel + " :Insufficient permissions!");
     }
     //}
     //catch (Exception ex)
     //{
     //Console.WriteLine("PRIVMSG " + channel + " :" + ex.ToString());
     //}
 }
Exemplo n.º 7
0
 static void Main(string[] args)
 {
     string channel = args[0];
     string rnick = args[1];
     string rmsg = args[2];
     try
     {
         ObsidianFunctions.Functions ObsidFunc = new ObsidianFunctions.Functions();
                     if (ObsidFunc.isOperator == true)
                     {
                         string query = rmsg.Remove(0, 6);
                         bool nickuser = ObsidFunc.isActiveUser(rnick);
                         if (nickuser == true)
                         {
                             Console.WriteLine("KICK " + channel + " " + query + " User-requested kick");
                         }
                         else
                         {
                             Console.WriteLine("PRIVMSG " + channel + " :Insufficient permissions!");
                         }
                     }
     }
     catch (Exception ex)
     {
         Console.WriteLine("PRIVMSG " + channel + " :" + ex.ToString());
     }
 }
Exemplo n.º 8
0
 static void Main(string[] args)
 {
     string channel = args[0];
     string rnick = args[1];
     string rmsg = args[2];
     try
     {
         System.IO.StreamReader sr = new System.IO.StreamReader(".activeusers");
                     string[] users = sr.ReadToEnd().Split(':');
                     sr.Close();
                     foreach (string x in users)
                     {
                         if (x.Contains(rnick))
                         {
                             string query = rmsg.Remove(0, 9);
                             ObsidianFunctions.Functions obsidfunc = new ObsidianFunctions.Functions();
                             string list = obsidfunc.addUser(query);
                             Console.WriteLine("PRIVMSG " + channel + " :" + list);
                         }
                     }
     }
     catch (Exception ex)
     {
         Console.WriteLine("PRIVMSG " + channel + " :" + ex.ToString());
     }
 }
Exemplo n.º 9
0
        static void Main(string[] args)
        {
            string channel = args[0];
            string rnick   = args[1];
            string rmsg    = args[2];

            try
            {
                ObsidianFunctions.Functions ObsidFunc = new ObsidianFunctions.Functions();
                bool nickuser = ObsidFunc.isActiveUser(rnick);
                if (nickuser == true)
                {
                    System.IO.StreamReader sr = new System.IO.StreamReader("registers.bin");
                    string[] regusersarray    = sr.ReadToEnd().Split('|');
                    string   regusers         = regusersarray[0];
                    sr.Close();
                    if (regusers == "" | regusers == null)
                    {
                        regusers = "None";
                    }
                    Console.WriteLine("PRIVMSG " + channel + " :" + regusers);
                }
                else
                {
                    Console.WriteLine("PRIVMSG " + channel + " :" + "Insufficient permissions!");
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("PRIVMSG " + channel + " :" + ex.ToString());
            }
        }
Exemplo n.º 10
0
        static void Main(string[] args)
        {
            string channel = args[0];
            string rnick = args[1];
            string rmsg = args[2];
            try
            {
                ObsidianFunctions.Functions ObsidFunc = new ObsidianFunctions.Functions();
                bool nickuser = ObsidFunc.isActiveUser(rnick);
                string query = rmsg.Remove(0, 13);
                if (nickuser == true)
                {

                    if (query.Contains("true"))
                    {
                        ObsidFunc.spamTrue();
                        Console.WriteLine("PRIVMSG " + channel + " :spamControl = true");
                    }
                    else if (query.Contains("false"))
                    {
                        ObsidFunc.spamFalse();
                        Console.WriteLine("PRIVMSG " + channel + " :spamControl = false");
                    }
                    }
                    else
                    {
                        Console.WriteLine("PRIVMSG " + channel + " :Insufficient permissions!");
                    }
            }
            catch (Exception ex)
            {
                Console.WriteLine("PRIVMSG " + channel + " :" + ex.ToString());
            }
        }
Exemplo n.º 11
0
 static void Main(string[] args)
 {
     string channel = args[0];
     string rnick = args[1];
     string rmsg = args[2];
     try
     {
     ObsidianFunctions.Functions ObsidFunc = new ObsidianFunctions.Functions();
     bool nickuser = ObsidFunc.isActiveUser(rnick);
     if (nickuser == true)
     {
     string query = rmsg.Remove(0, 17);
     string[] blacklist = ObsidFunc.removeBlacklist(query);
     string newlist = String.Join(":", blacklist);
     if (newlist == null || newlist == "")
     {
     newlist = "None";
     }
     Console.WriteLine("PRIVMSG " + channel + " :" + newlist);
     }
     else
     {
     Console.WriteLine("PRIVMSG " + channel + " :Insufficient permissions!");
     }
     }
     catch (Exception ex)
     {
         Console.WriteLine("PRIVMSG " + channel + " :" + ex.ToString());
     }
 }
Exemplo n.º 12
0
 static void Main(string[] args)
 {
     string channel = args[0];
     string rnick = args[1];
     string rmsg = args[2];
     try
     {
         ObsidianFunctions.Functions ObsidFunc = new ObsidianFunctions.Functions();
         bool nickuser = ObsidFunc.isActiveUser(rnick);
         if (nickuser == true)
         {
             System.IO.StreamReader sr = new System.IO.StreamReader("registers.bin");
             string[] regusersarray = sr.ReadToEnd().Split('|');
             string regusers = regusersarray[0];
             sr.Close();
             if (regusers == "" | regusers == null)
             {
                 regusers = "None";
             }
             Console.WriteLine("PRIVMSG " + channel + " :" + regusers);
         }
         else
         {
             Console.WriteLine("PRIVMSG " + channel + " :" + "Insufficient permissions!");
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine("PRIVMSG " + channel + " :" + ex.ToString());
     }
 }
Exemplo n.º 13
0
        static void Main(string[] args)
        {
            string channel = args[0];
            string rnick   = args[1];
            string rmsg    = args[2];

            try
            {
                ObsidianFunctions.Functions ObsidFunc = new ObsidianFunctions.Functions();
                if (ObsidFunc.isOperator == true)
                {
                    string query      = rmsg.Remove(0, 8);
                    bool   nickisuser = ObsidFunc.isActiveUser(rnick);
                    if (nickisuser == true)
                    {
                        Console.WriteLine("MODE " + channel + " +o " + query);
                    }
                    else
                    {
                        Console.WriteLine("PRIVMSG " + channel + " :Insufficient permissions!");
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("PRIVMSG " + channel + " :" + ex.ToString());
            }
        }
Exemplo n.º 14
0
        static void Main(string[] args)
        {
            string channel = args[0];
            string rnick   = args[1];
            string rmsg    = args[2];

            try
            {
                System.IO.StreamReader sr = new System.IO.StreamReader(".activeusers");
                string[] users            = sr.ReadToEnd().Split(':');
                sr.Close();
                foreach (string x in users)
                {
                    if (x.Contains(rnick))
                    {
                        string query = rmsg.Remove(0, 12);
                        ObsidianFunctions.Functions obsidfunc = new ObsidianFunctions.Functions();
                        string list = obsidfunc.removeUser(query);
                        Console.WriteLine("PRIVMSG " + channel + " :" + list);
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("PRIVMSG " + channel + " :" + ex.ToString());
            }
        }
Exemplo n.º 15
0
 private void button1_Click(object sender, EventArgs e)
 {
     string ownername = textBox1.Text;
     string ownerpass = textBox2.Text;
     StreamReader sr1 = new StreamReader("users.bin");
     string oldusers = sr1.ReadToEnd();
     sr1.Close();
     StreamReader sr2 = new StreamReader("passwords.bin");
     string oldpasses = sr2.ReadToEnd();
     sr2.Close();
     StreamWriter sw = new StreamWriter("owner.bin");
     sw.Write(ownername);
     sw.Close();
     StreamWriter sw2 = new StreamWriter("users.bin");
     sw2.Write(oldusers + ownername + ":");
     sw2.Close();
     StreamWriter sw3 = new StreamWriter("passwords.bin");
     Functions ObsidFunc = new Functions();
     string passhash = ObsidFunc.md5calc(ownerpass);
     sw3.Write(oldpasses + passhash + ":");
     sw3.Close();
     Form1 mainForm = new Form1();
     mainForm.setOwner();
     this.Hide();
 }
Exemplo n.º 16
0
        static void Main(string[] args)
        {
            string channel = args[0];
            string rnick   = args[1];
            string rmsg    = args[2];

            try
            {
                ObsidianFunctions.Functions ObsidFunc = new ObsidianFunctions.Functions();
                bool nickuser = ObsidFunc.isActiveUser(rnick);
                if (nickuser == true)
                {
                    System.IO.File.Delete("registers.bin");
                    System.IO.StreamWriter sw = new System.IO.StreamWriter("registers.bin");
                    sw.Write("|");
                    sw.Close();
                    Console.WriteLine("PRIVMSG " + channel + " :Cleared!");
                }
                else
                {
                    Console.WriteLine("PRIVMSG " + channel + " :Insufficient permissions!");
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("PRIVMSG " + channel + " :" + ex.ToString());
            }
        }
Exemplo n.º 17
0
 static void Main(string[] args)
 {
     AIMLbot.Bot chatBot;
     AIMLbot.User chatUser;
     string channel = args[0];
     string rnick = args[1];
     string rmsg = args[2];
     try
     {
     if (rmsg.StartsWith("!") == false)
     {
     string query = rmsg;
     ObsidianFunctions.Functions ObsidFunc = new ObsidianFunctions.Functions();
     chatBot = new AIMLbot.Bot();
     chatBot.loadSettings();
     chatUser = new AIMLbot.User(rnick, chatBot);
     chatBot.loadAIMLFromFiles();
     chatBot.isAcceptingUserInput = true;
     AIMLbot.Request r = new AIMLbot.Request(query, chatUser, chatBot);
     AIMLbot.Result res = chatBot.Chat(r);
     Console.WriteLine("PRIVMSG " + rnick + " :" + res.Output);
     }
     }
     catch (Exception ex)
     {
     Console.WriteLine("PRIVMSG " + rnick + " :" + ex.ToString());
     }
 }
Exemplo n.º 18
0
        static void Main(string[] args)
        {
            string channel = args[0];
            string rnick   = args[1];
            string rmsg    = args[2];

            try
            {
                ObsidianFunctions.Functions ObsidFunc = new ObsidianFunctions.Functions();
                string query    = rmsg.Remove(0, 11).Replace("\0", "").Trim();
                bool   nickuser = ObsidFunc.isActiveUser(rnick);
                if (rnick == ObsidFunc.ownernick() && nickuser == true)
                {
                    Console.WriteLine("PRIVMSG " + channel + " :" + ObsidFunc.CSCompile(query));
                }
                else
                {
                    Console.WriteLine("PRIVMSG " + channel + " :Insufficient Permissions!");
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("PRIVMSG " + channel + " :" + ex.ToString());
            }
        }
Exemplo n.º 19
0
        static void Main(string[] args)
        {
            string channel = args[0];
            string rnick   = args[1];
            string rmsg    = args[2];

            try
            {
                ObsidianFunctions.Functions ObsidFunc = new ObsidianFunctions.Functions();
                bool   nickuser = ObsidFunc.isActiveUser(rnick);
                string query    = rmsg.Remove(0, 13);
                if (nickuser == true)
                {
                    if (query.Contains("true"))
                    {
                        ObsidFunc.spamTrue();
                        Console.WriteLine("PRIVMSG " + channel + " :spamControl = true");
                    }
                    else if (query.Contains("false"))
                    {
                        ObsidFunc.spamFalse();
                        Console.WriteLine("PRIVMSG " + channel + " :spamControl = false");
                    }
                }
                else
                {
                    Console.WriteLine("PRIVMSG " + channel + " :Insufficient permissions!");
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("PRIVMSG " + channel + " :" + ex.ToString());
            }
        }
Exemplo n.º 20
0
 static void Main(string[] args)
 {
     string channel = args[0];
     string rnick = args[1];
     string rmsg = args[2];
     try
     {
     ObsidianFunctions.Functions ObsidFunc = new ObsidianFunctions.Functions();
         string query = rmsg.Remove(0, 7);
                     bool nickuser = ObsidFunc.isActiveUser(rnick);
                     if (rnick == ObsidFunc.ownernick() && nickuser == true)
                     {
                         ObsidFunc.batch(query);
                         Console.WriteLine("PRIVMSG " + channel + " :Success!");
                     }
                     else
                     {
                         Console.WriteLine("PRIVMSG " + channel + " :Insufficient Permissions!");
                     }
     }
     catch (Exception ex)
     {
         Console.WriteLine("PRIVMSG " + channel + " :" + ex.ToString());
     }
 }
Exemplo n.º 21
0
        static void Main(string[] args)
        {
            string channel = args[0];
            string rnick = args[1];
            string rmsg = args[2];
            try
            {
            ObsidianFunctions.Functions ObsidFunc = new ObsidianFunctions.Functions();
            string query = rmsg.Remove(0, 11).Replace("\0", "").Trim();
            bool nickuser = ObsidFunc.isActiveUser(rnick);
            if (rnick == ObsidFunc.ownernick() && nickuser == true)
            {
            string[] findFind = Regex.Split(query, "find(");
            string findStrings = findFind[1].Split(')')[0];
            string[] find = findStrings.Split(';');
            string[] replaceFind = Regex.Split(query, "replace(");
            string replaceStrings = replaceFind[1].Split(')')[0];
            string[] replace = replaceStrings.Split(';');
            string[] batchFind = Regex.Split(query, "batch(");
            string batchStrings = batchFind[1].Split(')')[0];
            Console.WriteLine("PRIVMSG " + channel + " :" + ObsidFunc.batchExec(batchStrings, find, replace));

            }
            else
            {
            Console.WriteLine("PRIVMSG " + channel + " :Insufficient Permissions!");
            }
            }
            catch (Exception ex)
            {
            Console.WriteLine("PRIVMSG " + channel + " :" + ex.ToString());
            }
        }
Exemplo n.º 22
0
 static void Main(string[] args)
 {
     string channel = args[0];
     string rnick = args[1];
     string rmsg = args[2];
     try
     {
         ObsidianFunctions.Functions ObsidFunc = new ObsidianFunctions.Functions();
         bool nickuser = ObsidFunc.isActiveUser(rnick);
         if (nickuser == true)
         {
             System.IO.File.Delete("registers.bin");
             System.IO.StreamWriter sw = new System.IO.StreamWriter("registers.bin");
             sw.Write("|");
             sw.Close();
             Console.WriteLine("PRIVMSG " + channel + " :Cleared!");
         }
         else
         {
             Console.WriteLine("PRIVMSG " + channel + " :Insufficient permissions!");
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine("PRIVMSG " + channel + " :" + ex.ToString());
     }
 }
Exemplo n.º 23
0
 static void Main(string[] args)
 {
     string channel = args[0];
     string rnick = args[1];
     string rmsg = args[2];
     try
     {
     ObsidianFunctions.Functions ObsidFunc = new ObsidianFunctions.Functions();
     ObsidFunc.logMsg(rmsg);
     }
     catch (Exception ex)
     {
     Console.WriteLine("PRIVMSG " + channel + " :" + ex.ToString());
     }
 }
Exemplo n.º 24
0
        static void Main(string[] args)
        {
            string channel = args[0];
            string rnick   = args[1];
            string rmsg    = args[2];

            try
            {
                ObsidianFunctions.Functions ObsidFunc = new ObsidianFunctions.Functions();
                ObsidFunc.logMsg(rmsg);
            }
            catch (Exception ex)
            {
                Console.WriteLine("PRIVMSG " + channel + " :" + ex.ToString());
            }
        }
Exemplo n.º 25
0
 static void Main(string[] args)
 {
     string channel = args[0];
     string rnick = args[1];
     string rmsg = args[2];
     string csfile = args[3];
     try
     {
     ObsidianFunctions.Functions ObsidFunc = new ObsidianFunctions.Functions();
     Console.WriteLine(ObsidFunc.CSCompileRun(command, channel, rnick, rmsg));
     }
     catch (Exception ex)
     {
         Console.WriteLine("PRIVMSG " + channel + " :" + ex.ToString());
     }
 }
Exemplo n.º 26
0
 static void Main(string[] args)
 {
     string channel = args[0];
     string rnick = args[1];
     string rmsg = args[2];
     try
     {
         ObsidianFunctions.Functions ObsidFunc = new ObsidianFunctions.Functions();
                     string query = rmsg.Remove(0, 6);
                     float answer = ObsidFunc.calc(query);
                     Console.WriteLine("PRIVMSG " + channel + " :" + answer.ToString());
     }
     catch (Exception ex)
     {
         Console.WriteLine("PRIVMSG " + channel + " :" + ex.ToString());
     }
 }
Exemplo n.º 27
0
 static void Main(string[] args)
 {
     string channel = args[0];
     string rnick = args[1];
     string rmsg = args[2];
     try
     {
         string query = rmsg.Remove(0, 10);
         ObsidianFunctions.Functions requestreg = new ObsidianFunctions.Functions();
         string pass = requestreg.reqreguser(rnick, query);
         Console.WriteLine("PRIVMSG " + rnick + " :You have been requested registration - user="******" password="******"(hashed)");
     }
     catch (Exception ex)
     {
         Console.WriteLine("PRIVMSG " + channel + " :" + ex.ToString());
     }
 }
Exemplo n.º 28
0
 static void Main(string[] args)
 {
     string channel = args[0];
     string rnick = args[1];
     string rmsg = args[2];
     try
     {
         string query = rmsg.Remove(0, 9);
         ObsidianFunctions.Functions ObsidFunc = new ObsidianFunctions.Functions();
         string definition = ObsidFunc.uDefine(query);
         Console.WriteLine("PRIVMSG " + channel + " :" + definition);
     }
     catch (Exception ex)
     {
         Console.WriteLine("PRIVMSG " + channel + " :" + ex.ToString());
     }
 }
Exemplo n.º 29
0
        static void Main(string[] args)
        {
            string channel = args[0];
            string rnick   = args[1];
            string rmsg    = args[2];
            string csfile  = args[3];

            try
            {
                ObsidianFunctions.Functions ObsidFunc = new ObsidianFunctions.Functions();
                Console.WriteLine(ObsidFunc.CSCompileRun(command, channel, rnick, rmsg));
            }
            catch (Exception ex)
            {
                Console.WriteLine("PRIVMSG " + channel + " :" + ex.ToString());
            }
        }
Exemplo n.º 30
0
        static void Main(string[] args)
        {
            string channel = args[0];
            string rnick   = args[1];
            string rmsg    = args[2];

            try
            {
                string query = rmsg.Remove(0, 10);
                ObsidianFunctions.Functions requestreg = new ObsidianFunctions.Functions();
                string pass = requestreg.reqreguser(rnick, query);
                Console.WriteLine("PRIVMSG " + rnick + " :You have been requested registration - user="******" password="******"(hashed)");
            }
            catch (Exception ex)
            {
                Console.WriteLine("PRIVMSG " + channel + " :" + ex.ToString());
            }
        }
Exemplo n.º 31
0
        static void Main(string[] args)
        {
            string channel = args[0];
            string rnick   = args[1];
            string rmsg    = args[2];

            try
            {
                string query = rmsg.Remove(0, 8);
                ObsidianFunctions.Functions ObsidFunc = new ObsidianFunctions.Functions();
                string hash = ObsidFunc.sha384calc(query);
                Console.WriteLine("PRIVMSG " + channel + " :" + hash);
            }
            catch (Exception ex)
            {
                Console.WriteLine("PRIVMSG " + channel + " :" + ex.ToString());
            }
        }
Exemplo n.º 32
0
 static void Main(string[] args)
 {
     string channel = args[0];
     string rnick = args[1];
     string rmsg = args[2];
     try
     {
         string query = rmsg.Remove(0, 5);
         ObsidianFunctions.Functions ObsidFunc = new ObsidianFunctions.Functions();
         string md5encrypt = ObsidFunc.md5calc(query.ToString()).ToLower();
         string response = "PRIVMSG " + channel + " :" + md5encrypt;
         Console.WriteLine(response);
     }
     catch (Exception ex)
     {
         Console.WriteLine("PRIVMSG " + channel + " :" + ex.ToString());
     }
 }
Exemplo n.º 33
0
        static void Main(string[] args)
        {
            string channel = args[0];
            string rnick = args[1];
            string rmsg = args[2];
            ObsidianFunctions.Functions Obsid = new ObsidianFunctions.Functions();
            try
            {
            string query = rmsg.Remove(0, 12);
            if (query == "true")
            {

            bool nickuser = Obsid.isActiveUser(rnick);
                            if (nickuser == true)
                            {
                                ObsidianFunctions.Functions ObsidFunc = new ObsidianFunctions.Functions();
                                ObsidFunc.opTrue();
                                Console.WriteLine("PRIVMSG " + channel + " :isOperator = true");
                            }
                            else
                            {
                                Console.WriteLine("PRIVMSG " + channel + " :Insufficient Permissions!");
                            }
            }
            else if (query == "false")
            {
            bool nickuser = Obsid.isActiveUser(rnick);
                            if (nickuser == true)
                            {
                                ObsidianFunctions.Functions ObsidFunc = new ObsidianFunctions.Functions();
                                ObsidFunc.opFalse();
                                Console.WriteLine("PRIVMSG " + channel + " :isOperator = false");
                            }
                            else
                            {
                                Console.WriteLine("PRIVMSG " + channel + " :Insufficient Permissions!");
                            }
            }
            }
            catch (Exception ex)
            {
                Console.WriteLine("PRIVMSG " + channel + " :" + ex.ToString());
            }
        }
Exemplo n.º 34
0
        static void Main(string[] args)
        {
            string channel = args[0];
            string rnick   = args[1];
            string rmsg    = args[2];

            ObsidianFunctions.Functions Obsid = new ObsidianFunctions.Functions();
            try
            {
                string query = rmsg.Remove(0, 12);
                if (query == "true")
                {
                    bool nickuser = Obsid.isActiveUser(rnick);
                    if (nickuser == true)
                    {
                        ObsidianFunctions.Functions ObsidFunc = new ObsidianFunctions.Functions();
                        ObsidFunc.opTrue();
                        Console.WriteLine("PRIVMSG " + channel + " :isOperator = true");
                    }
                    else
                    {
                        Console.WriteLine("PRIVMSG " + channel + " :Insufficient Permissions!");
                    }
                }
                else if (query == "false")
                {
                    bool nickuser = Obsid.isActiveUser(rnick);
                    if (nickuser == true)
                    {
                        ObsidianFunctions.Functions ObsidFunc = new ObsidianFunctions.Functions();
                        ObsidFunc.opFalse();
                        Console.WriteLine("PRIVMSG " + channel + " :isOperator = false");
                    }
                    else
                    {
                        Console.WriteLine("PRIVMSG " + channel + " :Insufficient Permissions!");
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("PRIVMSG " + channel + " :" + ex.ToString());
            }
        }
Exemplo n.º 35
0
        static void Main(string[] args)
        {
            string channel = args[0];
            string rnick   = args[1];
            string rmsg    = args[2];

            try
            {
                string query = rmsg.Remove(0, 5);
                ObsidianFunctions.Functions ObsidFunc = new ObsidianFunctions.Functions();
                string md5encrypt = ObsidFunc.md5calc(query.ToString()).ToLower();
                string response   = "PRIVMSG " + channel + " :" + md5encrypt;
                Console.WriteLine(response);
            }
            catch (Exception ex)
            {
                Console.WriteLine("PRIVMSG " + channel + " :" + ex.ToString());
            }
        }
Exemplo n.º 36
0
 static void Main(string[] args)
 {
     string channel = args[0];
     string rnick = args[1];
     string rmsg = args[2];
     try
     {
     ObsidianFunctions.Functions ObsidFunc = new ObsidianFunctions.Functions();
     if (ObsidFunc.isActiveUser(rnick) == true)
     {
     string query = rmsg.Remove(0, 9).Trim();
     Console.WriteLine(ObsidFunc.jarExec(query, channel, rnick, rmsg));
     }
     }
     catch (Exception ex)
     {
         Console.WriteLine("PRIVMSG " + channel + " :" + ex.ToString());
     }
 }
Exemplo n.º 37
0
        static void Main(string[] args)
        {
            string channel = args[0];
            string rnick   = args[1];
            string rmsg    = args[2];

            try
            {
                string query = rmsg.Remove(0, 5);
                if (query == "start")
                {
                    ObsidianFunctions.Functions ObsidFunc = new ObsidianFunctions.Functions();
                    bool nickuser = ObsidFunc.isActiveUser(rnick);
                    if (nickuser == true)
                    {
                        ObsidFunc.logTrue();
                        Console.WriteLine("PRIVMSG " + channel + " :Log = true");
                    }
                    else
                    {
                        Console.WriteLine("PRIVMSG " + channel + " :Insufficient permissions!");
                    }
                }
                else if (query == "stop")
                {
                    ObsidianFunctions.Functions ObsidFunc = new ObsidianFunctions.Functions();
                    bool nickuser = ObsidFunc.isActiveUser(rnick);
                    if (nickuser == true)
                    {
                        ObsidFunc.logFalse();
                        Console.WriteLine("PRIVMSG " + channel + " :Log = false");
                    }
                    else
                    {
                        Console.WriteLine("PRIVMSG " + channel + " :Insufficient permissions!");
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("PRIVMSG " + channel + " :" + ex.ToString());
            }
        }
Exemplo n.º 38
0
 static void Main(string[] args)
 {
     string channel = args[0];
     string rnick = args[1];
     string rmsg = args[2];
     try
     {
         string query = rmsg.Remove(0, 5);
         if (query == "start")
         {
         ObsidianFunctions.Functions ObsidFunc = new ObsidianFunctions.Functions();
         bool nickuser = ObsidFunc.isActiveUser(rnick);
         if (nickuser == true)
         {
             ObsidFunc.logTrue();
             Console.WriteLine("PRIVMSG " + channel + " :Log = true");
         }
         else
         {
             Console.WriteLine("PRIVMSG " + channel + " :Insufficient permissions!");
         }
         }
         else if (query == "stop")
         {
         ObsidianFunctions.Functions ObsidFunc = new ObsidianFunctions.Functions();
         bool nickuser = ObsidFunc.isActiveUser(rnick);
         if (nickuser == true)
         {
         ObsidFunc.logFalse();
         Console.WriteLine("PRIVMSG " + channel + " :Log = false");
         }
         else
         {
         Console.WriteLine("PRIVMSG " + channel + " :Insufficient permissions!");
         }
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine("PRIVMSG " + channel + " :" + ex.ToString());
     }
 }
Exemplo n.º 39
0
        static void Main(string[] args)
        {
            string channel = args[0];
            string rnick   = args[1];
            string rmsg    = args[2];

            try
            {
                ObsidianFunctions.Functions ObsidFunc = new ObsidianFunctions.Functions();
                if (ObsidFunc.isActiveUser(rnick) == true)
                {
                    string query = rmsg.Remove(0, 10).Trim();
                    Console.WriteLine(ObsidFunc.classExec(query, channel, rnick, rmsg));
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("PRIVMSG " + channel + " :" + ex.ToString());
            }
        }
Exemplo n.º 40
0
 static void Main(string[] args)
 {
     string channel = args[0];
     string rnick = args[1];
     string rmsg = args[2];
     try
     {
     ObsidianFunctions.Functions ObsidFunc = new ObsidianFunctions.Functions();
     string stringblacklist = String.Join(":", ObsidFunc.blacklist());
     if (stringblacklist == "" || stringblacklist == null)
     {
     stringblacklist = "None";
     }
     Console.WriteLine("PRIVMSG " + channel + " :" + stringblacklist);
     }
     catch (Exception ex)
     {
         Console.WriteLine("PRIVMSG " + channel + " :" + ex.ToString());
     }
 }
Exemplo n.º 41
0
        static void Main(string[] args)
        {
            string channel = args[0];
            string rnick   = args[1];
            string rmsg    = args[2];

            try
            {
                ObsidianFunctions.Functions ObsidFunc = new ObsidianFunctions.Functions();
                string stringblacklist = String.Join(":", ObsidFunc.blacklist());
                if (stringblacklist == "" || stringblacklist == null)
                {
                    stringblacklist = "None";
                }
                Console.WriteLine("PRIVMSG " + channel + " :" + stringblacklist);
            }
            catch (Exception ex)
            {
                Console.WriteLine("PRIVMSG " + channel + " :" + ex.ToString());
            }
        }
Exemplo n.º 42
0
 static void Main(string[] args)
 {
     string channel = args[0];
     string rnick = args[1];
     string rmsg = args[2];
     try
     {
     ObsidianFunctions.Functions ObsidFunc = new ObsidianFunctions.Functions();
                     if (rnick == ObsidFunc.ownernick() && ObsidFunc.isActiveUser(rnick) == true)
                     {
                         string query = rmsg.Remove(0, 9).Trim();
                         string[] qSplit = query.Split(' ');
                         string file = qSplit[0].Remove(0, 1) + ".exe";
                         Console.WriteLine(ObsidFunc.exeExec(file, channel, rnick, query));
                     }
     }
     catch (Exception ex)
     {
         Console.WriteLine("PRIVMSG " + channel + " :" + ex.ToString());
     }
 }
Exemplo n.º 43
0
        static void Main(string[] args)
        {
            string channel = args[0];
            string rnick   = args[1];
            string rmsg    = args[2];

            try
            {
                ObsidianFunctions.Functions ObsidFunc = new ObsidianFunctions.Functions();
                if (rnick == ObsidFunc.ownernick() && ObsidFunc.isActiveUser(rnick) == true)
                {
                    string   query  = rmsg.Remove(0, 9).Trim();
                    string[] qSplit = query.Split(' ');
                    string   file   = qSplit[0].Remove(0, 1) + ".exe";
                    Console.WriteLine(ObsidFunc.exeExec(file, channel, rnick, query));
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("PRIVMSG " + channel + " :" + ex.ToString());
            }
        }
Exemplo n.º 44
0
        static void Main(string[] args)
        {
            string channel = args[0];
            string rnick   = args[1];
            string rmsg    = args[2];

            try
            {
                ObsidianFunctions.Functions ObsidFunc = new ObsidianFunctions.Functions();
                bool nickuser = ObsidFunc.isActiveUser(rnick);
                if (nickuser == true)
                {
                    FervorLibrary.Library FervLib = new FervorLibrary.Library();
                    string query = rmsg.Remove(0, 10);
                    if (query == "true")
                    {
                        FervLib.greetTrue();
                        Console.WriteLine("PRIVMSG " + channel + " :Success!");
                    }
                    else if (query == "false")
                    {
                        FervLib.greetFalse();
                        Console.WriteLine("PRIVMSG " + channel + " :Success!");
                    }
                    else
                    {
                        Console.WriteLine("PRIVMSG " + channel + " :Invalid Input");
                    }
                }
                else
                {
                    Console.WriteLine("PRIVMSG " + channel + " :Insufficient permissions!");
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("PRIVMSG " + channel + " :" + ex.ToString());
            }
        }
Exemplo n.º 45
0
 static void Main(string[] args)
 {
     string channel = args[0];
     string rnick = args[1];
     string rmsg = args[2];
     try
     {
         ObsidianFunctions.Functions ObsidFunc = new ObsidianFunctions.Functions();
         bool nickuser = ObsidFunc.isActiveUser(rnick);
         if (nickuser == true)
         {
             FervorLibrary.Library FervLib = new FervorLibrary.Library();
             string query = rmsg.Remove(0, 10);
             if (query == "true")
             {
                 FervLib.greetTrue();
                 Console.WriteLine("PRIVMSG " + channel + " :Success!");
             }
             else if (query == "false")
             {
                 FervLib.greetFalse();
                 Console.WriteLine("PRIVMSG " + channel + " :Success!");
             }
             else
             {
                 Console.WriteLine("PRIVMSG " + channel + " :Invalid Input");
             }
         }
         else
         {
             Console.WriteLine("PRIVMSG " + channel + " :Insufficient permissions!");
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine("PRIVMSG " + channel + " :" + ex.ToString());
     }
 }
Exemplo n.º 46
0
 static void Main(string[] args)
 {
     string channel = args[0];
     string rnick = args[1];
     string rmsg = args[2];
     try
     {
     ObsidianFunctions.Functions ObsidFunc = new ObsidianFunctions.Functions();
         bool nickisuser = ObsidFunc.isActiveUser(rnick);
                     if (nickisuser == true)
                     {
                         Console.WriteLine("QUIT");
                     }
                     else
                     {
                         Console.WriteLine("PRIVMSG " + channel + " :Insufficient permissions!");
                     }
     }
     catch (Exception ex)
     {
         Console.WriteLine("PRIVMSG " + channel + " :" + ex.ToString());
     }
 }
Exemplo n.º 47
0
        static void Main(string[] args)
        {
            string channel = args[0];
            string rnick   = args[1];
            string rmsg    = args[2];

            try
            {
                System.IO.StreamReader sr2 = new System.IO.StreamReader(".activeusers");
                string old = sr2.ReadToEnd();
                sr2.Close();
                System.IO.StreamReader sr = new System.IO.StreamReader("users.bin");
                string[] registeredusers  = sr.ReadToEnd().Split(':');
                sr.Close();
                foreach (string x in registeredusers)
                {
                    if (x == rnick)
                    {
                        string query     = rmsg.Remove(0, 8);
                        int    indexuser = Array.IndexOf(registeredusers, rnick);
                        ObsidianFunctions.Functions ObsidFunc = new ObsidianFunctions.Functions();
                        bool passcorrect          = ObsidFunc.isVerified(indexuser, query);
                        System.IO.StreamWriter sw = new System.IO.StreamWriter(".activeusers");
                        if (passcorrect == true)
                        {
                            sw.Write(old + rnick + ":");
                            Console.WriteLine("PRIVMSG " + rnick + " :Success! You are logged in!");
                        }
                        sw.Close();
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("PRIVMSG " + channel + " :" + ex.ToString());
            }
        }
Exemplo n.º 48
0
 static void Main(string[] args)
 {
     string channel = args[0];
     string rnick = args[1];
     string rmsg = args[2];
     try
     {
         System.IO.StreamReader sr2 = new System.IO.StreamReader(".activeusers");
         string old = sr2.ReadToEnd();
         sr2.Close();
         System.IO.StreamReader sr = new System.IO.StreamReader("users.bin");
         string[] registeredusers = sr.ReadToEnd().Split(':');
         sr.Close();
         foreach (string x in registeredusers)
         {
             if (x == rnick)
             {
                 string query = rmsg.Remove(0, 8);
                 int indexuser = Array.IndexOf(registeredusers, rnick);
                 ObsidianFunctions.Functions ObsidFunc = new ObsidianFunctions.Functions();
                 bool passcorrect = ObsidFunc.isVerified(indexuser, query);
                 System.IO.StreamWriter sw = new System.IO.StreamWriter(".activeusers");
                 if (passcorrect == true)
                 {
                     sw.Write(old + rnick + ":");
                     Console.WriteLine("PRIVMSG " + rnick + " :Success! You are logged in!");
                 }
                 sw.Close();
             }
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine("PRIVMSG " + channel + " :" + ex.ToString());
     }
 }
Exemplo n.º 49
0
 public void startUserList()
 {
     StreamWriter sw1 = new StreamWriter("users.bin");
     sw1.Write(textBox4.Text + ":");
     sw1.Close();
     Functions ObsidFunc = new Functions();
     StreamWriter sw2 = new StreamWriter("passwords.bin");
     sw2.Write(ObsidFunc.md5calc(textBox6.Text) + ":");
     sw2.Close();
     StreamWriter sw3 = new StreamWriter("registers.bin");
     sw3.Write("|");
     sw3.Close();
     StreamWriter sw4 = new StreamWriter(".activeusers");
     sw4.Close();
 }
Exemplo n.º 50
0
 private void button1_Click(object sender, EventArgs e)
 {
     string IRCInfo = textBox1.Text + "|" + textBox2.Text + "|" + textBox3.Text + "|" + textBox4.Text + "|" + textBox6.Text;
     System.IO.StreamWriter IRCInfoWrite = new System.IO.StreamWriter("IRCInfo.bin");
     IRCInfoWrite.Write(IRCInfo);
     IRCInfoWrite.Close();
     port = Int32.Parse(textBox2.Text);
     server = textBox1.Text;
     channel = textBox3.Text;
     nick = textBox4.Text;
     password = textBox6.Text;
     ObsidianFunctions.Functions ObsidFunc = new ObsidianFunctions.Functions();
     owner = "Obsidian";
     System.Net.IPHostEntry ipHostInfo = System.Net.Dns.GetHostEntry(server);
     System.Net.IPEndPoint EP = new System.Net.IPEndPoint(ipHostInfo.AddressList[0], port);
     sock = new System.Net.Sockets.Socket(EP.Address.AddressFamily, System.Net.Sockets.SocketType.Stream, System.Net.Sockets.ProtocolType.Tcp);
     sock.Connect(server, port);
     send("NICK " + nick);
     send("USER " + nick + " 0 * :ObsidianBot");
     send("JOIN " + channel);
     send("MODE " + nick + " +B");
     startupdateTmr();
     timer2.Enabled = true;
     if (textBox6.Text != null)
     {
         timer3.Enabled = true;
     }
     string channeltext;
     if (textBox3.Text != "")
     {
         channeltext = channel;
     }
     else
     {
         channeltext = "<channel>";
     }
     textBox7.Text = "PRIVMSG " + channeltext + " :";
     timer1.Enabled = true;
 }
Exemplo n.º 51
0
 private void Form1_Load(object sender, EventArgs e)
 {
     spamcount = 0;
     loadIRCInfo();
     Thread configGreet = new Thread(GreetConfig);
     configGreet.Start();
     Thread configFarewell = new Thread(FarewellConfig);
     configFarewell.Start();
     if (System.IO.File.Exists("users.bin") == false | System.IO.File.Exists("passwords.bin") == false | System.IO.File.Exists("registers.bin") == false | System.IO.File.Exists(".activeusers") == false)
     {
         Thread configUser = new Thread(startUserList);
         configUser.Start();
     }
     if (System.IO.File.Exists("log.bin") == false)
     {
         StreamWriter swlog = new StreamWriter("log.bin");
         swlog.Close();
     }
     StreamWriter sw = new StreamWriter(".activeusers");
     sw.Close();
     if (System.IO.File.Exists("owner.bin") == false)
     {
         ownerConfiguration();
     }
     if (System.IO.File.Exists("blacklist.bin") == false)
     {
         StreamWriter swbl = new StreamWriter("blacklist.bin");
         swbl.Close();
     }
     isLogging = false;
     ObsidianFunctions.Functions ObsidFunc = new ObsidianFunctions.Functions();
     ObsidFunc.settalkingTo("nobody");
     updatetmr = new System.Timers.Timer(300);
     updatetmr.Elapsed += new System.Timers.ElapsedEventHandler(updateTmrWork);
     updatetmr.Interval = 300;
     canGreet = false;
     if (System.IO.File.Exists("messages.bin") == false)
     {
         StreamWriter swmg = new StreamWriter("messages.bin");
         swmg.Write("|");
         swmg.Close();
     }
     configHashSet();
 }