Exemple #1
0
 private void UseScrollWisdom(SharpDX.Vector2 scrollPos)
 {
     MouseTools.MoveCursor(MouseTools.GetMousePosition(), new Vector2(scrollPos.X, scrollPos.Y), 22);
     Thread.Sleep(Settings.Speed);
     MouseTools.MouseRightClickEvent();
     Thread.Sleep(Settings.Speed);
     KeyTools.KeyEvent(WinApiMouse.KeyEventFlags.KeyEventShiftVirtual, WinApiMouse.KeyEventFlags.KeyEventKeyDown);
 }
Exemple #2
0
        private void Indentity()
        {
            if (!_run)
            {
                return;
            }

            var scroll = _inventory.VisibleInventoryItems.FirstOrDefault(element => CheckNameItem(element, "Scroll of Wisdom"));

            if (scroll == null)
            {
                return;
            }
            var scrollPos = scroll.GetClientRect().Center;

            scrollPos.X += GameController.Window.GetWindowRectangle().X;
            scrollPos.Y += GameController.Window.GetWindowRectangle().Y;
            UseScrollWisdom(scrollPos);

            var items = _inventory.VisibleInventoryItems;

            foreach (var child in items)
            {
                if (!_run)
                {
                    KeyTools.KeyEvent(WinApiMouse.KeyEventFlags.KeyEventShiftVirtual, WinApiMouse.KeyEventFlags.KeyEventKeyUp);
                    return;
                }

                var item = child.AsObject <NormalInventoryItem>().Item;
                if (string.IsNullOrEmpty(item?.Path))
                {
                    continue;
                }

                var st = item.Path?.Split('/');

                var modsComponent = item?.GetComponent <Mods>();
                if (modsComponent == null || modsComponent.ItemRarity != ItemRarity.Rare || modsComponent.Identified || string.IsNullOrEmpty(item.Path) ||
                    st[2] == "Maps")
                {
                    continue;
                }

                var position = child.GetClientRect().Center;
                position.X += GameController.Window.GetWindowRectangle().X;
                position.Y += GameController.Window.GetWindowRectangle().Y;
                MouseTools.MoveCursor(MouseTools.GetMousePosition(), new Vector2(position.X, position.Y), 22);
                Thread.Sleep(Settings.Speed);
                MouseTools.MouseLeftClickEvent();
                Thread.Sleep(Settings.Speed);
            }

            Thread.Sleep(Settings.Speed);
            KeyTools.KeyEvent(WinApiMouse.KeyEventFlags.KeyEventShiftVirtual, WinApiMouse.KeyEventFlags.KeyEventKeyUp);
        }
Exemple #3
0
 private void MouseClickCtrl(SharpDX.Vector2 position)
 {
     MouseTools.MoveCursor(MouseTools.GetMousePosition(), new Vector2(position.X, position.Y), 22);
     Thread.Sleep(Settings.Speed);
     KeyTools.KeyEvent(WinApiMouse.KeyEventFlags.KeyLControlVirtual, WinApiMouse.KeyEventFlags.KeyEventKeyDown);
     Thread.Sleep(Settings.Speed);
     MouseTools.MouseLeftClickEvent();
     Thread.Sleep(Settings.Speed);
     KeyTools.KeyEvent(WinApiMouse.KeyEventFlags.KeyLControlVirtual, WinApiMouse.KeyEventFlags.KeyEventKeyUp);
 }
Exemple #4
0
        private void FirstTab()
        {
            do
            {
                KeyTools.KeyEvent(WinApiMouse.KeyEventFlags.KeyLeftVirtual, WinApiMouse.KeyEventFlags.KeyEventKeyDown);
                Thread.Sleep(Settings.Speed);
                KeyTools.KeyEvent(WinApiMouse.KeyEventFlags.KeyLeftVirtual, WinApiMouse.KeyEventFlags.KeyEventKeyUp);
                Thread.Sleep(Settings.Speed);

                if (_ingameState.ServerData.StashPanel.GetStashInventoryByIndex(0).AsObject <Element>().IsVisible)
                {
                    return;
                }
            }while (_run);
        }
        private void NextTab(int stashNum)
        {
            KeyTools.KeyEvent(WinApiMouse.KeyEventFlags.KeyRightVirtual, WinApiMouse.KeyEventFlags.KeyEventKeyDown);
            Thread.Sleep(Settings.Speed);
            KeyTools.KeyEvent(WinApiMouse.KeyEventFlags.KeyRightVirtual, WinApiMouse.KeyEventFlags.KeyEventKeyUp);

            Inventory inv;
            int       delay = Settings.Speed;

            do
            {
                Thread.Sleep(delay);
                delay -= delay / 5;
                inv    = _ingameState.ServerData.StashPanel.GetStashInventoryByIndex(stashNum - 1);
            }while (inv == null && _run && delay > 0);
            _stashZone = inv;
        }
Exemple #6
0
        private void NextTab(int stashNum)
        {
            KeyTools.KeyEvent(WinApiMouse.KeyEventFlags.KeyRightVirtual, WinApiMouse.KeyEventFlags.KeyEventKeyDown);
            Thread.Sleep(Settings.Speed);
            KeyTools.KeyEvent(WinApiMouse.KeyEventFlags.KeyRightVirtual, WinApiMouse.KeyEventFlags.KeyEventKeyUp);

            Inventory inv;
            int       delay = Settings.Speed;

            do
            {
                Thread.Sleep(delay);
                delay -= delay / 5;
                inv    = GameController.Game.IngameState.IngameUi.StashElement.GetStashInventoryByIndex(stashNum - 1);
            }while (inv == null && _run && delay > 0);

            _stash = inv;
        }
Exemple #7
0
        private void FirstTab()
        {
            var tabs = Settings.TabCount * 2;

            do
            {
                KeyTools.KeyEvent(WinApiMouse.KeyEventFlags.KeyLeftVirtual, WinApiMouse.KeyEventFlags.KeyEventKeyDown);
                Thread.Sleep(Settings.Speed);
                KeyTools.KeyEvent(WinApiMouse.KeyEventFlags.KeyLeftVirtual, WinApiMouse.KeyEventFlags.KeyEventKeyUp);
                Thread.Sleep(Settings.Speed);
                tabs--;
                if (GameController.Game.IngameState.IngameUi.StashElement.IndexVisibleStash < 1 ||
                    tabs <= 0)
                {
                    return;
                }
            }while (_run || tabs > 0);
        }
Exemple #8
0
        private void BackToTab(int currentTab, int needTab)
        {
            if (needTab < 0)
            {
                return;
            }
            if (needTab > currentTab)
            {
                do
                {
                    KeyTools.KeyEvent(WinApiMouse.KeyEventFlags.KeyRightVirtual, WinApiMouse.KeyEventFlags.KeyEventKeyDown);
                    Thread.Sleep(Settings.Speed);
                    KeyTools.KeyEvent(WinApiMouse.KeyEventFlags.KeyRightVirtual, WinApiMouse.KeyEventFlags.KeyEventKeyUp);
                    Thread.Sleep(Settings.Speed);

                    if (_ingameState.ServerData.StashPanel.GetStashInventoryByIndex(needTab - 1).AsObject <Element>().IsVisible)
                    {
                        return;
                    }
                }while (_run);
            }
            else if (needTab < currentTab)
            {
                do
                {
                    KeyTools.KeyEvent(WinApiMouse.KeyEventFlags.KeyLeftVirtual, WinApiMouse.KeyEventFlags.KeyEventKeyDown);
                    Thread.Sleep(Settings.Speed);
                    KeyTools.KeyEvent(WinApiMouse.KeyEventFlags.KeyLeftVirtual, WinApiMouse.KeyEventFlags.KeyEventKeyUp);
                    Thread.Sleep(Settings.Speed);

                    if (_ingameState.ServerData.StashPanel.GetStashInventoryByIndex(needTab - 1).AsObject <Element>().IsVisible)
                    {
                        return;
                    }
                }while (_run);
            }
        }
Exemple #9
0
        private void BackToTab(int currentTab, int needTab)
        {
            if (needTab < 0)
            {
                return;
            }
            if (needTab > currentTab)
            {
                do
                {
                    KeyTools.KeyEvent(WinApiMouse.KeyEventFlags.KeyRightVirtual, WinApiMouse.KeyEventFlags.KeyEventKeyDown);
                    Thread.Sleep(Settings.Speed);
                    KeyTools.KeyEvent(WinApiMouse.KeyEventFlags.KeyRightVirtual, WinApiMouse.KeyEventFlags.KeyEventKeyUp);
                    Thread.Sleep(Settings.Speed);
                    if (GameController.Game.IngameState.IngameUi.StashElement.IndexVisibleStash < needTab)
                    {
                        return;
                    }
                }while (_run);
            }
            else if (needTab < currentTab)
            {
                do
                {
                    KeyTools.KeyEvent(WinApiMouse.KeyEventFlags.KeyLeftVirtual, WinApiMouse.KeyEventFlags.KeyEventKeyDown);
                    Thread.Sleep(Settings.Speed);
                    KeyTools.KeyEvent(WinApiMouse.KeyEventFlags.KeyLeftVirtual, WinApiMouse.KeyEventFlags.KeyEventKeyUp);
                    Thread.Sleep(Settings.Speed);

                    if (GameController.Game.IngameState.IngameUi.StashElement.IndexVisibleStash < needTab)
                    {
                        return;
                    }
                }while (_run);
            }
        }