MemoryAPI.EliteMMOWrapper.NavigationTools.WiggleCharacter C# (CSharp) Метод

WiggleCharacter() приватный Метод

Wiggles the character left and right to become unstuck when stuck on an object.
Author: dlsmd http://www.elitemmonetwork.com/forums/viewtopic.php?p=4627#p4627
private WiggleCharacter ( int attempts ) : void
attempts int
Результат void
            private void WiggleCharacter(int attempts)
            {
                int count = 0;
                float dir = -45;
                while (IsStuck() && attempts-- > 0)
                {
                    api.Entity.GetLocalPlayer().H = api.Player.H + (float)(Math.PI / 180 * dir);
                    api.ThirdParty.KeyDown(Keys.NUMPAD8);
                    Thread.Sleep(TimeSpan.FromSeconds(2));
                    api.ThirdParty.KeyUp(Keys.NUMPAD8);
                    count++;
                    if (count == 4)
                    {
                        dir = (Math.Abs(dir - -45) < .001 ? 45 : -45);
                        count = 0;
                    }
                }
                api.ThirdParty.KeyUp(Keys.NUMPAD8);
            }