private async Task StatsLog(Client client) { dontspam++; var profile = await _client.GetCachedProfile(); var playerStats = await _inventory.GetPlayerStats(); var stats = playerStats.First(); var expneeded = stats.NextLevelXp - stats.PrevLevelXp - StringUtils.getExpDiff(stats.Level); var curexp = stats.Experience - stats.PrevLevelXp - StringUtils.getExpDiff(stats.Level); var curexppercent = Convert.ToDouble(curexp) / Convert.ToDouble(expneeded) * 100; var pokemonToEvolve = (await _inventory.GetPokemonToEvolve()).Count(); Logger.ColoredConsoleWrite(ConsoleColor.Cyan, "-----------------------[PLAYER STATS]-----------------------"); Logger.ColoredConsoleWrite(ConsoleColor.Cyan, $"Level/EXP: {stats.Level} {curexp.ToString("N0")}/{expneeded.ToString("N0")} ({Math.Round(curexppercent, 2)}%)"); Logger.ColoredConsoleWrite(ConsoleColor.Cyan, "EXP to Level-UP: " + (stats.NextLevelXp - stats.Experience).ToString("N0")); Logger.ColoredConsoleWrite(ConsoleColor.Cyan, "PokeStops visited: " + stats.PokeStopVisits.ToString("N0")); Logger.ColoredConsoleWrite(ConsoleColor.Cyan, "KM walked: " + stats.KmWalked.ToString("N0")); Logger.ColoredConsoleWrite(ConsoleColor.Cyan, "Pokemon: " + await _inventory.GetPokemonCount() + " + " + await _inventory.GetEggsCount() + " Eggs /" + profile.Profile.PokeStorage + " (" + pokemonToEvolve + " Evolvable)"); Logger.ColoredConsoleWrite(ConsoleColor.Cyan, "Items: " + await _inventory.GetInventoryCount() + "/" + profile.Profile.ItemStorage); Logger.ColoredConsoleWrite(ConsoleColor.Cyan, "Stardust: " + profile.Profile.Currency.ToArray()[1].Amount.ToString("N0")); Logger.ColoredConsoleWrite(ConsoleColor.Cyan, "------------------------------------------------------------"); //if (dontspam >= 3) //{ // dontspam = 0; // PokeService data = null; // try // { // var clientx = new WebClient(); // clientx.Headers.Add("user-agent", "PokegoBot-Ar1i-Github"); // var jsonString = clientx.DownloadString("https://go.jooas.com/status"); // data = new JavaScriptSerializer().Deserialize<PokeService>(jsonString); // } // catch (Exception) // { // } // if (data != null) // { // Logger.ColoredConsoleWrite(ConsoleColor.White, ""); // Logger.ColoredConsoleWrite(ConsoleColor.Cyan, "PokemonGO Server Status:"); // if (data.go_online) // { // if (data.go_idle > 60) // { // int gohour = Convert.ToInt32(data.go_idle / 60); // if (gohour > 24) // { // int goday = gohour / 24; // Logger.ColoredConsoleWrite(ConsoleColor.Green, "Online since ~" + goday + " day(s)."); // } // else // { // Logger.ColoredConsoleWrite(ConsoleColor.Green, "Online since ~" + gohour + "h."); // } // } // else // { // Logger.ColoredConsoleWrite(ConsoleColor.Green, "Online since ~" + data.go_idle + " min."); // } // Logger.ColoredConsoleWrite(ConsoleColor.Green, "Server anwsers in ~" + data.go_response + " seconds."); // } // else // { // Logger.ColoredConsoleWrite(ConsoleColor.Red, "Pokemon GO Servers: Offline."); // } // Logger.ColoredConsoleWrite(ConsoleColor.Cyan, "Pokemon Trainer Club Server Status:"); // if (data.ptc_online) // { // if (data.ptc_idle > 60) // { // int ptchour = Convert.ToInt32(data.ptc_idle / 60); // if (ptchour > 24) // { // int ptcday = ptchour / 24; // Logger.ColoredConsoleWrite(ConsoleColor.Green, "Online since ~" + ptcday + " day(s)."); // } // else // { // Logger.ColoredConsoleWrite(ConsoleColor.Green, "Online since ~" + ptchour + "h."); // } // } // else // { // Logger.ColoredConsoleWrite(ConsoleColor.Green, "Online since ~" + data.ptc_idle + " min."); // } // Logger.ColoredConsoleWrite(ConsoleColor.Green, "Server anwsers in ~" + data.ptc_response + " seconds."); // } // else // { // Logger.ColoredConsoleWrite(ConsoleColor.Red, "Pokemon Trainer Club: Offline."); // } // } // else // { // Logger.ColoredConsoleWrite(ConsoleColor.Red, "Cant get Server Status from https://go.jooas.com/status"); // } //} System.Console.Title = profile.Profile.Username + " lvl" + stats.Level + "-(" + (stats.Experience - stats.PrevLevelXp - StringUtils.getExpDiff(stats.Level)).ToString("N0") + "/" + (stats.NextLevelXp - stats.PrevLevelXp - StringUtils.getExpDiff(stats.Level)).ToString("N0") + "|" + Math.Round(curexppercent, 2) + "%)| Stardust: " + profile.Profile.Currency.ToArray()[1].Amount + "| " + _botStats.ToString(); }
private async Task StatsLog(Client client) { var profil = await _client.GetCachedProfile(); var stats = await _inventory.GetPlayerStats(); var c = stats.FirstOrDefault(); int l = c.Level; var expneeded = ((c.NextLevelXp - c.PrevLevelXp) - StringUtils.getExpDiff(c.Level)); var curexp = ((c.Experience - c.PrevLevelXp) - StringUtils.getExpDiff(c.Level)); var curexppercent = (Convert.ToDouble(curexp) / Convert.ToDouble(expneeded)) * 100; var pokemonToEvolve = (await _inventory.GetPokemonToEvolve(null)).Count(); Logger.ColoredConsoleWrite(ConsoleColor.Cyan, "_____________________________"); Logger.ColoredConsoleWrite(ConsoleColor.Cyan, "Level: " + c.Level); Logger.ColoredConsoleWrite(ConsoleColor.Cyan, "EXP Needed: " + expneeded); Logger.ColoredConsoleWrite(ConsoleColor.Cyan, $"Current EXP: {curexp} ({Math.Round(curexppercent)}%)"); Logger.ColoredConsoleWrite(ConsoleColor.Cyan, "EXP to Level up: " + ((c.NextLevelXp) - (c.Experience))); Logger.ColoredConsoleWrite(ConsoleColor.Cyan, "KM Walked: " + c.KmWalked); Logger.ColoredConsoleWrite(ConsoleColor.Cyan, "PokeStops visited: " + c.PokeStopVisits); Logger.ColoredConsoleWrite(ConsoleColor.Cyan, "Stardust: " + profil.Profile.Currency.ToArray()[1].Amount); Logger.ColoredConsoleWrite(ConsoleColor.Cyan, "Pokemon to evolve: " + pokemonToEvolve); Logger.ColoredConsoleWrite(ConsoleColor.Cyan, "Pokemons: " + await _inventory.getPokemonCount() + "/" + profil.Profile.PokeStorage); Logger.ColoredConsoleWrite(ConsoleColor.Cyan, "Items: " + await _inventory.getInventoryCount() + "/" + profil.Profile.ItemStorage); Logger.ColoredConsoleWrite(ConsoleColor.Cyan, "_____________________________"); System.Console.Title = profil.Profile.Username + " Level " + c.Level + " - (" + ((c.Experience - c.PrevLevelXp) - StringUtils.getExpDiff(c.Level)) + " / " + ((c.NextLevelXp - c.PrevLevelXp) - StringUtils.getExpDiff(c.Level)) + " | " + Math.Round(curexppercent) + "%) | Stardust: " + profil.Profile.Currency.ToArray()[1].Amount + " | " + _botStats.ToString(); }
private async Task StatsLog(Client client) { dontspam++; var profil = await _client.GetCachedProfile(); var stats = await _inventory.GetPlayerStats(); var c = stats.FirstOrDefault(); int l = c.Level; var expneeded = ((c.NextLevelXp - c.PrevLevelXp) - StringUtils.getExpDiff(c.Level)); var curexp = ((c.Experience - c.PrevLevelXp) - StringUtils.getExpDiff(c.Level)); var curexppercent = (Convert.ToDouble(curexp) / Convert.ToDouble(expneeded)) * 100; var pokemonToEvolve = (await _inventory.GetPokemonToEvolve(null)).Count(); Logger.ColoredConsoleWrite(ConsoleColor.Cyan, "_____________________________"); Logger.ColoredConsoleWrite(ConsoleColor.Cyan, "Level: " + c.Level); Logger.ColoredConsoleWrite(ConsoleColor.Cyan, "EXP Needed: " + expneeded); Logger.ColoredConsoleWrite(ConsoleColor.Cyan, $"Current EXP: {curexp} ({Math.Round(curexppercent)}%)"); Logger.ColoredConsoleWrite(ConsoleColor.Cyan, "EXP to Level up: " + ((c.NextLevelXp) - (c.Experience))); Logger.ColoredConsoleWrite(ConsoleColor.Cyan, "KM Walked: " + c.KmWalked); Logger.ColoredConsoleWrite(ConsoleColor.Cyan, "PokeStops visited: " + c.PokeStopVisits); Logger.ColoredConsoleWrite(ConsoleColor.Cyan, "Stardust: " + profil.Profile.Currency.ToArray()[1].Amount); Logger.ColoredConsoleWrite(ConsoleColor.Cyan, "Pokemon to evolve: " + pokemonToEvolve); Logger.ColoredConsoleWrite(ConsoleColor.Cyan, "Pokemons: " + await _inventory.getPokemonCount() + "/" + profil.Profile.PokeStorage); Logger.ColoredConsoleWrite(ConsoleColor.Cyan, "Items: " + await _inventory.getInventoryCount() + "/" + profil.Profile.ItemStorage); if (dontspam >= 3) { dontspam = 0; PokeService data = null; try { var clientx = new WebClient(); clientx.Headers.Add("user-agent", "PokegoBot-Ar1i-Github"); var jsonString = clientx.DownloadString("https://go.jooas.com/status"); data = new JavaScriptSerializer().Deserialize <PokeService>(jsonString); } catch (Exception) { } if (data != null) { Logger.ColoredConsoleWrite(ConsoleColor.White, ""); Logger.ColoredConsoleWrite(ConsoleColor.Cyan, "PokemonGO Server Status:"); if (data.go_online) { if (data.go_idle > 60) { int gohour = Convert.ToInt32(data.go_idle / 60); if (gohour > 24) { int goday = gohour / 24; Logger.ColoredConsoleWrite(ConsoleColor.Green, "Online since ~" + goday + " day(s)."); } else { Logger.ColoredConsoleWrite(ConsoleColor.Green, "Online since ~" + gohour + "h."); } } else { Logger.ColoredConsoleWrite(ConsoleColor.Green, "Online since ~" + data.go_idle + " min."); } Logger.ColoredConsoleWrite(ConsoleColor.Green, "Server anwsers in ~" + data.go_response + " seconds."); } else { Logger.ColoredConsoleWrite(ConsoleColor.Red, "Pokemon GO Servers: Offline."); } Logger.ColoredConsoleWrite(ConsoleColor.Cyan, "Pokemon Trainer Club Server Status:"); if (data.ptc_online) { if (data.ptc_idle > 60) { int ptchour = Convert.ToInt32(data.ptc_idle / 60); if (ptchour > 24) { int ptcday = ptchour / 24; Logger.ColoredConsoleWrite(ConsoleColor.Green, "Online since ~" + ptcday + " day(s)."); } else { Logger.ColoredConsoleWrite(ConsoleColor.Green, "Online since ~" + ptchour + "h."); } } else { Logger.ColoredConsoleWrite(ConsoleColor.Green, "Online since ~" + data.ptc_idle + " min."); } Logger.ColoredConsoleWrite(ConsoleColor.Green, "Server anwsers in ~" + data.ptc_response + " seconds."); } else { Logger.ColoredConsoleWrite(ConsoleColor.Red, "Pokemon Trainer Club: Offline."); } } else { Logger.ColoredConsoleWrite(ConsoleColor.Red, "Cant get Server Status from https://go.jooas.com/status"); } } Logger.ColoredConsoleWrite(ConsoleColor.Cyan, "_____________________________"); System.Console.Title = "PokeBot3 | User: "******" | Level " + c.Level + " - (" + ((c.Experience - c.PrevLevelXp) - StringUtils.getExpDiff(c.Level)) + " / " + ((c.NextLevelXp - c.PrevLevelXp) - StringUtils.getExpDiff(c.Level)) + " | " + Math.Round(curexppercent) + "%) | Stardust: " + profil.Profile.Currency.ToArray()[1].Amount + " | " + _botStats.ToString(); Vars.username = profil.Profile.Username; Vars.xprate = _botStats.xprate(); Vars.catchrate = _botStats.catchrate(); Vars.stardust = profil.Profile.Currency.ToArray()[1].Amount.ToString(); Vars.evolvecount = pokemonToEvolve.ToString(); Vars.pokemon = await _inventory.getPokemonCount() + "/" + profil.Profile.PokeStorage; Vars.level = "Level " + c.Level + " - (" + ((c.Experience - c.PrevLevelXp) - StringUtils.getExpDiff(c.Level)) + " / " + ((c.NextLevelXp - c.PrevLevelXp) - StringUtils.getExpDiff(c.Level)) + " | " + Math.Round(curexppercent) + "%)"; Vars.percentage = Math.Round(curexppercent).ToString(); Vars.items = await _inventory.getInventoryCount() + "/" + profil.Profile.ItemStorage; }
private async Task StatsLog(Client client) { dontspam++; var profile = await _client.Player.GetPlayer(); var playerStats = await _client.Inventory.GetPlayerStats(); var stats = playerStats.First(); var expneeded = stats.NextLevelXp - stats.PrevLevelXp - StringUtils.getExpDiff(stats.Level); var curexp = stats.Experience - stats.PrevLevelXp - StringUtils.getExpDiff(stats.Level); var curexppercent = Convert.ToDouble(curexp) / Convert.ToDouble(expneeded) * 100; var pokemonToEvolve = (await _client.Inventory.GetPokemonToEvolve()).Count(); var pokedexpercentraw = Convert.ToDouble(stats.UniquePokedexEntries) / Convert.ToDouble(150) * 100; var pokedexpercent = Math.Floor(pokedexpercentraw); Logger.ColoredConsoleWrite(ConsoleColor.Cyan, "-----------------------[PLAYER STATS UPDATE]-----------------------"); Logger.ColoredConsoleWrite(ConsoleColor.Cyan, $"Level/EXP: {stats.Level} {curexp.ToString("N0")}/{expneeded.ToString("N0")} ({Math.Round(curexppercent, 2)}%) EXP to Level up: " + (stats.NextLevelXp - stats.Experience)); Logger.ColoredConsoleWrite(ConsoleColor.Cyan, "PokeStops visited: " + stats.PokeStopVisits + " KM Walked: " + stats.KmWalked); Logger.ColoredConsoleWrite(ConsoleColor.Cyan, "Pokemon: " + await _client.Inventory.getPokemonCount() + " + " + await _client.Inventory.GetEggsCount() + " Eggs /" + profile.PlayerData.MaxPokemonStorage + " (" + pokemonToEvolve + " Evolvable)"); Logger.ColoredConsoleWrite(ConsoleColor.Cyan, "Pokedex Completion: " + stats.UniquePokedexEntries + "/150 " + pokedexpercent + "%"); Logger.ColoredConsoleWrite(ConsoleColor.Cyan, "Items: " + await _client.Inventory.getInventoryCount() + "/" + profile.PlayerData.MaxItemStorage + " Stardust: " + profile.PlayerData.Currencies.ToArray()[1].Amount.ToString("N0")); if (level == -1) { level = stats.Level; } else if (stats.Level > level) { level = stats.Level; Logger.ColoredConsoleWrite(ConsoleColor.Magenta, "Got the level up reward from you level up."); var lvlup = await _client.Player.GetLevelUpRewards(stats.Level); List <ItemId> alreadygot = new List <ItemId>(); foreach (var i in lvlup.ItemsAwarded) { if (!alreadygot.Contains(i.ItemId)) { Logger.ColoredConsoleWrite(ConsoleColor.Magenta, "Got Item: " + i.ItemId + " " + i.ItemCount + "x"); alreadygot.Add(i.ItemId); } } alreadygot.Clear(); } //if (dontspam >= 3) //{ // dontspam = 0; // PokeService data = null; // try // { // var clientx = new WebClient(); // clientx.Headers.Add("user-agent", "PokegoBot-Ar1i-Github"); // var jsonString = clientx.DownloadString("https://go.jooas.com/status"); // data = new JavaScriptSerializer().Deserialize<PokeService>(jsonString); // } // catch (Exception) // { // } // if (data != null) // { // Logger.ColoredConsoleWrite(ConsoleColor.White, ""); // Logger.ColoredConsoleWrite(ConsoleColor.Cyan, "PokemonGO Server Status:"); // if (data.go_online) // { // if (data.go_idle > 60) // { // int gohour = Convert.ToInt32(data.go_idle / 60); // if (gohour > 24) // { // int goday = gohour / 24; // Logger.ColoredConsoleWrite(ConsoleColor.Green, "Online since ~" + goday + " day(s)."); // } // else // { // Logger.ColoredConsoleWrite(ConsoleColor.Green, "Online since ~" + gohour + "h."); // } // } // else // { // Logger.ColoredConsoleWrite(ConsoleColor.Green, "Online since ~" + data.go_idle + " min."); // } // Logger.ColoredConsoleWrite(ConsoleColor.Green, "Server anwsers in ~" + data.go_response + " seconds."); // } // else // { // Logger.ColoredConsoleWrite(ConsoleColor.Red, "Pokemon GO Servers: Offline."); // } // Logger.ColoredConsoleWrite(ConsoleColor.Cyan, "Pokemon Trainer Club Server Status:"); // if (data.ptc_online) // { // if (data.ptc_idle > 60) // { // int ptchour = Convert.ToInt32(data.ptc_idle / 60); // if (ptchour > 24) // { // int ptcday = ptchour / 24; // Logger.ColoredConsoleWrite(ConsoleColor.Green, "Online since ~" + ptcday + " day(s)."); // } // else // { // Logger.ColoredConsoleWrite(ConsoleColor.Green, "Online since ~" + ptchour + "h."); // } // } // else // { // Logger.ColoredConsoleWrite(ConsoleColor.Green, "Online since ~" + data.ptc_idle + " min."); // } // Logger.ColoredConsoleWrite(ConsoleColor.Green, "Server anwsers in ~" + data.ptc_response + " seconds."); // } // else // { // Logger.ColoredConsoleWrite(ConsoleColor.Red, "Pokemon Trainer Club: Offline."); // } // } // else // { // Logger.ColoredConsoleWrite(ConsoleColor.Red, "Cant get Server Status from https://go.jooas.com/status"); // } //} Console.Title = profile.PlayerData.Username + " lvl" + stats.Level + "-(" + (stats.Experience - stats.PrevLevelXp - StringUtils.getExpDiff(stats.Level)).ToString("N0") + "/" + (stats.NextLevelXp - stats.PrevLevelXp - StringUtils.getExpDiff(stats.Level)).ToString("N0") + "|" + Math.Round(curexppercent, 2) + "%)| Stardust: " + profile.PlayerData.Currencies.ToArray()[1].Amount + "| " + _botStats.ToString(); }