コード例 #1
0
        public void Execute()
        {
            if (Finished || Bot.Player.IsCasting)
            {
                return;
            }

            IWowGameobject = Bot.Objects.WowObjects
                             .OfType <IWowGameobject>()
                             .Where(e => ObjectDisplayIds.Contains(e.DisplayId))
                             .OrderBy(e => e.Position.GetDistance(Bot.Player.Position))
                             .FirstOrDefault();

            if (IWowGameobject != null)
            {
                if (IWowGameobject.Position.GetDistance(Bot.Player.Position) < 3.0)
                {
                    if (UseEvent.Run())
                    {
                        Bot.Wow.StopClickToMove();
                        Bot.Movement.Reset();

                        Bot.Wow.InteractWithObject(IWowGameobject.BaseAddress);
                    }
                }
                else
                {
                    Bot.Movement.SetMovementAction(MovementAction.Move, IWowGameobject.Position);
                }
            }
        }
コード例 #2
0
        public void Execute()
        {
            if (Finished || WowInterface.ObjectManager.Player.IsCasting)
            {
                return;
            }

            WowGameobject = WowInterface.ObjectManager.WowObjects
                            .OfType <WowGameobject>()
                            .Where(e => ObjectDisplayIds.Contains(e.DisplayId))
                            .OrderBy(e => e.Position.GetDistance(WowInterface.ObjectManager.Player.Position))
                            .FirstOrDefault();

            if (WowGameobject != null)
            {
                if (WowGameobject.Position.GetDistance(WowInterface.ObjectManager.Player.Position) < 3.0)
                {
                    if (UseEvent.Run())
                    {
                        WowInterface.HookManager.WowStopClickToMove();
                        WowInterface.MovementEngine.Reset();

                        WowInterface.HookManager.WowObjectRightClick(WowGameobject);
                    }
                }
                else
                {
                    WowInterface.MovementEngine.SetMovementAction(MovementAction.Moving, WowGameobject.Position);
                }
            }
        }