public override void Pulse()
 {
     try
     {
         mapCoord = getWorldMapCoord();
         if (mapCoord != oldMapCoord)
         {
             oldMapCoord  = mapCoord;
             GotoLocation = mapToWorldCoords(mapCoord);
             if (GotoLocation == WoWPoint.Empty)
             {
                 Logging.Write("Unable to Genorate path to location. Try a different spot nearby");
                 return;
             }
             Logging.Write("{0}", ToHotSpot(GotoLocation));
             //WriteProfile(GotoLocation);
             //ProfileManager.LoadNew(profilePath);
         }
     }
     catch (ThreadAbortException) { }
     catch (Exception e)
     {
         Log("Exception in Pulse:{0}", e);
     }
 }
        public override bool Equals(object obj)
        {
            if (!(obj is worldMapCoord))
            {
                return(false);
            }
            worldMapCoord wmc = (worldMapCoord)obj;

            return(wmc.X == this.X && wmc.Y == this.Y && wmc.MapID == this.MapID);
        }
        private static worldMapCoord getWorldMapCoord()
        {
            worldMapCoord wmc = new worldMapCoord();
            List <string> ret = Lua.GetReturnValues(string.Format("return {0}()", MySettings.getWorldMapCoordName), "clicky.lua");

            if (ret != null && ret.Count == 3)
            {
                float.TryParse(ret[0], style, culture, out wmc.X);
                float.TryParse(ret[1], style, culture, out wmc.Y);
                uint.TryParse(ret[2], style, culture, out wmc.MapID);
            }
            return(wmc);
        }
        static WoWPoint mapToWorldCoords(worldMapCoord wmc)
        {
            WoWPoint worldPoint = new WoWPoint();

            WoWDb.DbTable worldMapArea       = StyxWoW.Db[ClientDb.WorldMapArea];
            WoWDb.Row     worldMapAreaFields = worldMapArea.GetRow(wmc.MapID);
            float         ay = worldMapAreaFields.GetField <float>(4);
            float         by = worldMapAreaFields.GetField <float>(5);
            float         ax = worldMapAreaFields.GetField <float>(6);
            float         bx = worldMapAreaFields.GetField <float>(7);

            //Logging.Write("You are at {0}, {1} relative", (myLoc.Y - a.Y) / (b.Y - a.Y), (myLoc.X - a.X) / (b.X - a.X));
            worldPoint.X = ax + (wmc.Y * (bx - ax));
            worldPoint.Y = ay + (wmc.X * (by - ay));
            try
            {
                worldPoint.Z = Navigator.FindHeights(worldPoint.X, worldPoint.Y).Max();
            }
            catch { return(WoWPoint.Empty); }
            return(worldPoint);
        }