public static bool MountUp() { if (IsMounted()) { return(true); } if (ObjectManager.ShouldDefend) { return(false); } GrindingEngine.Navigator.Stop(); MoveHelper.ReleaseKeys(); Thread.Sleep(1000); KeyHelper.SendKey("GMount"); int tickCount = Environment.TickCount; if (ObjectManager.ShouldDefend) { return(false); } while (!IsMounted()) { if ((Environment.TickCount - tickCount) > 3000) { if (!ObjectManager.ShouldDefend) { MoveHelper.RotateRight(true); while ((Environment.TickCount - tickCount) < 3500) { Thread.Sleep(100); } MoveHelper.StopMove(); MoveHelper.Forwards(true); if (ObjectManager.ShouldDefend) { MoveHelper.StopMove(); return(false); } MoveHelper.Jump(1000); while ((Environment.TickCount - tickCount) < 9000) { Thread.Sleep(100); } MoveHelper.StopMove(); } return(false); } Thread.Sleep(100); } if (Langs.MountCantMount(ObjectManager.MyPlayer.RedMessage)) { ResetRedMessage(); LazyHelpers.StopAll("Cannot mount inside, fix the profile"); } if (!IsMounted()) { Thread.Sleep(2500); if (!IsMounted()) { return(false); } } return(true); }
public static bool MountUp() { if (IsMounted()) { return(true); } FlyingEngine.Navigator.Stop(); MoveHelper.ReleaseKeys(); if (ObjectManager.ShouldDefend) { return(false); } if (ObjectManager.MyPlayer.IsSwimming && !ObjectManager.MyPlayer.InVashjir) { Logging.Write("We got into the water, lets swim up and see if we can mount"); MoveHelper.Jump(5000); Thread.Sleep(1000); } MoveHelper.ReleaseKeys(); Latency.Sleep(ObjectManager.MyPlayer.IsInCombat ? 1000 : 500); KeyHelper.SendKey("FMount"); MountTimer.Reset(); while (!MountTimer.IsReady && !IsMounted()) { if (ObjectManager.ShouldDefend) { return(false); } Thread.Sleep(10); } Latency.Sleep(200); int tickCount = Environment.TickCount; if (ObjectManager.ShouldDefend) { return(false); } if (!IsMounted()) { if (ObjectManager.ShouldDefend || ObjectManager.MyPlayer.IsDead) { return(false); } TryUnstuck(tickCount); } if (Langs.MountCantMount(ObjectManager.MyPlayer.RedMessage)) { LazyHelpers.StopAll("Cannot mount inside"); HelperFunctions.ResetRedMessage(); } if (ObjectManager.ShouldDefend || ObjectManager.MyPlayer.IsDead) { return(false); } if (!IsMounted()) { Latency.Sleep(2500); if (!IsMounted()) { if (ObjectManager.ShouldDefend || ObjectManager.MyPlayer.IsDead) { return(false); } LazyHelpers.StopAll("Could not mount"); return(false); } } return(true); }