private void Button1_Click(object sender, EventArgs e)
        {
            ScriptErrorHandler.errorImages.Clear();
            foreach (var f in Directory.GetFiles("Img\\Errors"))
            {
                Thread.Sleep(10);
                using (Stream bmp = File.Open(f, FileMode.Open))
                {
                    Image temp = Image.FromStream(bmp);
                    ScriptErrorHandler.errorImages.Add(new Bitmap(temp));
                }
            }
            if ((PrivateVariable.nospam - DateTime.Now).Duration() < TimeSpan.FromSeconds(4))
            {
                return;
            }
            PrivateVariable.nospam = DateTime.Now;
            Variables.ProchWnd     = panel3.Handle;
            richTextBox1.Text      = "";
            btn_Start.Enabled      = false;
            PrivateVariable.Skills.Clear();
            var files = Directory.GetFiles("Img\\Star");

            foreach (var f in files)
            {
                using (Stream bmp = File.Open(f, FileMode.Open))
                {
                    Image image = Image.FromStream(bmp);
                    PrivateVariable.Skills.Add(BotCore.Compress(image as Bitmap));
                }
            }
            if (panel3.Visible == false)
            {
                Width         += 1280;
                panel3.Visible = true;
            }
            panel3.Enabled = false;
            tp             = new TransparentPanel
            {
                Location = panel3.Location,
                Size     = panel3.Size,
                Enabled  = true,
                Visible  = true
            };
            tp.MouseDown += Tp_MouseDown;
            Controls.Add(tp);
            foreach (Control control in Debug.Controls)
            {
                if (control is Button)
                {
                    control.Enabled = false;
                }
            }
            ScriptRun.RunScript(true, (new VCBotScript() as ScriptInterface));
            Thread cap = new Thread(Capt);

            cap.Start();
        }
Exemple #2
0
 private void Button3_Click(object sender, EventArgs e)
 {
     if (cap != null)
     {
         try
         {
             if (cap.IsAlive)
             {
                 cap.Abort();
             }
         }
         catch
         {
         }
     }
     PrivateVariable.Instance.nospam        = DateTime.Now;
     PrivateVariable.Instance.Battling      = false;
     PrivateVariable.Instance.InEventScreen = false;
     PrivateVariable.Instance.InMainScreen  = false;
     PrivateVariable.Instance.InMap         = false;
     EmulatorLoader.EjectSockets();
     Variables.ScriptLog("Script Stopped!", Color.White);
     if (Width > 1280)
     {
         Width         -= 1280;
         panel3.Visible = false;
     }
     if (Variables.Proc != null)
     {
         DllImport.SetParent(Variables.Proc.MainWindowHandle, IntPtr.Zero);
         DllImport.MoveWindow(Variables.Proc.MainWindowHandle, PrivateVariable.Instance.EmuDefaultLocation.X, PrivateVariable.Instance.EmuDefaultLocation.Y, 1318, 752, true);
     }
     foreach (Control control in Debug.Controls)
     {
         control.Enabled = true;
     }
     ScriptRun.StopScript();
     btn_Start.Enabled = true;
     Controls.Remove(tp);
 }
 private void MetroButton1_Click(object sender, EventArgs e)
 {
     ScriptRun.ThrowException(new Exception("This is a testing exception!"));
 }