-
Member
Originally Posted by
chancity
CODE TO USE OTHER POKEBALLS.
Code:
private async Task<MiscEnums.Item> GetBestBall()
{
var inventory = await GetInventory();
var ballCollection = inventory.Payload[0].Bag.Items.Select(i => i.Item.Item).Where(p => p != null)
.GroupBy(i => (MiscEnums.Item)i.Item)
.Select(kvp => new { ItemId = kvp.Key, Amount = kvp.Sum(x => x.Count) })
.Where(y => y.ItemId == MiscEnums.Item.ITEM_POKE_BALL
|| y.ItemId == MiscEnums.Item.ITEM_GREAT_BALL
|| y.ItemId == MiscEnums.Item.ITEM_ULTRA_BALL
|| y.ItemId == MiscEnums.Item.ITEM_MASTER_BALL);
var pokeBallsCount = ballCollection.Where(p => p.ItemId == MiscEnums.Item.ITEM_POKE_BALL).
DefaultIfEmpty(new { ItemId = MiscEnums.Item.ITEM_POKE_BALL, Amount = 0 }).FirstOrDefault().Amount;
var greatBallsCount = ballCollection.Where(p => p.ItemId == MiscEnums.Item.ITEM_GREAT_BALL).
DefaultIfEmpty(new { ItemId = MiscEnums.Item.ITEM_GREAT_BALL, Amount = 0 }).FirstOrDefault().Amount;
var ultraBallsCount = ballCollection.Where(p => p.ItemId == MiscEnums.Item.ITEM_ULTRA_BALL).
DefaultIfEmpty(new { ItemId = MiscEnums.Item.ITEM_ULTRA_BALL, Amount = 0 }).FirstOrDefault().Amount;
var masterBallsCount = ballCollection.Where(p => p.ItemId == MiscEnums.Item.ITEM_MASTER_BALL).
DefaultIfEmpty(new { ItemId = MiscEnums.Item.ITEM_MASTER_BALL, Amount = 0 }).FirstOrDefault().Amount;
if (masterBallsCount > 0)
return MiscEnums.Item.ITEM_MASTER_BALL;
if (ultraBallsCount > 0)
return MiscEnums.Item.ITEM_ULTRA_BALL;
if (greatBallsCount > 0)
return MiscEnums.Item.ITEM_GREAT_BALL;
return MiscEnums.Item.ITEM_POKE_BALL;
}
Originally Posted by
chancity
client.cs in pokemongo.rocketapi
Also in CatchPokemon change pokeball to
Pokeball = (int) GetBestBall().Result,
I haven't tested yet.
can we have something like this in with necro version?
Last edited by Deedaa; 07-20-2016 at 04:18 PM.
-
Its for the latest version on FeroxRev repo
-
Member
if 1 out of 5 people play that's still like 25 million. Japan has 127 million or more.
Sent from my SM-G928V using Tapatalk
-
Active Member
hey, i am a google user for pokemon Go
Can you please help me?
AuthType AuthType { get; }
double DefaultLatitude { get; }
double DefaultLongitude { get; }
string GoogleRefreshToken { get; set; }
string PtcPassword { get; }
string PtcUsername { get; }
i just have to put cords in it?
that means?:
double DefaultLatitude { 45.030152; }
double DefaultLongitude { -93.31931; }
-
Member
Originally Posted by
chancity
TOO USE DIFFERENT POKEBALLS
This is for the latest github version
Code:
private static async Task<MiscEnums.Item> GetPokeBall(Client client)
{
var inventory = await client.GetInventory();
var ballCollection = inventory.InventoryDelta.InventoryItems
.Select(i => i.InventoryItemData?.Item)
.Where(p => p != null)
.GroupBy(i => (MiscEnums.Item)i.Item_)
.Select(kvp => new { ItemId = kvp.Key, Amount = kvp.Sum(x => x.Count) })
.Where(y => y.ItemId == MiscEnums.Item.ITEM_POKE_BALL
|| y.ItemId == MiscEnums.Item.ITEM_GREAT_BALL
|| y.ItemId == MiscEnums.Item.ITEM_ULTRA_BALL
|| y.ItemId == MiscEnums.Item.ITEM_MASTER_BALL);
var pokeBallsCount = ballCollection.Where(p => p.ItemId == MiscEnums.Item.ITEM_POKE_BALL).
DefaultIfEmpty(new { ItemId = MiscEnums.Item.ITEM_POKE_BALL, Amount = 0 }).FirstOrDefault().Amount;
var greatBallsCount = ballCollection.Where(p => p.ItemId == MiscEnums.Item.ITEM_GREAT_BALL).
DefaultIfEmpty(new { ItemId = MiscEnums.Item.ITEM_GREAT_BALL, Amount = 0 }).FirstOrDefault().Amount;
var ultraBallsCount = ballCollection.Where(p => p.ItemId == MiscEnums.Item.ITEM_ULTRA_BALL).
DefaultIfEmpty(new { ItemId = MiscEnums.Item.ITEM_ULTRA_BALL, Amount = 0 }).FirstOrDefault().Amount;
var masterBallsCount = ballCollection.Where(p => p.ItemId == MiscEnums.Item.ITEM_MASTER_BALL).
DefaultIfEmpty(new { ItemId = MiscEnums.Item.ITEM_MASTER_BALL, Amount = 0 }).FirstOrDefault().Amount;
if (masterBallsCount > 0)
return MiscEnums.Item.ITEM_MASTER_BALL;
if (ultraBallsCount > 0)
return MiscEnums.Item.ITEM_ULTRA_BALL;
if (greatBallsCount > 0)
return MiscEnums.Item.ITEM_GREAT_BALL;
return MiscEnums.Item.ITEM_POKE_BALL;
}
private static async Task ExecuteCatchAllNearbyPokemons(Client client)
{
var mapObjects = await client.GetMapObjects();
var pokemons = mapObjects.MapCells.SelectMany(i => i.CatchablePokemons);
foreach (var pokemon in pokemons)
{
var update = await client.UpdatePlayerLocation(pokemon.Latitude, pokemon.Longitude);
var encounterPokemonRespone = await client.EncounterPokemon(pokemon.EncounterId, pokemon.SpawnpointId);
var pokeball = await GetPokeBall(client);
CatchPokemonResponse caughtPokemonResponse;
do
{
caughtPokemonResponse = await client.CatchPokemon(pokemon.EncounterId, pokemon.SpawnpointId, pokemon.Latitude, pokemon.Longitude, pokeball); //note: reverted from settings because this should not be part of settings but part of logic
}
while(caughtPokemonResponse.Status == CatchPokemonResponse.Types.CatchStatus.CatchMissed);
System.Console.WriteLine(caughtPokemonResponse.Status == CatchPokemonResponse.Types.CatchStatus.CatchSuccess ? $"[{DateTime.Now.ToString("HH:mm:ss")}] We caught a {pokemon.PokemonId}" : $"[{DateTime.Now.ToString("HH:mm:ss")}] {pokemon.PokemonId} got away..");
await Task.Delay(5000);
await Task.Delay(5000);
}
}
dude can you give me link to the last gifthub version? ty
-
Member
Originally Posted by
uploader619
but i thought japan has low population so does not matter if every people there starts playing?
Don't know what you are thinking, but 127,3 million people in Japan, and they are bound to have much higher ratio of people that will actually play.
-
Member
Originally Posted by
ptmazkirut
can you give me link to this? thanks!!
if you can't even figure out how to download it, then this is not for you
-
Post Thanks / Like - 3 Thanks
-
Active Member
Originally Posted by
Neer
TOO USE DIFFERENT POKEBALLS
This is for the latest github version
Code:
private static async Task<MiscEnums.Item> GetPokeBall(Client client)
{
var inventory = await client.GetInventory();
var ballCollection = inventory.InventoryDelta.InventoryItems
.Select(i => i.InventoryItemData?.Item)
.Where(p => p != null)
.GroupBy(i => (MiscEnums.Item)i.Item_)
.Select(kvp => new { ItemId = kvp.Key, Amount = kvp.Sum(x => x.Count) })
.Where(y => y.ItemId == MiscEnums.Item.ITEM_POKE_BALL
|| y.ItemId == MiscEnums.Item.ITEM_GREAT_BALL
|| y.ItemId == MiscEnums.Item.ITEM_ULTRA_BALL
|| y.ItemId == MiscEnums.Item.ITEM_MASTER_BALL);
var pokeBallsCount = ballCollection.Where(p => p.ItemId == MiscEnums.Item.ITEM_POKE_BALL).
DefaultIfEmpty(new { ItemId = MiscEnums.Item.ITEM_POKE_BALL, Amount = 0 }).FirstOrDefault().Amount;
var greatBallsCount = ballCollection.Where(p => p.ItemId == MiscEnums.Item.ITEM_GREAT_BALL).
DefaultIfEmpty(new { ItemId = MiscEnums.Item.ITEM_GREAT_BALL, Amount = 0 }).FirstOrDefault().Amount;
var ultraBallsCount = ballCollection.Where(p => p.ItemId == MiscEnums.Item.ITEM_ULTRA_BALL).
DefaultIfEmpty(new { ItemId = MiscEnums.Item.ITEM_ULTRA_BALL, Amount = 0 }).FirstOrDefault().Amount;
var masterBallsCount = ballCollection.Where(p => p.ItemId == MiscEnums.Item.ITEM_MASTER_BALL).
DefaultIfEmpty(new { ItemId = MiscEnums.Item.ITEM_MASTER_BALL, Amount = 0 }).FirstOrDefault().Amount;
if (masterBallsCount > 0)
return MiscEnums.Item.ITEM_MASTER_BALL;
if (ultraBallsCount > 0)
return MiscEnums.Item.ITEM_ULTRA_BALL;
if (greatBallsCount > 0)
return MiscEnums.Item.ITEM_GREAT_BALL;
return MiscEnums.Item.ITEM_POKE_BALL;
}
private static async Task ExecuteCatchAllNearbyPokemons(Client client)
{
var mapObjects = await client.GetMapObjects();
var pokemons = mapObjects.MapCells.SelectMany(i => i.CatchablePokemons);
foreach (var pokemon in pokemons)
{
var update = await client.UpdatePlayerLocation(pokemon.Latitude, pokemon.Longitude);
var encounterPokemonRespone = await client.EncounterPokemon(pokemon.EncounterId, pokemon.SpawnpointId);
var pokeball = await GetPokeBall(client);
CatchPokemonResponse caughtPokemonResponse;
do
{
caughtPokemonResponse = await client.CatchPokemon(pokemon.EncounterId, pokemon.SpawnpointId, pokemon.Latitude, pokemon.Longitude, pokeball); //note: reverted from settings because this should not be part of settings but part of logic
}
while(caughtPokemonResponse.Status == CatchPokemonResponse.Types.CatchStatus.CatchMissed);
System.Console.WriteLine(caughtPokemonResponse.Status == CatchPokemonResponse.Types.CatchStatus.CatchSuccess ? $"[{DateTime.Now.ToString("HH:mm:ss")}] We caught a {pokemon.PokemonId}" : $"[{DateTime.Now.ToString("HH:mm:ss")}] {pokemon.PokemonId} got away..");
await Task.Delay(5000);
await Task.Delay(5000);
}
}
maybe add this?
-
Originally Posted by
ptmazkirut
dude can you give me link to the last gifthub version? ty
https://github.com/FeroxRev/Pokemon-Go-Rocket-API
-
Originally Posted by
TBL-Equi
I am still hoping even this retarded developer won't be stupid enough to use the existing servers for the japan release...
Oh they will, you can count on it.
-
Member
Originally Posted by
xstyle69
hey, i am a google user for pokemon Go
Can you please help me?
AuthType AuthType { get; }
double DefaultLatitude { get; }
double DefaultLongitude { get; }
string GoogleRefreshToken { get; set; }
string PtcPassword { get; }
string PtcUsername { get; }
i just have to put cords in it?
that means?:
double DefaultLatitude { 45.030152; }
double DefaultLongitude { -93.31931; }
no... go back and read instructions again, if you get to the same conclusion bang head off wall and try again
-
Post Thanks / Like - 3 Thanks
-
Knight
Originally Posted by
chancity
im using the one in your link rather than one in here as its more updated should i still add that code for the pokeball switch?
-
Originally Posted by
xdanielx98
no... go back and read instructions again, if you get to the same conclusion bang head off wall and try again
I'm going to say that like 80~% of the people in this thread are ****ing skids, it's the most annoying thing ever
-
Member
Originally Posted by
KefkaBot
Oh they will, you can count on it.
yea, less servers = more profit
-
Member
Has the update anything to do with the Bot not working?