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);
}