private void Button3_Click(object sender, EventArgs e)
 {
     PrivateVariable.nospam        = DateTime.Now;
     PrivateVariable.Battling      = false;
     PrivateVariable.InEventScreen = false;
     PrivateVariable.InMainScreen  = false;
     PrivateVariable.InMap         = false;
     BotCore.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.EmuDefaultLocation.X, PrivateVariable.EmuDefaultLocation.Y, 1318, 752, true);
         Docked = false;
     }
     foreach (Control control in Debug.Controls)
     {
         control.Enabled = true;
     }
     ScriptRun.StopScript();
     btn_Start.Enabled = true;
     Controls.Remove(tp);
 }
Example #2
0
        /// <summary>
        /// Capture loop
        /// </summary>

        private void Capt()
        {
            do
            {
                Thread.Sleep(1000);
                if (Variables.Proc != null)
                {
                    if (Variables.Proc.HasExited)
                    {
                        Variables.Proc = null;
                        Docked         = false;
                        continue;
                    }
                    if (Variables.emulator.EmulatorName() == "Nox")
                    {
                        var hide = DllImport.GetAllChildrenWindowHandles(IntPtr.Zero, "Qt5QWindowToolSaveBits", "Form", 2);
                        foreach (var h in hide)
                        {
                            DllImport.ShowWindow(h, 0);
                        }
                    }
                    try
                    {
                        var       handle = Variables.Proc.MainWindowHandle;
                        var       parent = DllImport.GetParent(handle);
                        Rectangle rect   = new Rectangle();
                        DllImport.GetWindowRect(handle, ref rect);
                        if (!Docked)
                        {
                            if (!ScriptRun.Run)
                            {
                                return;
                            }
                            PrivateVariable.EmuDefaultLocation = rect;
                            panel3.Invoke((MethodInvoker) delegate
                            {
                                DllImport.SetParent(Variables.Proc.MainWindowHandle, panel3.Handle);
                            });
                            tp.Invoke((MethodInvoker) delegate { tp.BringToFront(); });
                            Docked = true;
                        }
                        if (rect.X != -1 || rect.Y != -30)
                        {
                            DllImport.MoveWindow(handle, -1, -30, 1318, 752, false);
                        }
                    }
                    catch
                    {
                    }
                }
                else
                {
                    Docked = false;
                }
            } while (ScriptRun.Run);
        }
Example #3
0
        /// <summary>
        /// Capture loop
        /// </summary>

        private void Capt()
        {
            bool Docked = false;

            do
            {
                Thread.Sleep(2000);
                if (Variables.Proc != null)
                {
                    if (Variables.Proc.HasExited)
                    {
                        Variables.Proc = null;
                        Docked         = false;
                        continue;
                    }
                    try
                    {
                        var       handle = Variables.Proc.MainWindowHandle;
                        Rectangle rect   = new Rectangle();
                        DllImport.GetWindowRect(handle, ref rect);
                        if (!Docked)
                        {
                            if (!ScriptRun.Run)
                            {
                                return;
                            }
                            PrivateVariable.Instance.EmuDefaultLocation = rect;
                            panel3.Invoke((MethodInvoker) delegate
                            {
                                DllImport.SetParent(Variables.Proc.MainWindowHandle, panel3.Handle);
                            });
                            tp.Invoke((MethodInvoker) delegate { tp.BringToFront(); });
                            panel3.Invoke((MethodInvoker) delegate
                            {
                                DllImport.SetParent(Variables.Proc.MainWindowHandle, panel3.Handle);
                            });
                            Docked = true;
                        }
                        if (rect.X != -1 || rect.Y != -30)
                        {
                            DllImport.MoveWindow(handle, -1, -30, 1318, 752, false);
                        }
                    }
                    catch
                    {
                    }
                }
                else
                {
                    Docked = false;
                }
            } while (ScriptRun.Run);
        }