Esempio n. 1
0
        //
        // set player position
        //
        private void SetPlayerPosition()
        {
            if (!Scanning)
            {
                return;
            }

            player = GameMemory.GetPlayer();
            if (player.Name.Length > 0 && (int)Map.ID > 0)
            {
                SetPlayerIcon(player);

                try
                {
                    double x = Math.Round(MapHelper.ConvertCoordinatesIntoMapPosition((double)Map.SizeFactor, (double)Map.OffsetX, player.X), 2);
                    double y = Math.Round(MapHelper.ConvertCoordinatesIntoMapPosition((double)Map.SizeFactor, (double)Map.OffsetY, player.Y), 2);

                    // set map pos
                    mappos.Text = String.Format("x {0} / y {1}  -  [{2} / {3}]   -   [OX: {4} / OY: {5}]",
                                                x, y, player.X, player.Y, Map.OffsetX, Map.OffsetY
                                                );
                }
                catch { }
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Memory scan timer
        /// </summary>
        private void ScanIntervalAction()
        {
            // if scanning disabled, do nothing
            if (Scanning)
            {
                ActorItem player = GameMemory.GetPlayer();

                // if player has moved map, disable memory timer
                if (TrackingPlayer.HasMovedMap())
                {
                    // clear markers
                    TrackingEnemies.Clear();
                    TrackingNpcs.Clear();

                    // disable tickers
                    SetScanningState(false);
                    MapViewer.SetMapCountdown("Zoning ...");

                    // get the map viewer to request latest map,
                    // once it has done it, it will renable memory timer
                    MapViewer.RequestLatestMap();
                }
                else
                {
                    // scan for enemies
                    TrackingEnemies.Scan();
                    TrackingNpcs.Scan();
                }
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Request the latest map
        /// </summary>
        public void RequestLatestMap()
        {
            // show loading
            uint MapId = GameMemory.GetPlayer().MapID;

            API.GetMapImage(MapId);
        }
Esempio n. 4
0
        /// <summary>
        /// Mark a map as complete
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnMarkComplete_Click(object sender, EventArgs e)
        {
            Logger.Add("Manually submitting XIVAPI data ...");
            TrackingEnemies.SubmitData();
            TrackingNpcs.SubmitData();

            Logger.Add("Marking the map as complete!");
            API.MarkMapComplete(GameMemory.GetPlayer().MapID);
        }
Esempio n. 5
0
        /// <summary>
        /// Read Player
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Readplayer_Click(object sender, EventArgs e)
        {
            player = GameMemory.GetPlayer();

            try
            {
                output.Text = String.Format("Outputting Player:") + Environment.NewLine + Environment.NewLine;
                PrintEntity(player);
            }
            catch (Exception ex)
            {
                Logger.Exception(ex, "Viewer -> readplayer_Click");
            }
        }
Esempio n. 6
0
        /// <summary>
        /// called when app initialized, this is delayed
        /// </summary>
        private void Initialized()
        {
            // set player name
            ActorItem player = GameMemory.GetPlayer();

            labelPlayerName.Text = player.Name;

            // create timer
            System.Timers.Timer aTimer = new System.Timers.Timer();
            aTimer.Elapsed += (sender, e) => {
                ScanIntervalAction();
            };
            aTimer.Interval = Properties.Settings.Default.ScanTimerSpeed;
            aTimer.Enabled  = true;
        }
Esempio n. 7
0
        /// <summary>
        /// Scan current target
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Readtarget_Click(object sender, EventArgs e)
        {
            player = GameMemory.GetPlayer();
            ActorItem entity = GameMemory.GetCurrentTarget();

            try
            {
                output.Text = String.Format("Outputting Target:") + Environment.NewLine + Environment.NewLine;
                PrintEntity(entity);
            }
            catch (Exception ex)
            {
                Logger.Exception(ex, "Viewer -> readtarget_Click");
            }
        }
Esempio n. 8
0
        /// <summary>
        /// Scan for enemies
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Button1_Click(object sender, EventArgs e)
        {
            player = GameMemory.GetPlayer();

            // GameMemory.getNpcsAroundPlayer();
            List <ActorItem> entities = App.Instance.TrackingEnemies.GetEntities();

            // reset output
            output.Text = String.Format("Found: {0}", entities.Count) + Environment.NewLine + Environment.NewLine;

            // spit out all entities
            foreach (ActorItem entity in entities)
            {
                PrintEntity(entity);
            }
        }
Esempio n. 9
0
        //
        // Checks if the player has changed map,
        // if it returns true, it means the player has moved
        // maps, otherwise false the map has not changed
        //
        public bool HasMovedMap()
        {
            ActorItem Player = GameMemory.GetPlayer();

            // Check for map id
            if (Player.MapID > 0 && Player.MapID != MapId)
            {
                // set map
                MapId = Player.MapID;
                Logger.Add($"> MAP ID: {Player.MapID}");

                // Tell app to change map
                return(true);
            }

            return(false);
        }
Esempio n. 10
0
        /// <summary>
        /// Init timer, basically a "delay"
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void InitializeTimer_Tick(object sender, EventArgs e)
        {
            ActorItem player = GameMemory.GetPlayer();

            Logger.Add(" ");
            Logger.Add($"~ Hello {player.Name}!");
            Logger.Add(" ");

            if (player.MapID == 0)
            {
                Logger.Add("Oh no, the MapID is 0, either the offsets are broke, you're not logged in, or idk... Ask Vekien.");
                Logger.Add("No mapping today");
                SetStatus("/sadface");
            }

            // disable initialize timer, and add memory timer
            InitializeTimer.Enabled = false;
            Initialized();
        }
Esempio n. 11
0
        /// <summary>
        /// Get a list of entities
        /// </summary>
        /// <returns></returns>
        public List <ActorItem> GetEntities()
        {
            Player = GameMemory.GetPlayer();

            List <ActorItem> entities = GameMemory.GetMonstersAroundPlayer();

            // remove junk
            for (var i = 0; i < entities.Count; i++)
            {
                ActorItem entity = entities[i];

                // check if we're ignoring this entity
                if (IsIgnored("BNPC", entity))
                {
                    entities.RemoveAt(i);
                    continue;
                }
            }

            return(entities);
        }
Esempio n. 12
0
        /// <summary>
        /// Scan for entities
        /// </summary>
        public void Scan()
        {
            Player = GameMemory.GetPlayer();

            // get npcs
            List <ActorItem> entities = GameMemory.GetNpcsAroundPlayer();

            if (entities.Count == 0)
            {
                return;
            }

            // loop through npcs
            foreach (var entity in entities)
            {
                // check if we're ignoring this entity
                if (IsIgnored("ENPC", entity))
                {
                    continue;
                }

                // check we havent already tracked it
                if (list.IndexOf(entity.NPCID2) == -1)
                {
                    total++;

                    // add to existing list
                    list.Add(entity.NPCID2);
                    LogEntity("ENPC", entity);

                    // add to map
                    App.Instance.MapViewer.AddNpcIcon(entity);
                    App.Instance.labelTotalNpcs.Text = total.ToString();

                    // save npc to file
                    Saver.SaveNpc(entity);
                }
            }
        }
Esempio n. 13
0
        /// <summary>
        /// Scan for enemies
        /// </summary>
        public void Scan()
        {
            Player = GameMemory.GetPlayer();

            List <ActorItem> entities = GameMemory.GetMonstersAroundPlayer();

            if (entities.Count == 0)
            {
                return;
            }

            // loop through monsters
            foreach (var entity in entities)
            {
                // check if we're ignoring this entity
                if (IsIgnored("BNPC", entity))
                {
                    continue;
                }

                // check we havent already tracked it
                if (list.IndexOf(entity.ID) == -1)
                {
                    total++;

                    // add to list
                    list.Add(entity.ID);
                    LogEntity("BNPC", entity);

                    // add to map
                    App.Instance.MapViewer.AddEnemyIcon(entity);
                    App.Instance.labelTotalEnemies.Text = total.ToString();

                    // save enemy
                    Saver.SaveEnemy(entity);
                }
            }
        }
Esempio n. 14
0
 /// <summary>
 /// Open the current map on XIVAPI
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void BtnOpenXIVAPI_Click(object sender, EventArgs e)
 {
     API.OpenOnXivApi(GameMemory.GetPlayer().MapID);
 }