What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

WoWMovement.Move Issue ??

swiny

New Member
Joined
Dec 19, 2010
Messages
517
Reaction score
73
[Dev] WoWMovement.Move Issue ??

Hey guys,

currently working on my movement for my CC run into a snag that has got me really stumped.

this is my issue,

Code:
WoWMovement.Move(WoWMovement.MovementDirection.StrafeLeft, TimeSpan.FromMilliseconds(3));

This should in theiry only move for 3MS, yes??? ( 3 for testing this error )
That doesnt seem to be the result that im getting which is quiet frustrating and would really like some answers?

What is happening is basicxly when i run it, its pritty much doing it anywhere from 3ms to like 3 seconds .... ???? Is there reason ????

ill attach a log of whats happening.
 
Last edited:
Can any Dev please explain this?????

my guess its got something to do with ?? as i just added jump now to and its making it walk even longer now...
Flushing timed movement. Direction: StrafeLeft
Flushing timed movement. Direction: StrafeRight


Also don't mind the CC error. haven't got around to it yet ;p
 

Attachments

Last edited:
Can any Dev please explain this?????

my guess its got something to do with ?? as i just added jump now to and its making it walk even longer now...
Flushing timed movement. Direction: StrafeLeft
Flushing timed movement. Direction: StrafeRight


Also don't mind the CC error. haven't got around to it yet ;p
just do a strife left without the timer on it. then do a thread.sleep, then wowmovement.stop,
 
hahahahahaha

thread is bad causes lock up dont need that,

i am trying stopwatch aka timers.
but the pulse seems to be way to inconsistent... :(

Code:
[PVPDruid By SwInY] StrafeTimer: MS[66]
[PVPDruid By SwInY] StrafeTimer: MS[2228]
[PVPDruid By SwInY] StrafeTimer: MS[1775]
[PVPDruid By SwInY] StrafeTimer: MS[1154]
[PVPDruid By SwInY] StrafeTimer: MS[1285]
[PVPDruid By SwInY] StrafeTimer: MS[339]
[PVPDruid By SwInY] StrafeTimer: MS[1476]
[PVPDruid By SwInY] StrafeTimer: MS[354]
[PVPDruid By SwInY] StrafeTimer: MS[823]
[PVPDruid By SwInY] StrafeTimer: MS[874]
[PVPDruid By SwInY] StrafeTimer: MS[996]
[PVPDruid By SwInY] StrafeTimer: MS[1075]
[PVPDruid By SwInY] StrafeTimer: MS[941]
[PVPDruid By SwInY] StrafeTimer: MS[252]
[PVPDruid By SwInY] StrafeTimer: MS[360]
[PVPDruid By SwInY] StrafeTimer: MS[762]
[PVPDruid By SwInY] StrafeTimer: MS[265]
[PVPDruid By SwInY] StrafeTimer: MS[1908]
[PVPDruid By SwInY] StrafeTimer: MS[213]
[PVPDruid By SwInY] StrafeTimer: MS[861]
[PVPDruid By SwInY] StrafeTimer: MS[1322]
[PVPDruid By SwInY] StrafeTimer: MS[2962]
[PVPDruid By SwInY] StrafeTimer: MS[1153]
[PVPDruid By SwInY] StrafeTimer: MS[212]
[PVPDruid By SwInY] StrafeTimer: MS[449]
[PVPDruid By SwInY] StrafeTimer: MS[1207]
[PVPDruid By SwInY] StrafeTimer: MS[196]
[PVPDruid By SwInY] StrafeTimer: MS[435]
[PVPDruid By SwInY] StrafeTimer: MS[1172]
[PVPDruid By SwInY] StrafeTimer: MS[1189]
[PVPDruid By SwInY] StrafeTimer: MS[196]
[PVPDruid By SwInY] StrafeTimer: MS[437]
[PVPDruid By SwInY] StrafeTimer: MS[1128]
[PVPDruid By SwInY] StrafeTimer: MS[1184]
[PVPDruid By SwInY] StrafeTimer: MS[159]
[PVPDruid By SwInY] StrafeTimer: MS[388]
[PVPDruid By SwInY] StrafeTimer: MS[617]
[PVPDruid By SwInY] StrafeTimer: MS[1067]
[PVPDruid By SwInY] StrafeTimer: MS[1053]
[PVPDruid By SwInY] StrafeTimer: MS[191]
[PVPDruid By SwInY] StrafeTimer: MS[428]
 
yea, its going to be inconsistant, theres no 1000% way to get it perfect each time, unless you hijack the same pulse, or one thats closer to when you want to stop.

if (isStrifing && StrifeTimer >= 9 sec)
WoWMovement.Stop

if ( i need to strife)
WoWmovement - Strife start.
isStrifing = true;
StrifeTimer.Start();


do something like this is 2 waves, so your not locking the thread, and you should be able to get it near where you want it.
 
i have CNG, exept i need it down to 300MS. not from 60-3000.


Code:
        public static void Pulse(WoWPlayer Player)
        {
            // So we can still cast while we move
            if (CheckStrafeTimer)
            {
                StrafeTimer.Stop();
                StrafeTimer.Reset();
                WoWMovement.MoveStop();
            }

            if (!IfToMove(Player)) return;

            // Add more than strafe later
            DoRandomStrafe();
        }





        /// <summary>
        /// True if over the timer limit
        /// </summary>
        private static bool CheckStrafeTimer
        {
            get
            {
                if (StrafeTimer.ElapsedMilliseconds > 400) return true;
                return false;
            }
        }
 
breakup the stop strife and the start strife into two different voids then make a pulse() in your CC to check for the stop. the other thing could be too if your looking for a lot of player or depending on the flow of your CC, Linq Queries and Foreach loops can take a lot of time. i have a few ideas about how you can do it without a timer, but idk :) i might just have to keep them for myself.
 
i am writing up a pluging to see what the pulse is like atm.

yeah im using alot of functions in my CC, alot of "searching" for players, does 3 types im thinking thats whats slowing it down
other than that i really dont have any loops.

Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Styx;
using Styx.Combat.CombatRoutine;
using Styx.Helpers;
using Styx.Logic;
using Styx.Logic.Combat;
using Styx.Logic.Pathing;
using Styx.WoWInternals;
using Styx.WoWInternals.WoWObjects;
using HBPVPDruid.Misc;

namespace HBPVPDruid
{
    // We want to
    // #1 priority ( Flag Carrier [ CanSee(traceline), In Range] ) if is one
    // #2 Loop threw every player (put dots on em)
    // #3 when all have dots, find lowest hp person, then we rape him?

    public static class GetTargetPlayer
    {
        public static bool SingleTarget = false;

        public static WoWPlayer TargetPlayer()
        {
            // Reset this
            SingleTarget = false;
            WoWPlayer Player = null;

            // If there is a flag carrier return the flag carrier
            if (ObjectManager.Me.Faction.Name == "Horde") Player = EnemyHordeFlagCarrier();
            if (ObjectManager.Me.Faction.Name == "Alliance") Player = EnemyAllianceFlagCarrier();
            if (Player != null) Misc.Misc.DebugLog("[Target] Targeting Flag Carrier");
            if (Player != null) SingleTarget = true;
            if (Player != null) return Player;

            // If enemy needed dot
            Player = PlayerToDot();
            if (Player != null) Misc.Misc.DebugLog("[Target] Targeting Random Player To Dot");
            if (Player != null) return Player;

            // Single Target spam
            Player = EnemyLowestHealth();
            if (Misc.Misc.EnemysAroundMe <= 1) SingleTarget = true;
            if (Player != null) Misc.Misc.DebugLog("[Target] Targeting Single Player");
            return Player;

        }


        #region GetPlayer
        private static WoWPlayer EnemyAllianceFlagCarrier()
        {
            return (from Unit in ObjectManager.GetObjectsOfType<WoWPlayer>(false)
                         where Unit.IsAlive
                         where Unit.Distance < 35
                         where !Unit.IsFriendly
                         where !Unit.IsPet
                         where Misc.Misc.HasSpellID(23333)
                         where Unit.InLineOfSight
                         select Unit).FirstOrDefault();
        }

                private static WoWPlayer EnemyHordeFlagCarrier()
        {
            return (from Unit in ObjectManager.GetObjectsOfType<WoWPlayer>(false)
                         where Unit.IsAlive
                         where Unit.Distance < 40
                         where !Unit.IsFriendly
                         where !Unit.IsPet
                         where Misc.Misc.HasSpellID(23335)
                         where Unit.InLineOfSight
                         select Unit).FirstOrDefault();
        }

        private static WoWPlayer EnemyLowestHealth()
        {
               return (from Unit in ObjectManager.GetObjectsOfType<WoWPlayer>(false)
                        orderby Unit.HealthPercent
                         where Unit.IsAlive
                         where Unit.Distance < 40
                         where !Unit.IsFriendly
                         where !Unit.IsPet
                         where Unit.InLineOfSight
                         select Unit).FirstOrDefault(); ;
        }

        private static WoWPlayer PlayerToDot()
        {
            return (from Unit in ObjectManager.GetObjectsOfType<WoWPlayer>(false)
                         orderby Unit.HealthPercent
                         where Unit.IsAlive
                         where Unit.Distance < 40
                         where !Unit.IsFriendly
                         where !Unit.IsPet
                         where Unit.InLineOfSight
                    where !Unit.HasAura("Insect Swarm") || !Unit.HasAura("Moonfire") || !Unit.HasAura("Sunfire")
                         select Unit).FirstOrDefault();
        }
        #endregion

    }
}


Maybe the way to go is via plugin,
Code:
[4:33:21 PM:937] [PVPDruidMovement By SwInY] Pulse Timer: [402]
[4:33:22 PM:343] [PVPDruidMovement By SwInY] Pulse Timer: [401]
[4:33:22 PM:734] [PVPDruidMovement By SwInY] Pulse Timer: [403]
[4:33:23 PM:203] [PVPDruidMovement By SwInY] Pulse Timer: [461]
[4:33:23 PM:609] [PVPDruidMovement By SwInY] Pulse Timer: [402]
[4:33:24 PM:78] [PVPDruidMovement By SwInY] Pulse Timer: [467]
[4:33:24 PM:531] [PVPDruidMovement By SwInY] Pulse Timer: [463]
[4:33:25 PM:406] [PVPDruidMovement By SwInY] Pulse Timer: [867]
[4:33:25 PM:875] [PVPDruidMovement By SwInY] Pulse Timer: [468]
[4:33:26 PM:453] [PVPDruidMovement By SwInY] Pulse Timer: [583]
[4:33:26 PM:921] [PVPDruidMovement By SwInY] Pulse Timer: [469]
[4:33:27 PM:343] [PVPDruidMovement By SwInY] Pulse Timer: [418]
[4:33:27 PM:718] [PVPDruidMovement By SwInY] Pulse Timer: [383]

going to loose alot of what i want to do tho :(
 
Last edited:
i am writing up a pluging to see what the pulse is like atm.

yeah im using alot of functions in my CC, alot of "searching" for players, does 3 types im thinking thats whats slowing it down
other than that i really dont have any loops.

Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Styx;
using Styx.Combat.CombatRoutine;
using Styx.Helpers;
using Styx.Logic;
using Styx.Logic.Combat;
using Styx.Logic.Pathing;
using Styx.WoWInternals;
using Styx.WoWInternals.WoWObjects;
using HBPVPDruid.Misc;

namespace HBPVPDruid
{
    // We want to
    // #1 priority ( Flag Carrier [ CanSee(traceline), In Range] ) if is one
    // #2 Loop threw every player (put dots on em)
    // #3 when all have dots, find lowest hp person, then we rape him?

    public static class GetTargetPlayer
    {
        public static bool SingleTarget = false;

        public static WoWPlayer TargetPlayer()
        {
            // Reset this
            SingleTarget = false;
            WoWPlayer Player = null;

            // If there is a flag carrier return the flag carrier
            if (ObjectManager.Me.Faction.Name == "Horde") Player = EnemyHordeFlagCarrier();
            if (ObjectManager.Me.Faction.Name == "Alliance") Player = EnemyAllianceFlagCarrier();
            if (Player != null) Misc.Misc.DebugLog("[Target] Targeting Flag Carrier");
            if (Player != null) SingleTarget = true;
            if (Player != null) return Player;

            // If enemy needed dot
            Player = PlayerToDot();
            if (Player != null) Misc.Misc.DebugLog("[Target] Targeting Random Player To Dot");
            if (Player != null) return Player;

            // Single Target spam
            Player = EnemyLowestHealth();
            if (Misc.Misc.EnemysAroundMe <= 1) SingleTarget = true;
            if (Player != null) Misc.Misc.DebugLog("[Target] Targeting Single Player");
            return Player;

        }


        #region GetPlayer
        private static WoWPlayer EnemyAllianceFlagCarrier()
        {
            return (from Unit in ObjectManager.GetObjectsOfType<WoWPlayer>(false)
                         where Unit.IsAlive
                         where Unit.Distance < 35
                         where !Unit.IsFriendly
                         where !Unit.IsPet
                         where Misc.Misc.HasSpellID(23333)
                         where Unit.InLineOfSight
                         select Unit).FirstOrDefault();
        }

                private static WoWPlayer EnemyHordeFlagCarrier()
        {
            return (from Unit in ObjectManager.GetObjectsOfType<WoWPlayer>(false)
                         where Unit.IsAlive
                         where Unit.Distance < 40
                         where !Unit.IsFriendly
                         where !Unit.IsPet
                         where Misc.Misc.HasSpellID(23335)
                         where Unit.InLineOfSight
                         select Unit).FirstOrDefault();
        }

        private static WoWPlayer EnemyLowestHealth()
        {
               return (from Unit in ObjectManager.GetObjectsOfType<WoWPlayer>(false)
                        orderby Unit.HealthPercent
                         where Unit.IsAlive
                         where Unit.Distance < 40
                         where !Unit.IsFriendly
                         where !Unit.IsPet
                         where Unit.InLineOfSight
                         select Unit).FirstOrDefault(); ;
        }

        private static WoWPlayer PlayerToDot()
        {
            return (from Unit in ObjectManager.GetObjectsOfType<WoWPlayer>(false)
                         orderby Unit.HealthPercent
                         where Unit.IsAlive
                         where Unit.Distance < 40
                         where !Unit.IsFriendly
                         where !Unit.IsPet
                         where Unit.InLineOfSight
                    where !Unit.HasAura("Insect Swarm") || !Unit.HasAura("Moonfire") || !Unit.HasAura("Sunfire")
                         select Unit).FirstOrDefault();
        }
        #endregion

    }
}


Maybe the way to go is via plugin,
Code:
[4:33:21 PM:937] [PVPDruidMovement By SwInY] Pulse Timer: [402]
[4:33:22 PM:343] [PVPDruidMovement By SwInY] Pulse Timer: [401]
[4:33:22 PM:734] [PVPDruidMovement By SwInY] Pulse Timer: [403]
[4:33:23 PM:203] [PVPDruidMovement By SwInY] Pulse Timer: [461]
[4:33:23 PM:609] [PVPDruidMovement By SwInY] Pulse Timer: [402]
[4:33:24 PM:78] [PVPDruidMovement By SwInY] Pulse Timer: [467]
[4:33:24 PM:531] [PVPDruidMovement By SwInY] Pulse Timer: [463]
[4:33:25 PM:406] [PVPDruidMovement By SwInY] Pulse Timer: [867]
[4:33:25 PM:875] [PVPDruidMovement By SwInY] Pulse Timer: [468]
[4:33:26 PM:453] [PVPDruidMovement By SwInY] Pulse Timer: [583]
[4:33:26 PM:921] [PVPDruidMovement By SwInY] Pulse Timer: [469]
[4:33:27 PM:343] [PVPDruidMovement By SwInY] Pulse Timer: [418]
[4:33:27 PM:718] [PVPDruidMovement By SwInY] Pulse Timer: [383]

going to loose alot of what i want to do tho :(
you can add the pulse to your CC you dont need a separate plugin
 
if you have a plugin and your CC running at the same time, youll get the same results. the CC is going to slow down the other pulses,
 
that is true. i really have no idea what to do then man. i need my code to run every 300ms which is what hb pulses at default without any CC's running.
mine going from 60-3000 is really to extreme to be trying to acurate of moving left and right and still casting at same time.



have a look at my core foundation,
it doesnt have the movement in that one, as its still in dev.
http://www.thebuddyforum.com/honorb...pdruid]-pure-boomkin-cc-[-sunfire-spam-].html

Code:
        public static void Pulse()
        {
            // So we can still cast while we move
            if (CheckStrafeTimer)
            {
                StrafeTimer.Stop();
                StrafeTimer.Reset();
                WoWMovement.MoveStop();
            }

            // Add more than strafe later
            DoRandomStrafe();

        }


// Do facy movements.
        // coming soon.
        // just coding main core first
        public static void DoRandomStrafe()
        {

            // Get which way to strafe,
            WoWMovement.MovementDirection WayToStrafe;  // Create Var
            WayToStrafe = WoWMovement.MovementDirection.StrafeRight; // Set to default right
            if (JumpLeft == true) WayToStrafe = WoWMovement.MovementDirection.StrafeLeft; // if left set to left

            // Ok now lets strafe, If all good throw in a jump if we want to
            WoWMovement.Move(WayToStrafe);
            DoRandomJump();
            StrafeTimer.Start();

            if (WayToStrafe == WoWMovement.MovementDirection.StrafeLeft) DebugLog("[Movement] Strafing Left");
            if (WayToStrafe == WoWMovement.MovementDirection.StrafeRight) DebugLog("[Movement] Strafing Right");

            // One lined this shit so looks neater for now.
            if (JumpLeft == true) { JumpLeft = false; } else { JumpLeft = true; }
        }

        /// <summary>
        /// True if over the timer limit
        /// </summary>
        private static bool CheckStrafeTimer
        {
            get
            {
                DebugLog("StrafeTimer: MS[{0}]", StrafeTimer.ElapsedMilliseconds);
                if (StrafeTimer.ElapsedMilliseconds > 400) return true;
                return false;
            }
        }

        /// <summary>
        /// will 50/50 Randomly jump
        /// </summary>
        private static void DoRandomJump()
        {
            if (ShouldIRandomJump)
            {
                DebugLog("[Movement]: Randomly Jumping");
                WoWMovement.Move(WoWMovement.MovementDirection.JumpAscend);
                StyxWoW.SleepForLagDuration();
            }
        }

        /// <summary>
        /// Determines if it should jump or not
        /// </summary>
        private static bool ShouldIRandomJump
        {
            get
            {
                // 50/50 change of jumping seems good.
                Random num = new Random();
                int numb = num.Next(0, 3);

                if (numb == 1) return true;
                return false;
            }
        }

plugin results, 2 seconds .... :(
Code:
[PVPDruidMovement By SwInY] [Movement] Strafing Right
[PVPDruidMovement By SwInY] StrafeTimer: MS[1189]
[PVPDruidMovement By SwInY] [Movement]: Randomly Jumping
[PVPDruidMovement By SwInY] [Movement] Strafing Left
[PVPDruidMovement By SwInY] StrafeTimer: MS[2102]
[PVPDruidMovement By SwInY] [Movement] Strafing Right
[PVPDruidMovement By SwInY] StrafeTimer: MS[1454]
[PVPDruidMovement By SwInY] [Movement] Strafing Left
[PVPDruidMovement By SwInY] StrafeTimer: MS[4434]
[PVPDruidMovement By SwInY] [Movement] Strafing Right
[PVPDruidMovement By SwInY] StrafeTimer: MS[388]
[PVPDruidMovement By SwInY] [Movement] Strafing Left
[PVPDruidMovement By SwInY] StrafeTimer: MS[2256]
[PVPDruidMovement By SwInY] [Movement]: Randomly Jumping
[PVPDruidMovement By SwInY] [Movement] Strafing Right


looks like im gunna go back to putting it back in my CC, then see whats lagging me
 
Last edited:
ok now ive pritty much disabled/commented out everything exept whats needed

Searches for a player,
moves.
chooses 1/3 spells to cast.

results
Code:
[PVPDruid By SwInY] StrafeTimer: MS[283]
[PVPDruid By SwInY] StrafeTimer: MS[633]
[PVPDruid By SwInY] StrafeTimer: MS[281]
[PVPDruid By SwInY] StrafeTimer: MS[526]
[PVPDruid By SwInY] StrafeTimer: MS[1121]
[PVPDruid By SwInY] StrafeTimer: MS[248]
[PVPDruid By SwInY] StrafeTimer: MS[535]
[PVPDruid By SwInY] StrafeTimer: MS[1020]
[PVPDruid By SwInY] StrafeTimer: MS[300]
[PVPDruid By SwInY] StrafeTimer: MS[540]
[PVPDruid By SwInY] StrafeTimer: MS[1087]
[PVPDruid By SwInY] StrafeTimer: MS[269]
[PVPDruid By SwInY] StrafeTimer: MS[1028]
[PVPDruid By SwInY] StrafeTimer: MS[1070]
[PVPDruid By SwInY] StrafeTimer: MS[5856]
[PVPDruid By SwInY] StrafeTimer: MS[116]
[PVPDruid By SwInY] StrafeTimer: MS[389]
[PVPDruid By SwInY] StrafeTimer: MS[1316]
[PVPDruid By SwInY] StrafeTimer: MS[231]
[PVPDruid By SwInY] StrafeTimer: MS[382]
 
Code:
        private static WoWPlayer EnemyAllianceFlagCarrier()
        {
            return (from Unit in ObjectManager.GetObjectsOfType(false)
                         where Unit.IsAlive
                         where Unit.Distance < 35
                         where !Unit.IsFriendly
                         where !Unit.IsPet
                         where Misc.Misc.HasSpellID(23333)
                         where Unit.InLineOfSight
                         select Unit).FirstOrDefault();
        }

                private static WoWPlayer EnemyHordeFlagCarrier()
        {
            return (from Unit in ObjectManager.GetObjectsOfType(false)
                         where Unit.IsAlive
                         where Unit.Distance < 40
                         where !Unit.IsFriendly
                         where !Unit.IsPet
                         where Misc.Misc.HasSpellID(23335)
                         where Unit.InLineOfSight
                         select Unit).FirstOrDefault();
        }

        private static WoWPlayer EnemyLowestHealth()
        {
               return (from Unit in ObjectManager.GetObjectsOfType(false)
                        orderby Unit.HealthPercent
                         where Unit.IsAlive
                         where Unit.Distance < 40
                         where !Unit.IsFriendly
                         where !Unit.IsPet
                         where Unit.InLineOfSight
                         select Unit).FirstOrDefault(); ;
        }

        private static WoWPlayer PlayerToDot()
        {
            return (from Unit in ObjectManager.GetObjectsOfType(false)
                         orderby Unit.HealthPercent
                         where Unit.IsAlive
                         where Unit.Distance < 40
                         where !Unit.IsFriendly
                         where !Unit.IsPet
                         where Unit.InLineOfSight
                    where !Unit.HasAura("Insect Swarm") || !Unit.HasAura("Moonfire") || !Unit.HasAura("Sunfire")
                         select Unit).FirstOrDefault();
        }
all of those are all foreach loops your literally spending time building lists over and over just to pull one unit from it, if your around a lot of units this could take much longer then you would expect.

if you cant recode it into something better, at least try and make it so it only rebuilds these lists once every few seconds instead of pulling and going though a new list every time it pulses.
 
read above i posted. i had everything disabled.
 
read above i posted. i had everything disabled.
i dont have your entire source code, i cant tell what you have disabled or not, from what i can see, your aproch is wrong, i think your tackling the problem the wrong way. you know theres a reason why i don't have blind strafing in Amplify (well i do for people that want it, but its not there for me) i think if you really put your mind to it and think about the problem you can come up with a even more cleaver way to solve the problem, then creating new ones for yourself.

oh and make sure you have all your plugins disabled. remember any plugins are also puggy backing on your pulses() as well. a badly coded plugin can kill your performance.
 
alrighty ill go and have a think about it. thanks for that CNG (l)
 
yea, just think about it, and try and be cleaver about solving the issue. that's how you truly innovate, coming up with a creative solution for a problem instead of just busting down the problems door and demanding for it to give you all the money in the safe.
 
the main issue i think im having is i need to know who im about to target, and how many enemys around me, which will cause a loop in object manager
 
Back
Top