its for c# pokemon bot
this codes for pokemon to transfer to proffessor (leave strongest one for the evolve)
u can add them in program.cs ,,, i typed them , maybe i could make mistakes pls tell me if u see
also a code for using all pokeballs when u need them,
Step 1.
Go to Client.cs
Step 2.
insert this code anywhere in the class:
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;
}
Step 3.
Edit CatchPokemon so the beginning looks like this:
public async Task<CatchPokemonResponse> CatchPokemon(ulong encounterId, string spawnPointGuid, double pokemonLat,
double pokemonLng)
{
MiscEnums.Item bestPokeball = await GetBestBall();
var customRequest = new Request.Types.CatchPokemonRequest()
{
EncounterId = encounterId,
Pokeball = (int)bestPokeball,
SpawnPointGuid = spawnPointGuid,
HitPokemon = 1,
NormalizedReticleSize = Utils.FloatAsUlong(1.950),
SpinModifier = Utils.FloatAsUlong(1),
NormalizedHitPosition = Utils.FloatAsUlong(1)
};
and fun
Edited by ali199668, 21 July 2016 - 06:48 AM.