Ejemplo n.º 1
0
        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);
                }
            }
        }
Ejemplo n.º 2
0
        private void Form1_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                e.Handled = true;
            }

            if (e.KeyCode == (Keys)Enum.Parse(typeof(Keys), Config.Default.macroTPKey))
            {
                autoTP = 11;

                foreach (Client c in clients)
                {
                    Native.SendString(c.clientProcess, "/teleport " + tbxMainPlayer.Text);
                }
            }


            if (running == 1 && keysToSend.Contains(e.KeyCode))
            {
                foreach (Client c in clients)
                {
                    Native.SendUp(c.clientProcess, e.KeyCode);
                }
            }
        }
Ejemplo n.º 3
0
        private void ControlPad_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == (Keys)Enum.Parse(typeof(Keys), Config.Default.macroTPKey))
            {
                Teleport();
            }

            if (main.running == 1 && main.keysToSend.Contains(e.KeyCode))
            {
                //pressedKeys.Remove(e.KeyCode); this wont work because it's removing instances of that REFERENCE
                foreach (Keys key in pressedKeys.ToArray())
                {
                    if (object.Equals(key, e.KeyCode))
                    {
                        pressedKeys.Remove(key);
                    }
                }

                foreach (Client c in main.clients)
                {
                    Native.SendUp(c.clientProcess, e.KeyCode);
                }
            }
        }