Example #1
0
        private void MyPather()
        {
            GSpellTimer taskTimer         = new GSpellTimer(300);
            GSpellTimer updateStatusTimer = new GSpellTimer(2000);
            GSpellTimer nothingToDoTimer  = new GSpellTimer(3 * 1000);
            bool        exit = false;
            GSpellTimer Tick = new GSpellTimer(100);

            do
            {
                if (RunState != WantedState)
                {
                    RunState = WantedState;
                }

                if (updateStatusTimer.IsReady)
                {
                    UpdateXP();
                    updateStatusTimer.Reset();
                }
                if (RunState == RunState_e.Stopped)
                {
                    //Context.Log("Stop wanted. Stopping glide");
                    //Context.KillAction("PPather wants to stop", false);
                    Thread.Sleep(500); // pause
                }
                else if (RunState == RunState_e.Paused)
                {
                    UpdateMyPos();
                    Thread.Sleep(100); // pause
                }
                else if (RunState == RunState_e.Running)
                {
                    UpdateMyPos();
                    if (Me.IsDead)
                    {
                        Thread.Sleep(1000);
                        GhostRun();
                        Thread.Sleep(1500);
                        if (Me.IsDead)
                        {
                            //!!!
                        }
                        else
                        {
                            //Rest();
                        }
                    }

                    Tick.Wait();
                    Thread.Sleep(10); // min sleep time
                    Tick.Reset();
                }
            } while (!exit);
        }
Example #2
0
        public void OnStopGlide()
        {
            BoogieCore.Log(LogType.System, "Inside OnStopGlider()");


            WantedState = RunState_e.Stopped;
            RunState    = RunState_e.Stopped;

            SaveAllState();


            if (world != null)
            {
                world.Close();
            }



            BoogieCore.Log(LogType.System, "TotalMemory " + System.GC.GetTotalMemory(false) / (1024 * 1024) + " MB");
            world = null; // release RAM

            BoogieCore.Log(LogType.System, "TotalMemory after GC " + System.GC.GetTotalMemory(true) / (1024 * 1024) + " MB");
        }
Example #3
0
        private void Startup()
        {
            RunState    = RunState_e.Paused;
            WantedState = RunState_e.Running;

            BoogieCore.Log(LogType.System, "TotalMemory before " + System.GC.GetTotalMemory(true) / (1024 * 1024) + " MB");

            WasAt = null;

            string zone = FigureOutZone();

            MPQTriangleSupplier mpq = new MPQTriangleSupplier();

            CurrentContinent = mpq.SetZone(zone);

            BoogieCore.Log(LogType.System, "Zone is : " + zone);
            BoogieCore.Log(LogType.System, "Continent is : " + CurrentContinent);


            string myFaction = "Unknown";


            ChunkedTriangleCollection triangleWorld = new ChunkedTriangleCollection(512);

            triangleWorld.SetMaxCached(9);
            triangleWorld.AddSupplier(mpq);

            world = new PathGraph(CurrentContinent, triangleWorld, null);
            mover = new Mover();
            radar = new UnitRadar();
            BoogieCore.Log(LogType.System, "Pather loaded!");

            while (ShouldRun)
            {
                Thread.Sleep(100);
            }
        }
Example #4
0
        private void Startup()
        {
            RunState = RunState_e.Paused;
            WantedState = RunState_e.Running;

            BoogieCore.Log(LogType.System, "TotalMemory before " + System.GC.GetTotalMemory(true) / (1024 * 1024) + " MB");

            WasAt = null;

            string zone = FigureOutZone();

            MPQTriangleSupplier mpq = new MPQTriangleSupplier();
            CurrentContinent = mpq.SetZone(zone);

            BoogieCore.Log(LogType.System, "Zone is : " + zone);
            BoogieCore.Log(LogType.System, "Continent is : " + CurrentContinent);

            string myFaction = "Unknown";

            ChunkedTriangleCollection triangleWorld = new ChunkedTriangleCollection(512);
            triangleWorld.SetMaxCached(9);
            triangleWorld.AddSupplier(mpq);

            world = new PathGraph(CurrentContinent, triangleWorld, null);
            mover = new Mover();
            radar = new UnitRadar();
            BoogieCore.Log(LogType.System, "Pather loaded!");

            while (ShouldRun)
            {
                Thread.Sleep(100);
            }
        }
Example #5
0
        private void MyPather()
        {
            GSpellTimer taskTimer = new GSpellTimer(300);
            GSpellTimer updateStatusTimer = new GSpellTimer(2000);
            GSpellTimer nothingToDoTimer = new GSpellTimer(3 * 1000);
            bool exit = false;
            GSpellTimer Tick = new GSpellTimer(100);
            do
            {
                if (RunState != WantedState)
                {
                    RunState = WantedState;
                }

                if (updateStatusTimer.IsReady)
                {
                    UpdateXP();
                    updateStatusTimer.Reset();
                }
                if (RunState == RunState_e.Stopped)
                {
                    //Context.Log("Stop wanted. Stopping glide");
                    //Context.KillAction("PPather wants to stop", false);
                    Thread.Sleep(500); // pause
                }
                else if (RunState == RunState_e.Paused)
                {
                    UpdateMyPos();
                    Thread.Sleep(100); // pause
                }
                else if (RunState == RunState_e.Running)
                {
                    UpdateMyPos();
                    if (Me.IsDead)
                    {
                        Thread.Sleep(1000);
                        GhostRun();
                        Thread.Sleep(1500);
                        if (Me.IsDead)
                        {
                            //!!!
                        }
                        else
                        {
                            //Rest();
                        }
                    }

                    Tick.Wait();
                    Thread.Sleep(10); // min sleep time
                    Tick.Reset();
                }
            } while (!exit);
        }
Example #6
0
        public void OnStopGlide()
        {
            BoogieCore.Log(LogType.System, "Inside OnStopGlider()");

            WantedState = RunState_e.Stopped;
            RunState = RunState_e.Stopped;

            SaveAllState();

            if (world != null)
                world.Close();

            BoogieCore.Log(LogType.System, "TotalMemory " + System.GC.GetTotalMemory(false) / (1024 * 1024) + " MB");
            world = null; // release RAM

            BoogieCore.Log(LogType.System, "TotalMemory after GC " + System.GC.GetTotalMemory(true) / (1024 * 1024) + " MB");
        }