// Token: 0x06001D70 RID: 7536 RVA: 0x0005EC58 File Offset: 0x0005CE58
        public static bool smethod_8(Class142 toontownWindow, ManualResetEventSlim waitHandle, Class104 settings, PointF target, bool jump)
        {
            Class269.Class280 @class = new Class269.Class280();
            @class.bool_0 = false;
            IntPtr mainWindowHandle = toontownWindow.ToonTownProcess.MainWindowHandle;

            if (!toontownWindow.ToonTownProcess.ProcessOpen)
            {
                return(false);
            }
            EventHandler eventHandler = null;
            EventHandler <EventArgs22> eventHandler2 = null;

            Class269.Class281 class2 = new Class269.Class281();
            class2.class280_0             = @class;
            class2.manualResetEventSlim_0 = new ManualResetEventSlim(false);
            bool result;

            try
            {
                try
                {
                    Class141 toonTownProcess = toontownWindow.ToonTownProcess;
                    if (eventHandler == null)
                    {
                        eventHandler = new EventHandler(class2.method_0);
                    }
                    toonTownProcess.ProcessExited += eventHandler;
                    Class129 logMonitor = toontownWindow.LogMonitor;
                    if (eventHandler2 == null)
                    {
                        eventHandler2 = new EventHandler <EventArgs22>(class2.method_1);
                    }
                    logMonitor.CoordinatesChanged += eventHandler2;
                    while (!class2.manualResetEventSlim_0.IsSet && !waitHandle.IsSet)
                    {
                        if (jump)
                        {
                            Class269.smethod_18(mainWindowHandle, new WaitHandle[]
                            {
                                waitHandle.WaitHandle,
                                class2.manualResetEventSlim_0.WaitHandle
                            });
                        }
                        if (!Class269.smethod_5(toontownWindow, waitHandle, class2.manualResetEventSlim_0, settings, target, jump, true))
                        {
                            class2.manualResetEventSlim_0.Wait(100);
                        }
                    }
                    result = (class2.manualResetEventSlim_0.IsSet && !waitHandle.IsSet);
                }
                finally
                {
                    @class.bool_0 = true;
                }
            }
            finally
            {
                if (class2.manualResetEventSlim_0 != null)
                {
                    ((IDisposable)class2.manualResetEventSlim_0).Dispose();
                }
            }
            return(result);
        }
        // Token: 0x06001D6D RID: 7533 RVA: 0x0005E7C8 File Offset: 0x0005C9C8
        public static bool smethod_5(Class142 toontownWindow, ManualResetEventSlim waitHandle, ManualResetEventSlim navigateWaitHandle, Class104 settings, PointF target, bool jump, bool finalTarget)
        {
            Class269.Class278 @class           = new Class269.Class278();
            IntPtr            mainWindowHandle = toontownWindow.ToonTownProcess.MainWindowHandle;

            if (!toontownWindow.ToonTownProcess.ProcessOpen)
            {
                return(false);
            }
            Class269.Enum58 @enum = Class269.Enum58.flag_0;
            @class.struct56_0 = Struct56.struct56_0;
            Struct56 a   = Struct56.struct56_0;
            DateTime t   = DateTime.Now.AddMilliseconds(2000.0);
            float    num = finalTarget ? settings.TargetRange : settings.IntermediateTargetRange;

            @class.bool_0 = false;
            EventHandler <EventArgs22> eventHandler = null;

            Class269.Class279 class2 = new Class269.Class279();
            class2.class278_0             = @class;
            class2.manualResetEventSlim_0 = new ManualResetEventSlim(false);
            try
            {
                try
                {
                    Class129 logMonitor = toontownWindow.LogMonitor;
                    if (eventHandler == null)
                    {
                        eventHandler = new EventHandler <EventArgs22>(class2.method_0);
                    }
                    logMonitor.CoordinatesChanged += eventHandler;
                    WaitHandle[] waitHandles = new WaitHandle[]
                    {
                        waitHandle.WaitHandle,
                        class2.manualResetEventSlim_0.WaitHandle,
                        navigateWaitHandle.WaitHandle
                    };
                    WaitHandle.WaitAny(waitHandles);
                    WaitHandle[] waitHandles2 = new WaitHandle[]
                    {
                        waitHandle.WaitHandle,
                        navigateWaitHandle.WaitHandle
                    };
                    DateTime t2 = DateTime.Now.AddMilliseconds(2000.0);
                    try
                    {
                        while (!waitHandle.IsSet && !navigateWaitHandle.IsSet)
                        {
                            Struct56 struct56_ = @class.struct56_0;
                            PointF   location  = struct56_.Location;
                            if (Class477.smethod_0(target, num, location))
                            {
                                return(true);
                            }
                            float num2 = struct56_.method_0(target);
                            float num3 = Math.Abs(num2 - struct56_.float_3);
                            float num4 = Class477.smethod_9(target, struct56_.Location);
                            if (t < DateTime.Now)
                            {
                                if (Struct56.smethod_0(a, struct56_))
                                {
                                    Class269.smethod_16(mainWindowHandle, ref @enum);
                                    Class269.smethod_15(mainWindowHandle, ref @enum);
                                    Class269.smethod_14(mainWindowHandle, ref @enum);
                                    Class269.smethod_19(mainWindowHandle);
                                }
                                t = DateTime.Now.AddMilliseconds(2000.0);
                            }
                            bool flag2;
                            if ((num4 > 20f && num3 > 20f) || (num4 <= 20f && Class237.smethod_0(target, num, location, struct56_.float_3) == null))
                            {
                                Class269.smethod_16(mainWindowHandle, ref @enum);
                                bool flag = num3 > 180f;
                                if (num2 < struct56_.float_3)
                                {
                                    if (flag)
                                    {
                                        flag2 = Class269.smethod_9(mainWindowHandle, ref @enum, waitHandles2, num3);
                                    }
                                    else
                                    {
                                        flag2 = Class269.smethod_10(mainWindowHandle, ref @enum, waitHandles2, num3);
                                    }
                                }
                                else if (flag)
                                {
                                    flag2 = Class269.smethod_10(mainWindowHandle, ref @enum, waitHandles2, num3);
                                }
                                else
                                {
                                    flag2 = Class269.smethod_9(mainWindowHandle, ref @enum, waitHandles2, num3);
                                }
                            }
                            else
                            {
                                Class269.smethod_15(mainWindowHandle, ref @enum);
                                Class269.smethod_14(mainWindowHandle, ref @enum);
                                if (jump && t2 < DateTime.Now)
                                {
                                    Class269.smethod_18(mainWindowHandle, waitHandles2);
                                    t2 = DateTime.Now.AddMilliseconds(2000.0);
                                }
                                flag2 = Class269.smethod_11(mainWindowHandle, ref @enum, waitHandles2, num4 - settings.TargetRange);
                            }
                            if (!flag2)
                            {
                                class2.manualResetEventSlim_0.Reset();
                                WaitHandle.WaitAny(waitHandles);
                            }
                            if (Class477.smethod_0(target, num, @class.struct56_0.Location))
                            {
                                return(true);
                            }
                            WaitHandle.WaitAny(waitHandles2, 25);
                            a = struct56_;
                        }
                    }
                    finally
                    {
                        Class269.smethod_16(mainWindowHandle, ref @enum);
                        Class269.smethod_15(mainWindowHandle, ref @enum);
                        Class269.smethod_14(mainWindowHandle, ref @enum);
                        Class269.smethod_19(mainWindowHandle);
                    }
                }
                finally
                {
                    @class.bool_0 = true;
                }
            }
            finally
            {
                if (class2.manualResetEventSlim_0 != null)
                {
                    ((IDisposable)class2.manualResetEventSlim_0).Dispose();
                }
            }
            return(false);
        }