public static void UpdateStats(int loot, int kills, int death) { loots += loot; _kills += kills; _death += death; TimeSpan duration = DateTime.Now - _startTime; string timeToLevel = string.Empty; double xpPerHourBySession = 0; _xpCurrent = ObjectManager.MyPlayer.Experience; if (_xpCurrent < _xpInitial) { Logging.Write("Ding!"); _xpInitial = ObjectManager.MyPlayer.Experience; _xpCurrent = _xpInitial; _startTime = DateTime.Now; /*if (GrindingSettings.ShouldTrain) * { * Navigator.Stop(); * MoveHelper.ReleaseKeys(); * ShouldTrain = false; * //ShouldTrain = GrindingShouldTrain.ShouldTrain(); * }*/ } else { double xpGained = (_xpCurrent - _xpInitial); double time = (duration.Milliseconds); // hours if (time != 0.0) { try { int toLevelXp = ObjectManager.MyPlayer.NextLevel - ObjectManager.MyPlayer.Experience; double sessionTime = duration.TotalSeconds; double seconds = (toLevelXp * sessionTime / xpGained); xpPerHourBySession = Math.Round(xpGained / sessionTime * 3600, 0); TimeSpan t = TimeSpan.FromSeconds(seconds); timeToLevel = string.Format("{0:D2}h:{1:D2}m:{2:D2}s", t.Hours, t.Minutes, t.Seconds); } catch { //Empty } } } LazyForm.Loots = loots; LazyForm.Deaths = _death; LazyForm.Kills = _kills; LazyForm.TimeToLevel = timeToLevel; LazyForm.UpdateStatsText(string.Format("Loots:{0} -Kills:{1} -Deaths:{2} -XP/H: {3}-TTL:{4} ", loots, _kills, _death, xpPerHourBySession, timeToLevel)); }
public static void UpdateStats(int harvest, int kills, int death) { _harvest += harvest; _kills += kills; _death += death; TimeSpan duration = DateTime.Now - _startTime; double time = (duration.Milliseconds); // hours string harvestHours = string.Empty; if (time != 0.0) { double sessionTime = duration.TotalSeconds; harvestHours = Math.Round(_harvest / sessionTime * 3600, 2).ToString(); } LazyForm.Deaths = _death; LazyForm.Kills = _kills; LazyForm.Harvests = _harvest; LazyForm.LPH = harvestHours; LazyForm.UpdateStatsText(string.Format("Loots: {0} - Kills: {1} - Deaths: {2} - Harvests/Hour: {3}", _harvest, _kills, _death, harvestHours)); }
public void UpdateState(string text) { LazyForm.UpdateStatsText(text); }