Esempio n. 1
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (CompileScript())
     {
         Logger.AddMessage("Methods installed");
         Parser     = new MethodParser();
         Parser.CMD = new CommendLine();
         Parser.CMD.OutPuter.OnMessageReceived += Logger_OnMessageReceived;
         th = new Thread(new ThreadStart(StartDebugger));
         th.IsBackground = true;
         th.Start();
         button1.Enabled       = false;
         button2.Enabled       = true;
         button3.Enabled       = true;
         richTextBox1.ReadOnly = true;
     }
 }
Esempio n. 2
0
        public async void Run()
        {
            var MainMenu = new ReplyKeyboardMarkup();

            MainMenu.Keyboard = new KeyboardButton[][]
            {
                new KeyboardButton[]
                {
                    new KeyboardButton("About Us👍"),
                },

                new KeyboardButton[]
                {
                    new KeyboardButton("Supported Site for leeching?")
                }
            };
            TelegramBot Bot = null;

            try {
                Bot = new TelegramBot(Token);
                await Bot.MakeRequestAsync(new GetMe());

                log.AddMessage(string.Format("Bot connected."), Log.Type.OutPut);
            }
            catch { log.AddMessage("Can't connect the bot!", Log.Type.Error); return; }
            long Offset = 0;

            while (stat)
            {
                var Update = await Bot.MakeRequestAsync(new GetUpdates()
                {
                    Offset = Offset
                });

                foreach (var Up in Update)
                {
                    try
                    {
                        List <Item> items = new List <Item>();
                        Offset = Up.UpdateId + 1;
                        var    Message = Up.Message.Text;
                        string neh     = "";
                        if (Message != "")
                        {
                            log.AddMessage(string.Format("Telegram Service: Text: {0}  Username: {1} ChatID: {2}", Message, Up.Message.From.Username, Up.Message.From.Id), MSC.Log.Type.Infomation);
                            if (Message == "About Us👍")
                            {
                                neh += @"
💢Bot             By   : Rextor
💢MSC           By   : Rextor
💢Scryipts      By  :  Rextor && Reza-HNA
💢Account    By   : SkyFall

➖➖➖➖➖➖➖➖➖➖
Powered By MSC | @VIPLeechBot";
                                var msg = new SendMessage(Up.Message.Chat.Id, neh)
                                {
                                    ReplyMarkup = MainMenu
                                };
                                await Bot.MakeRequestAsync(msg);
                            }
                            if (Message == "/start")
                            {
                                neh = @"♨️با سلام خدمت کاربر گرامی 
به ربات وی ای پی لیچر (VIP Leecher) خوش امدید 
با استفاده از این ربات میتوانید از سایت های زیر بدون محدودیت دانلود کنید با سرعت زیاد 😃";

                                neh += @"

➖➖➖➖➖➖➖➖➖➖
Powered By MSC | @VIPLeechBot";
                                var msg = new SendMessage(Up.Message.Chat.Id, neh)
                                {
                                    ReplyMarkup = MainMenu
                                };
                                await Bot.MakeRequestAsync(msg);
                            }
                            if (Message == "Supported Site for leeching?")
                            {
                                SiteDetecter.TypeSite[] list = Enum.GetValues(typeof(SiteDetecter.TypeSite)).Cast <SiteDetecter.TypeSite>().ToArray();
                                Array.Sort <SiteDetecter.TypeSite>(list);
                                List <string> lfw = new List <string>();
                                foreach (SiteDetecter.TypeSite item in list)
                                {
                                    lfw.Add(item.ToString());
                                }
                                ArrayList q = new ArrayList();
                                foreach (object o in lfw)
                                {
                                    q.Add(o);
                                }
                                q.Sort();
                                lfw.Clear();
                                foreach (object o in q)
                                {
                                    lfw.Add(o.ToString());
                                }
                                neh += @"💢Supported Site for leeching :
";
                                foreach (string gw in lfw)
                                {
                                    neh += @"
💢" + gw;
                                }


                                neh += @"

➖➖➖➖➖➖➖➖➖➖
Powered By MSC | @VIPLeechBot";
                                var msg = new SendMessage(Up.Message.Chat.Id, neh)
                                {
                                    ReplyMarkup = MainMenu
                                };
                                await Bot.MakeRequestAsync(msg);
                            }

                            else
                            {
                                Leecher.Scripts.SiteDetecter.TypeSite typesite = Scripts.SiteDetecter.GetTypeSite(Message);
                                neh = typesite.ToString() + @" Detected!
Please wait...";
                                var msg = new SendMessage(Up.Message.Chat.Id, neh)
                                {
                                    ReplyMarkup = MainMenu
                                };
                                await Bot.MakeRequestAsync(msg);

                                string url = Message;

                                items = Core.GetList(url, "", typesite);

                                neh = @"🚀Links:

";
                                foreach (Item i in items)
                                {
                                    neh += @"
➖➖➖➖➖➖➖➖➖➖
📌" + i.Info + @"
📂" + i.Link;
                                }


                                neh += @"

➖➖➖➖➖➖➖➖➖➖
Powered By MSC | @VIPLeechBot";
                                if (items.Count != 0)
                                {
                                    var msg1 = new SendMessage(Up.Message.Chat.Id, neh)
                                    {
                                        ReplyMarkup = MainMenu
                                    };
                                    await Bot.MakeRequestAsync(msg1);
                                }
                            }
                        }
                    }
                    catch (Exception ex) { log.AddMessage(ex.Message, Log.Type.Error); }
                }
            }
        }
Esempio n. 3
0
        private bool CompileScript()
        {
            string[] lines = richTextBox1.Lines;
            Body   = new MSC.Script.Body();
            Logger = new MSC.Logger();
            Logger.OnMessageReceived += Logger_OnMessageReceived;
            richTextBox1.Clear();
            richTextBox2.Clear();
            treeView1.Nodes.Clear();
            try
            {
                Body.Initialize(lines);
                foreach (MSC.Script.Method method in Body.Methods)
                {
                    List <TreeNode> nodes = new List <TreeNode>();
                    foreach (MSC.Script.Instruction inst in method.Instructions)
                    {
                        TreeNode node = new TreeNode(inst.ToString());
                        nodes.Add(node);
                    }
                    TreeNode trnode = new TreeNode(method.IndexPous + "- " + method.Type + "(" + method.Instructions.Count + ")", nodes.ToArray());
                    treeView1.Nodes.Add(trnode);
                }
                richTextBox1.Lines = lines;
                return(true);
            }catch (Exception ex)
            {
                Logger.AddMessage(ex.Message, Log.Type.Error);
                if (ex.Message.Contains("Error >"))
                {
                    int errorline = int.Parse(ex.Message.Split(':')[1]);
                    int i         = 1;
                    foreach (string item in lines)
                    {
                        if (i == errorline)
                        {
                            richTextBox1.SelectionStart  = richTextBox1.TextLength;
                            richTextBox1.SelectionLength = 0;
                            Color temp = richTextBox1.SelectionBackColor;

                            richTextBox1.SelectionBackColor = Color.Red;
                            if (i != lines.Length)
                            {
                                richTextBox1.AppendText(item + "\n");
                            }
                            else
                            {
                                richTextBox1.AppendText(item);
                            }
                            richTextBox1.SelectionBackColor = temp;
                        }
                        else
                        {
                            if (i != lines.Length)
                            {
                                richTextBox1.AppendText(item + "\n");
                            }
                            else
                            {
                                richTextBox1.AppendText(item);
                            }
                        }
                        i++;
                    }
                }
                return(false);
            }
        }