示例#1
0
        private static void Main(string[] args)
        {
            FFXIVLIB instance = new FFXIVLIB();

            while (true)
            {
                Entity currentTarget   = instance.GetCurrentTarget();
                Entity mouseoverTarget = instance.GetMouseoverTarget();
                Entity myself          = instance.GetEntityInfo(0);
                if (currentTarget != null)
                {
                    //Distance as represented in game
                    Console.WriteLine("Current target => {0} : {1}/{2} HP distance: {3} yalms",
                                      currentTarget.Name, currentTarget.CurrentHP,
                                      currentTarget.MaxHP, currentTarget.Distance);
                }
                if (mouseoverTarget != null)
                {
                    //Distance calculated
                    Console.WriteLine("Mouseover target => {0} : {1}/{2} HP distance: {3} float",
                                      mouseoverTarget.Name, mouseoverTarget.CurrentHP,
                                      mouseoverTarget.MaxHP, mouseoverTarget.GetDistanceTo(myself));
                }
                Thread.Sleep(1000);
            }
// ReSharper disable once FunctionNeverReturns
        }
示例#2
0
        /// <summary>
        /// Place all your resources in DumpInventory/bin/debug/myresourcefolder before running.
        /// Change folder or language if you wish to.
        /// Those changes HAVE TO BE DONE BEFORE INSTANTIATING FFXIVLIB
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            // Default folder is Resources, you may override it here
            Constants.ResourceParser.RESOURCES_FOLDER = "myresourcefolder";
            // ja, fr, de or en. Defaults to en if not set
            Constants.ResourceParser.RESOURCES_LANGUAGE = "en";
            FFXIVLIB instance = new FFXIVLIB();
            // Just timing how long it takes
            Stopwatch objSw = new Stopwatch();

            objSw.Start();
            foreach (Item item in instance.GetSelfInventory())
            {
                Console.WriteLine("{0} x{1}", ResourceParser.GetItemName(item), item.Amount);
            }
            objSw.Stop();
            // You can check the stopwatch here and note the time.
            Console.ReadLine();
            objSw.Reset();
            objSw.Start();
            // In cache values
            foreach (Item item in instance.GetSelfInventory())
            {
                Console.WriteLine("{0} x{1}", ResourceParser.GetItemName(item), item.Amount);
            }
            objSw.Stop();
            // You can check the stopwatch value here and compare. Profit
            Console.ReadLine();
        }
示例#3
0
        /// <summary>
        /// Quick program to test my navigation stuff
        /// http://www.ffevo.net/wiki/index.php/FFACETools
        /// Credits goes to cpirie
        /// </summary>
        /// <param name="args"></param>
        private static void Main(string[] args)
        {
            FFXIVLIB instance = new FFXIVLIB();
            Entity   player   = instance.GetEntityInfo(0);

            while (true)
            {
                string sResult = "Heading: ";
                double degrees = player.Structure.Heading * (180 / Math.PI) + 180;
                if (degrees > 360)
                {
                    degrees -= 360;
                }
                else if (degrees < 0)
                {
                    degrees += 360;
                }
                sResult += Math.Floor(degrees) + "° ";

                if (337 < degrees || 23 >= degrees)
                {
                    sResult += "(N)";
                }
                else if (23 < degrees && 68 >= degrees)
                {
                    sResult += "(NW)";
                }
                else if (68 < degrees && 113 >= degrees)
                {
                    sResult += "(W)";
                }
                else if (113 < degrees && 158 >= degrees)
                {
                    sResult += "(SW)";
                }
                else if (158 < degrees && 203 >= degrees)
                {
                    sResult += "(S)";
                }
                else if (203 < degrees && 248 >= degrees)
                {
                    sResult += "(SE)";
                }
                else if (248 < degrees && 293 >= degrees)
                {
                    sResult += "(E)";
                }
                else if (293 < degrees && 337 >= degrees)
                {
                    sResult += "(NE)";
                }
                Console.WriteLine("Heading: {0} Deg: {1}, X: {2}, Y: {3}", player.Structure.Heading.ToString(),
                                  sResult, player.Structure.X.ToString(), player.Structure.Y.ToString());
                player.Refresh();
                Thread.Sleep(1000);
            }
// ReSharper disable once FunctionNeverReturns
        }
示例#4
0
        /// <summary>
        /// Changes current target to yourself.
        /// </summary>
        /// <param name="args"></param>
        private static void Main(string[] args)
        {
            FFXIVLIB instance = new FFXIVLIB();
            // Retrieve our own character
            Entity e = instance.GetEntityInfo(0);
            Target t = instance.GetTargets();

            t.Modify("CurrentTarget", (int)e.Address);
        }
示例#5
0
        /*       static void DumpSqlite(string filename)
         *     {
         *         Serializer s = new Serializer();
         *         try
         *         {
         *             var db = new SQLiteDatabase(filename);
         *             List <String> tableList = db.GetTables();
         *             List<SerializableDictionary<string, string>> dictList = new List<SerializableDictionary<string, string>>();
         *             foreach (string table in tableList)
         *                 {
         *                     String query = string.Format("select * from {0};", table);
         *                     DataTable recipe = db.GetDataTable(query);
         *                     foreach (DataRow r in recipe.Rows)
         *                         {
         *                             SerializableDictionary<string, string> item = new SerializableDictionary<string, string>();
         *                             foreach (DataColumn c in recipe.Columns)
         *                                 {
         *                                     item[c.ToString()] = r[c.ToString()].ToString();
         *                                 }
         *                             dictList.Add(item);
         *                         }
         *                     s.Serialize(string.Format("{0}.xml", table), dictList, table);
         *                     dictList.Clear();
         *                 }
         *
         *         }
         *         catch (Exception fail)
         *         {
         *             String error = "The following error has occurred:\n\n";
         *             error += fail.Message + "\n\n";
         *         }
         *
         *
         *     }*/
        static void Main(string[] args)
        {
            Serializer s        = new Serializer();
            FFXIVLIB   instance = new FFXIVLIB();

            //dumpBuffs(instance, s);
            //DumpSqlite("app_data.sqlite");
            DumpAutoTranslate(instance, s);
        }
示例#6
0
        /// <summary>
        /// Instantiates a movementhelper, start recording
        /// positions for 30 seconds to a file named my_waypoint.
        /// Copy that file over to the program called PlayWaypoint
        /// </summary>
        /// <param name="args"></param>
        private static void Main(string[] args)
        {
            FFXIVLIB       instance = new FFXIVLIB();
            MovementHelper mh       = instance.GetMovementHelper();

            mh.StartRecordingCoordinates("my_waypoint");
            Thread.Sleep(30000);
            mh.StopRecordingWaypoint();
        }
示例#7
0
        private static void Main(string[] args)
        {
            FFXIVLIB instance = new FFXIVLIB();

            foreach (int quest in instance.GetQuests())
            {
                Console.WriteLine(ResourceParser.GetQuestName(quest));
            }
            Console.ReadLine();
        }
示例#8
0
        private static void Main(string[] args)
        {
            FFXIVLIB instance = new FFXIVLIB();
            // 0 is always your own character
            Entity e = instance.GetEntityInfo(0);

            Console.WriteLine("Changing icon to Yoshi-P for player {0}", e.Structure.Name);
            e.Modify("Icon", (byte)ICON.Yoshida);
            Console.WriteLine("Done..");
            Console.ReadLine();
        }
示例#9
0
        static void Main(string[] args)
        {
            FFXIVLIB instance = new FFXIVLIB();
            var      nodeList = instance.GetEntityByType(TYPE.Gathering);

            foreach (Entity e in nodeList)
            {
                Console.WriteLine("{0} {1}", e.Name, e.Structure.GatheringStatus);
            }
            Console.ReadLine();
        }
示例#10
0
        /// <summary>
        /// Please run the RecordWaypoint program first
        /// and copy the file generated over to this demo.
        /// We instantiate a MovementHelper instance and pass the filename to be played.
        /// </summary>
        /// <param name="args"></param>
        private static void Main(string[] args)
        {
            FFXIVLIB       instance = new FFXIVLIB();
            MovementHelper mh       = instance.GetMovementHelper();

            mh.PlayWaypoint("my_waypoint");
            // Run for 5 seconds, then pause the running for 10 seconds
            Thread.Sleep(5000);
            mh.PauseWaypoint();
            Thread.Sleep(10000);
            mh.PauseWaypoint();
        }
示例#11
0
        static void Main(string[] args)
        {
            FFXIVLIB instance = new FFXIVLIB();
// ReSharper disable once NotAccessedVariable
            List <Item> ic = instance.GetSelfInventory();

// ReSharper disable RedundantAssignment
            ic = instance.GetArmoryChest();
            ic = instance.GetCompanyInventory();
            ic = instance.GetRetainerInventory();
            ic = instance.GetCurrentEquipment();
            // ReSharper restore RedundantAssignment
        }
示例#12
0
        static void Main(string[] args)
        {
            FFXIVLIB instance = new FFXIVLIB();

            while (true)
            {
                Console.WriteLine(instance.GetServerName());
                Player p = instance.GetPlayerInfo();
                Console.WriteLine("{0} - {1}",
                                  ResourceParser.GetZoneName(p.Zone),
                                  ResourceParser.GetZoneName(p.Subzone));
                Thread.Sleep(1000);
            }
        }
示例#13
0
        static void Main(string[] args)
        {
            FFXIVLIB instance = new FFXIVLIB();

            while (true)
            {
                var nodeList = instance.GetEntityByType(TYPE.Player);
                foreach (Entity e in nodeList)
                {
                    Console.WriteLine("{0} {1}{2}", e.Name, ResourceParser.GetJobShortname(e.Job), e.Level);
                }
                Thread.Sleep(2000);
                Console.Clear();
            }
        }
示例#14
0
        static void Main(string[] args)
        {
            FFXIVLIB instance = new FFXIVLIB();
            Movement m        = instance.GetMovement();

            m.MoveForward();
            Thread.Sleep(3000);
            m.StopMoving();
            m.HeadRight();
            Thread.Sleep(1500);
            m.StopMoving();
            m.MoveForward();
            Thread.Sleep(3000);
            m.StopMoving();
        }
示例#15
0
        static void Main(string[] args)
        {
            FFXIVLIB instance   = new FFXIVLIB();
            int      iterations = 100;

            while (true)
            {
                Stopwatch sw = Stopwatch.StartNew();
                for (int i = 0; i < iterations; i++)
                {
                    instance.GetEntityByType(TYPE.Player);
                }
                sw.Stop();
                Console.WriteLine((sw.ElapsedMilliseconds / iterations).ToString());
            }
        }
示例#16
0
        static void Main(string[] args)
        {
            FFXIVLIB instance = new FFXIVLIB();

            foreach (var i in instance.GetActions())
            {
                Console.WriteLine("ID: {0} IsReady: {1} Cost: {2} PercentUntilReady: {3} Unk1: {4} Unk2: {5} Unk3: {6} Unk4: {7}",
                                  i.Id,
                                  i.IsReady,
                                  i.Cost,
                                  i.PercentUntilReady,
                                  i.Unk_1,
                                  i.Unk_2,
                                  i.Unk_3,
                                  i.Unk_4);
                Console.ReadLine();
            }
        }
示例#17
0
        static void DumpBuffs(FFXIVLIB instance, Serializer s)
        {
            List <Buff> buffsList = new List <Buff>();
            // This has to be modified by hand atm,
            // just change your buff a few times, look for where the description is then find out what references this part of memory. (First byte of name)
            IntPtr pointerToBuff = (IntPtr)0x12F6BEC8;
            IntPtr finalPTR      = (IntPtr)BitConverter.ToInt32(instance.ReadMemory(pointerToBuff, 4), 0);

            for (short i = 0; i < 370; i++)
            {
                Entity player = instance.GetEntityById(0);
                player.Modify("Buffs", i);
                // Give time to client to update widget
                Thread.Sleep(50);
                byte[] buff = instance.ReadMemory(finalPTR, 400);
                buffsList.Add(new Buff(i, buff));
            }
            s.Serialize("Buff.xml", buffsList, "Buff");
        }
示例#18
0
        private static void Main(string[] args)
        {
            FFXIVLIB instance = new FFXIVLIB();

            while (true)
            {
                Entity myself = instance.GetEntityById(0);
                if (myself.IsCasting)
                {
                    Console.WriteLine("{0} is casting {1} {2}%",
                                      myself.Name,
                                      ResourceParser.GetActionName(myself.CastingSpellId),
                                      myself.CastingPercentage);
                }
                else
                {
                    Console.WriteLine("{0} is not casting", myself.Name);
                }
                Thread.Sleep(300);
            }
        }
示例#19
0
        private static void Main(string[] args)
        {
            FFXIVLIB instance = new FFXIVLIB();
            Chatlog  c        = instance.GetChatlog();

            while (true)
            {
                if (c.IsNewLine())
                {
                    List <Chatlog.Entry> test = c.GetChatLogLines();
                    if (test.Count > 0)
                    {
                        Console.WriteLine("{0} new log lines", test.Count);
                    }
                    foreach (Chatlog.Entry line in test)
                    {
                        Console.WriteLine("{0}[{1}] -> {2}", line.Timestamp, line.Code, line.Text);
                    }
                }
                Thread.Sleep(300);
            }
// ReSharper disable once FunctionNeverReturns
        }
示例#20
0
        /// <summary>
        /// Master array -> Instance
        /// </summary>
        /// <param name="instance"></param>
        /// <param name="s"></param>
        static void DumpAutoTranslate(FFXIVLIB instance, Serializer s)
        {
            List <Autotranslate> atlist = new List <Autotranslate>();
            IntPtr pointerInMasterArray = (IntPtr)0x4494280;
            IntPtr finalPTR             = (IntPtr)BitConverter.ToInt32(instance.ReadMemory(pointerInMasterArray, 4), 0);
            int    categoryiter         = 0;

            while (finalPTR != IntPtr.Zero)
            {
                IntPtr objectPtr      = (IntPtr)BitConverter.ToInt32(instance.ReadMemory(finalPTR + 4, 4), 0);
                IntPtr addressOfArray = (IntPtr)BitConverter.ToInt32(instance.ReadMemory(objectPtr, 4), 0);
                int    itemId         = 0;
                while (addressOfArray != IntPtr.Zero)
                {
                    byte[]      memrep      = instance.ReadMemory(addressOfArray, 128);
                    byte[]      category    = instance.ReadMemory(addressOfArray - 5, 1);
                    List <byte> workingCopy = memrep.ToList();
                    int         name        = workingCopy.FindIndex(0, item => item == 0x00);
                    if (name != -1)
                    {
                        workingCopy.RemoveRange(name + 1, workingCopy.Count - name - 1);
                    }
                    string rep = System.Text.Encoding.UTF8.GetString(workingCopy.ToArray());
                    rep = rep.Replace("\0", string.Empty);
                    atlist.Add(new Autotranslate(categories[categoryiter].Id, categories[categoryiter].First + itemId, rep));
                    itemId        += 1;
                    addressOfArray = (IntPtr)BitConverter.ToInt32(instance.ReadMemory(objectPtr + (itemId * 4), 4), 0);
                }

                // Move in master array
                pointerInMasterArray += 0x4;
                finalPTR              = (IntPtr)BitConverter.ToInt32(instance.ReadMemory(pointerInMasterArray, 4), 0);
                categoryiter         += 1;
            }
            s.Serialize("Autotranslate.xml", atlist, "Autotranslate");
        }