Ejemplo n.º 1
0
        private void Open(Entity item, Element label)
        {
            if (Settings.BlockInput)
            {
                Mouse.BlockInput(true);
            }

            var oldMousePosition = Mouse.GetCursorPositionVector();

            Mouse.LeftMouseUp();
            Thread.Sleep(5);

            var entityScreenPos = label.GetClientRect().Center + windowOffset;

            Mouse.MoveCursorToPosition(entityScreenPos);

            while (label.IsVisible &&
                   (label.Address == ingameState.IngameUi.ItemsOnGroundLabelElement.LabelOnHover?.Address ||
                    item.Address == ingameState.IngameUi.ItemsOnGroundLabelElement.ItemOnHover?.Address))
            {
                Thread.Sleep(5);
                Mouse.LeftClick();
            }

            Thread.Sleep(5);
            Mouse.LeftMouseDown();
            Mouse.MoveCursorToPosition(oldMousePosition);
            if (Settings.BlockInput)
            {
                Mouse.BlockInput(false);
            }
        }