Пример #1
0
        private static bool DoSmallestSearch(ulong guid)
        {
            if (ObjectManager.ShouldDefend)
            {
                return(true);
            }
            GamePosition.Findpos(Memory.WindowHandle);
            int xOffset = -40;
            int yOffset = -40;

            while (!Memory.ReadObject(Memory.BaseAddress + (uint)Pointers.Globals.MouseOverGUID, typeof(ulong)).Equals(guid))
            {
                MoveMouse(GamePosition.GetCenterX + xOffset, GamePosition.GetCenterY + yOffset);
                Thread.Sleep(10);
                if (Memory.ReadObject(Memory.BaseAddress + (uint)Pointers.Globals.MouseOverGUID, typeof(ulong)).Equals(guid))
                {
                    break;
                }
                xOffset = xOffset + 10;
                if (xOffset > 50)
                {
                    yOffset = yOffset + 10;
                    xOffset = -40;
                    if (yOffset > 50)
                    {
                        break;
                    }
                }
            }
            if (Memory.ReadObject(Memory.BaseAddress + (uint)Pointers.Globals.MouseOverGUID, typeof(ulong)).Equals(guid))
            {
                return(true);
            }
            return(false);
        }
Пример #2
0
 //TODO: Do something to this functions, its freaking ugly
 private static bool LetsSearch(ulong guid, bool multiclick, bool click)
 {
     if (!Memory.ReadObject(Memory.BaseAddress + (uint)Pointers.Globals.MouseOverGUID, typeof(ulong)).Equals(guid))
     {
         GamePosition.Findpos(Memory.WindowHandle);
         if (!DoSmallestSearch(guid))
         {
             if (!Search(guid, GamePosition.Width / 16))
             {
                 if (!Search(guid, GamePosition.Width / 12))
                 {
                     if (!Search(guid, GamePosition.Width / 10))
                     {
                         if (!Search(guid, GamePosition.Width / 8))
                         {
                             if (!Search(guid, GamePosition.Width / 6))
                             {
                                 // DoSmallSearch(guid);
                             }
                         }
                     }
                 }
             }
         }
     }
     if (ObjectManager.GetAttackers.Count != 0 && ObjectManager.ShouldDefend)
     {
         return(false);
     }
     if (Memory.ReadObject(Memory.BaseAddress + (uint)Pointers.Globals.MouseOverGUID, typeof(ulong)).Equals(guid))
     {
         if (click)
         {
             if (!LazySettings.HookMouse)
             {
                 SetForGround();
             }
             if (multiclick)
             {
                 MoveMouse(MouseHelper.MousePosition.X, MouseHelper.MousePosition.Y - 15);
                 Thread.Sleep(50);
                 KeyHelper.SendKey("InteractWithMouseOver");
                 Thread.Sleep(50);
                 MoveMouse(MouseHelper.MousePosition.X, MouseHelper.MousePosition.Y + 15);
                 Thread.Sleep(50);
                 KeyHelper.SendKey("InteractWithMouseOver");
                 Thread.Sleep(50);
                 MoveMouse(MouseHelper.MousePosition.X - 15, MouseHelper.MousePosition.Y);
                 Thread.Sleep(50);
                 KeyHelper.SendKey("InteractWithMouseOver");
                 MoveMouse(MouseHelper.MousePosition.X + 15, MouseHelper.MousePosition.Y);
                 Thread.Sleep(50);
                 KeyHelper.SendKey("InteractWithMouseOver");
                 Thread.Sleep(50);
             }
             MoveMouse(MouseHelper.MousePosition.X, MouseHelper.MousePosition.Y);
             Thread.Sleep(50);
             KeyHelper.SendKey("InteractWithMouseOver");
             Thread.Sleep(50);
         }
         return(true);
     }
     return(false);
 }