private static void Start( string proposedAcName, string processName, Coordinates coordinates, int interval ) { var acWorker = VacEnvironment.GetAcWorker(); var acName = proposedAcName; if (string.IsNullOrWhiteSpace(acName)) { acName = Guid.NewGuid().ToString(); } var ac = new AutoClicker { Name = acName, Active = true, Coordinates = coordinates, Interval = interval, ProcessName = processName, }; try { acWorker?.AutoClickers?.Add(acName, ac); ac.Init(); ConsoleHelper.WriteMessage($"Autoclicker '{acName}' started!"); } catch (Exception exc) { // Something went wrong, ensure the autoclicker worker doesn't keep track of this instance anymore. if (acWorker is { } && acName is { })
public void AutoClickerDelegateImplementation(AutoClicker autoClickerScript) { //Debug.Log("Auto-clicking!"); // Click the enemy. ClickEnemy(); }
private static void OnTimedEvent(object source, System.Timers.ElapsedEventArgs e) { System.IntPtr foreground; if ((foreground = AutoClicker.FindWindow(foregroundWindow, null)) == AutoClicker.hWnd) { SendKeys.SendWait("{Y}"); } else { System.Timers.Timer aTimer = (System.Timers.Timer)source; aTimer.Stop(); } }
private void button4_Click(object sender, EventArgs e) { foregroundWindow = textBox_msAppTitle.Text; if ((AutoClicker.hWnd = AutoClicker.FindWindow(foregroundWindow, null)) != IntPtr.Zero) { AutoClicker.RegisterHotKey(this.Handle, 10, 0x0002, 0x11);//Ctrl AutoClicker.SetForegroundWindow(AutoClicker.hWnd); System.Timers.Timer aTimer = new System.Timers.Timer(); aTimer.Elapsed += new System.Timers.ElapsedEventHandler(OnTimedEvent); // Set the Interval to 5 seconds. aTimer.Interval = (double)numericUpDown1.Value; aTimer.Enabled = true; } else { MessageBox.Show("Application Window not found.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } }
public ClearCommand(AutoClicker instance) => this.instance = instance;
public DeactivateCommand(AutoClicker instance) => this.instance = instance;
public HelpCommand(AutoClicker instance) => this.instance = instance;
public RemoveClickerCommand(AutoClicker instance) => this.instance = instance;
public CommandHandler(AutoClicker instance) { this.run = true; this.instance = instance; this.commands = new Dictionary <string, ICommand>(); }
public ExitCommand(AutoClicker instance) => this.instance = instance;
public AddClickerCommand(AutoClicker instance) => this.instance = instance;
public ButtonCommand(AutoClicker instance) => this.instance = instance;