Example #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Character"/> class.
        /// </summary>
        /// <param name="Log">The log.</param>
        /// <param name="tc">The tc.</param>
        /// <param name="chars">The chars.</param>
        /// <param name="api">The API.</param>
        public Character(Log Log, ToonControl tc, Dictionary <string, EliteAPI> chars, EliteAPI api)
        {
            Logger = Log;
            Tc     = tc;
            _CharacterDictionary = chars;
            Api     = api;
            Navi    = new Navigation(this);
            Target  = new Target(this);
            FFxiNAV = new FFXINAV();
            Points  = new List <PointsOfInterest>();
            Tasks   = new Tasks(this);
            CreateFolders();
            string ConfigPath = string.Format("{0}\\Log Configs\\Default_Config.conf", Application.StartupPath);

            try
            {
                if (FFxiNAV.Initialize(ConfigPath))
                {
                    Logger.AddDebugText(tc.rtbDebug, "Initialized");
                }
                if (!FFxiNAV.Initialize(ConfigPath))
                {
                    Logger.AddDebugText(tc.rtbDebug, "Unable to Initialize");
                }
            }
            catch (Exception ex)
            {
                Logger.AddDebugText(tc.rtbDebug, ex.ToString());
            }
        }
Example #2
0
        public void CanCreateNavClass()
        {
            var nav = new FFXINAV();

            var dir = Directory.GetCurrentDirectory();

            Assert.NotNull(nav);
            // Assert.Equal(want, got);
        }
Example #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Character"/> class.
        /// </summary>
        /// <param name="Log">The log.</param>
        /// <param name="tc">The tc.</param>
        /// <param name="chars">The chars.</param>
        /// <param name="api">The API.</param>
        public Character(Log Log, ToonControl tc, Dictionary <string, EliteAPI> chars, EliteAPI api)
        {
            Logger = Log;
            Tc     = tc;
            _CharacterDictionary = chars;
            Api     = api;
            Navi    = new Navigation(this);
            Target  = new Target(this);
            FFxiNAV = new FFXINAV();
            Points  = new List <PointsOfInterest>();
            Tasks   = new Tasks(this);

            CreateFolders();
        }
Example #4
0
        public void Setup()
        {
            try
            {
                Logger      = new Log();
                ffxiprocess = new ffxiProcess(Logger);
                Client      = new WebClient();
                Check();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }


            // Check dependencies Present
            HaveFFXINavDll();
            // New FFXINAV
            var ffxiNav = new FFXINAV();
            // Load Up Map
            var navMeshPath = "navmeshes/231.nav";

            navMeshPath =
                "C:\\Users\\Russell\\RiderProjects\\ffxi\\PathFinder\\PathFinder\\bin\\x86\\Debug\\Dumped NavMeshes\\Bostaunieux_Oubliette.nav";


            if (!File.Exists(navMeshPath))
            {
                Console.WriteLine("Cant find navmesh: " + navMeshPath);
            }
            var character = ffxiprocess._CharacterDictionary["Mistrel"];

            var tc = new ToonControl(Logger, ffxiprocess._CharacterDictionary, character);

            ffxiNav.Load(navMeshPath);
            var worked = ffxiNav.IsNavMeshEnabled();

            tc.Character.FFxiNAV.Load(navMeshPath);
            var enabled = tc.Character.FFxiNAV.IsNavMeshEnabled();
            var i       = 0;

            while (!enabled)
            {
                enabled = tc.Character.FFxiNAV.IsNavMeshEnabled();
                if (!enabled)
                {
                    Console.WriteLine("attempt: " + i + " Couldn't load mesh: " + navMeshPath);
                }
                else
                {
                    Console.WriteLine("Loaded Mesh: " + navMeshPath);
                }

                worked = ffxiNav.IsNavMeshEnabled();

                if (!worked)
                {
                    Console.WriteLine("Couldn't load mesh: " + navMeshPath);
                }
                else
                {
                    Console.WriteLine("Loaded Mesh: " + navMeshPath);
                }

                Thread.Sleep(1000);
                i++;
            }

            Console.WriteLine("Nav mesh must have loaded!");
        }