Пример #1
0
 private void Run()
 {
     while (runThread)
     {
         if (gotJob)
         {
             if (Environment.TickCount - lastPort >= 500)
             {
                 Ingame.Tele(curLoc, 60, true);
                 gotJob   = false;
                 lastPort = Environment.TickCount;
             }
         }
         else
         {
             if (cbHotKey.Checked)
             {
                 if (GetForegroundWindow() == BmWrapper.memory.WindowHandle) // has the attached wow focus?
                 {
                     if (BmWrapper.memory.ReadUInt(Inject.click2PortToggle) == 1)
                     {
                         loc.x = BmWrapper.memory.ReadFloat(Inject.click2PortCoords);
                         loc.y = BmWrapper.memory.ReadFloat(Inject.click2PortCoords + 4);
                         loc.z = BmWrapper.memory.ReadFloat(Inject.click2PortCoords + 8);
                         BmWrapper.memory.WriteUInt(Inject.click2PortToggle, 0);
                         Ingame.Tele(loc, 60, false);
                     }
                     else
                     {
                         float seconds = (float)nudTeleSpeed.Value;
                         float speed   = 7f * seconds;
                         if ((GetKeyState(0x68) & 0x0000FF80) == 0x0000FF80) // Numpad 8 pressed?
                         {
                             loc.x = ObjectManager.PlayerObject.Pos.x + (float)speed * (float)Math.Cos(ObjectManager.Facing);
                             loc.y = ObjectManager.PlayerObject.Pos.y + (float)speed * (float)Math.Sin(ObjectManager.Facing);
                             loc.z = ObjectManager.PlayerObject.Pos.z;
                             Console.WriteLine("Difference: " + loc.differenceTo(ObjectManager.PlayerObject.Pos));
                             Ingame.hotKeyTele(loc, (float)seconds);
                         }
                         else if ((GetKeyState(0x67) & 0x0000FF80) == 0x0000FF80) // Numpad 7 pressed?
                         {
                             loc.x = ObjectManager.PlayerObject.Pos.x;
                             loc.y = ObjectManager.PlayerObject.Pos.y;
                             loc.z = ObjectManager.PlayerObject.Pos.z + (float)speed;
                             Ingame.hotKeyTele(loc, (float)seconds);
                         }
                         else if ((GetKeyState(0x69) & 0x0000FF80) == 0x0000FF80) // Numpad 9 pressed?
                         {
                             loc.x = ObjectManager.PlayerObject.Pos.x;
                             loc.y = ObjectManager.PlayerObject.Pos.y;
                             loc.z = ObjectManager.PlayerObject.Pos.z - (float)speed;
                             Ingame.hotKeyTele(loc, (float)seconds);
                         }
                         else if ((GetKeyState(0x65) & 0x0000FF80) == 0x0000FF80) // Numpad 5 pressed?
                         {
                             loc.x = ObjectManager.PlayerObject.Pos.x + (float)speed * (float)-Math.Cos(ObjectManager.Facing);
                             loc.y = ObjectManager.PlayerObject.Pos.y + (float)speed * (float)-Math.Sin(ObjectManager.Facing);
                             loc.z = ObjectManager.PlayerObject.Pos.z;
                             Ingame.hotKeyTele(loc, (float)seconds);
                         }
                         else if ((GetKeyState(0x64) & 0x0000FF80) == 0x0000FF80) // Numpad 4 pressed?
                         {
                             loc.x = ObjectManager.PlayerObject.Pos.x + (float)speed * (float)Math.Cos(ObjectManager.Facing + (Math.PI / 2));
                             loc.y = ObjectManager.PlayerObject.Pos.y + (float)speed * (float)Math.Sin(ObjectManager.Facing + (Math.PI / 2));
                             loc.z = ObjectManager.PlayerObject.Pos.z;
                             Ingame.hotKeyTele(loc, (float)seconds);
                         }
                         else if ((GetKeyState(0x66) & 0x0000FF80) == 0x0000FF80) // Numpad 6 pressed?
                         {
                             loc.x = ObjectManager.PlayerObject.Pos.x + (float)speed * (float)Math.Cos(ObjectManager.Facing - (Math.PI / 2));
                             loc.y = ObjectManager.PlayerObject.Pos.y + (float)speed * (float)Math.Sin(ObjectManager.Facing - (Math.PI / 2));
                             loc.z = ObjectManager.PlayerObject.Pos.z;
                             Ingame.hotKeyTele(loc, (float)seconds);
                         }
                     }
                 }
                 else
                 {
                     //BmWrapper.memory.WriteUInt(Inject.timeStampMdofier, 0);
                 }
             }
         }
     }
 }