private void ToggleRMB() { lastRmbToggle = DateTime.Now; if (rmbMinCps <= 0) { RMBMinCpsTextBox.Text = "1"; } if (rmbMaxCps < rmbMinCps) { RMBMaxCpsTextBox.Text = rmbMinCps.ToString(); } if(rmbRampupInitial < 0.1f) { RMBRampupInitial.Text = "0.1"; } rmbToggled = !rmbToggled; if (!canBothBeActive && rmbToggled) { lmbToggled = false; UpdateLMBVisuals(); } UpdateRMBVisuals(); if (playToggleSounds) { BackgroundBeep.Beep(rmbToggled ? 16000 : 10000, 1); } }
private static void CurrentWorkspaceModelOnNodeAdded(NodeModel obj) { if (_flag > Frequency().Count()) { _flag = 0; } BackgroundBeep.Beep(); _flag++; }
private void RMBAutoClick() { #region init Stopwatch sw = new Stopwatch(); double rampupProportion; double baseDelay; double miniDeviation; int delay; double deviation; double totalMilliseconds = 0; int clicks = 0; int carryover = 0; #endregion while (true) { if (rmbToggled) { rampupProportion = ((rmbRampupDuration == 0) ? 1 : ((System.Math.Min((DateTime.Now - lastRmbToggle).TotalMilliseconds, rmbRampupDuration) / (float)rmbRampupDuration) * (1 - rmbRampupInitial) + rmbRampupInitial)); baseDelay = (1000f / (BiasedRandom.NextDouble(rmbBias) * (rmbMaxCps - rmbMinCps) + rmbMinCps)) - carryover; miniDeviation = (rand.NextDouble() - 0.5) * rmbMiniDeviation; delay = (int)System.Math.Round(((baseDelay + miniDeviation) / rampupProportion)); if (clicks >= 10) { delay = delay - (int)System.Math.Round(totalMilliseconds / clicks); } RightMouseClick(); if (playClickSounds) { BackgroundBeep.Beep(1000, 1); } sw.Reset(); sw.Start(); Thread.Sleep(delay); sw.Stop(); deviation = sw.Elapsed.TotalMilliseconds - delay; if (clicks < normalizationClicks) { clicks++; totalMilliseconds += deviation; } carryover = (int)sw.ElapsedMilliseconds - delay; } else { Thread.Sleep(1); } } }
private void InitializeHotkeyButtons() { //LMB lmbHotkeyButton = new HotkeyButton(MouseButtons.XButton2); LMBHotkeyText.Text = $"Press [{(lmbHotkeyButton.GetHotkey())}] to start"; lmbHotkeyButton.HotkeySetEvent += (sender, e) => { LMBHotkeyText.Text = $"Press [{(lmbHotkeyButton.GetHotkey())}] to start"; }; lmbHotkeyButton.HotkeyPressed += (sender, e) => { ToggleLMB(); }; lmbHotkeyButton.SelectHotkeyEvent += (sender, e) => { LMBHotkeyText.Text = "[Press any key]"; }; //RMB rmbHotkeyButton = new HotkeyButton(MouseButtons.XButton1); RMBHotkeyText.Text = $"Press [{(rmbHotkeyButton.GetHotkey())}] to start"; rmbHotkeyButton.HotkeySetEvent += (sender, e) => { RMBHotkeyText.Text = $"Press [{(rmbHotkeyButton.GetHotkey())}] to start"; }; rmbHotkeyButton.HotkeyPressed += (sender, e) => { ToggleRMB(); }; rmbHotkeyButton.SelectHotkeyEvent += (sender, e) => { RMBHotkeyText.Text = "[Press any key]"; }; //Blockhit blockhitHotkeyButton = new HotkeyButton(Keys.G); BlockhitHotkeyText.Text = $"Press [{blockhitHotkeyButton.GetHotkey()}] to enable blockhits"; blockhitHotkeyButton.HotkeySetEvent += (sender, e) => { BlockhitHotkeyText.Text = $"Press [{blockhitHotkeyButton.GetHotkey()}] to enable blockhits"; }; blockhitHotkeyButton.HotkeyPressed += (sender, e) => { blockHit = !blockHit; BlockhitHotkeyText.Text = $"Press [{blockhitHotkeyButton.GetHotkey()}] to {((blockHit) ? "disable" : "enable")} blockhits"; if (blockHit) { BlockhitChangeHotkey.Background = toggledColor; } else { BlockhitChangeHotkey.ClearValue(BackgroundProperty); } if (playToggleSounds) { BackgroundBeep.Beep(blockHit ? 16000 : 8000, 1); } }; blockhitHotkeyButton.SelectHotkeyEvent += (sender, e) => { BlockhitHotkeyText.Text = "[Press any key]"; }; //Panic button panicHotkeyButton = new HotkeyButton(Keys.Multiply); PanicButtonTextBlock.Text = $"Panic Button [{panicHotkeyButton.GetHotkey()}]"; panicHotkeyButton.HotkeySetEvent += (sender, e) => { PanicButtonTextBlock.Text = $"Panic Button [{panicHotkeyButton.GetHotkey()}]"; }; panicHotkeyButton.HotkeyPressed += (sender, e) => { Close(); }; panicHotkeyButton.SelectHotkeyEvent += (sender, e) => { PanicButtonTextBlock.Text = "[Press any key]"; }; }