optimize what you can of this and send it back public async Task…
- User
optimize what you can of this and send it back
public async Task PlayAudio(InputSimulator ISim, TimeSpan duration, bool bypass, bool Combo) { bool wascombo = false; if (Combo) { if (ChatCombo) { ChatCombo = false; wascombo = true; } } if (ChatCombo) { if (!PartyMode) { ISim.Keyboard.KeyPress(VirtualKeyCode.RETURN); Thread.Sleep(65); ISim.Keyboard.TextEntry("/team"); Thread.Sleep(65); ISim.Keyboard.ModifiedKeyStroke(VirtualKeyCode.LCONTROL, VirtualKeyCode.VK_V); Thread.Sleep(65); ISim.Keyboard.KeyPress(VirtualKeyCode.RETURN); } else { ISim.Keyboard.KeyPress(VirtualKeyCode.RETURN); Thread.Sleep(65); ISim.Keyboard.TextEntry("/party"); Thread.Sleep(65); ISim.Keyboard.ModifiedKeyStroke(VirtualKeyCode.LCONTROL, VirtualKeyCode.VK_V); Thread.Sleep(65); ISim.Keyboard.KeyPress(VirtualKeyCode.RETURN); } } if (_isPlaying) { // Cancel the previous audio task but don't end the PTT key yet _cancellationTokenSource.Cancel(); _cancellationTokenSource.Dispose(); _cancellationTokenSource = new CancellationTokenSource(); }
code - Assistant