public void Teleport() { string player = ""; main.Invoke((MethodInvoker) delegate() { player = main.tbxMainPlayer.Text; }); main.autoTP = 11; foreach (Keys keyDown in pressedKeys.ToArray()) //Send all the keys up so they don't interfere with the /tp { foreach (Client c in main.clients) { Native.SendUp(c.clientProcess, keyDown); } } Thread.Sleep(Config.Default.debugTPDelay); foreach (Client c in main.clients) { Native.SendString(c.clientProcess, "/teleport " + player); } foreach (Keys keyDown in pressedKeys.ToArray()) { foreach (Client c in main.clients) { Native.SendDown(c.clientProcess, keyDown); } } }
private void ControlPad_KeyDown(object sender, KeyEventArgs e) { if (main.keysToSend.Contains(e.KeyCode)) { pressedKeys.Add(e.KeyCode); foreach (Client c in main.clients) { Native.SendDown(c.clientProcess, e.KeyCode); } } }
private void Form1_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { e.Handled = true; } if (running == 1 && keysToSend.Contains(e.KeyCode)) { foreach (Client c in clients) { Native.SendDown(c.clientProcess, e.KeyCode); } } }