PokeGOAPI-Java icon indicating copy to clipboard operation
PokeGOAPI-Java copied to clipboard

Fight in Gym - always fail

Open Lasek opened this issue 10 years ago • 63 comments

Description: When I start battle, status of start battle is always UNSET

Steps to reproduce:

Battle battle = gym.battle(attackers);
StartGymBattleResponseOuterClass.StartGymBattleResponse.Result result = battle.start();
if(result == StartGymBattleResponseOuterClass.StartGymBattleResponse.Result.SUCCESS){
    ...
}else{
    new throw Exception(result);
}

Expected behavior: Status should be SUCCESS

Actual behavior: Status always is UNSET

Version: Last commit ee28406d5a0f87dc2b16429f7b19e31fbac30a95

Lasek avatar Jul 26 '16 15:07 Lasek

I've been working on a fixed and improved Battle class, but I'm getting the same problem that a few others have gotten. The defender doesn't take any damage. (Although, in my case, it does occasionally)

I'm currently sending action_start_ms, target_index, active_pokemon_id, damage_windows_start_timestamp_ms, damage_windows_end_timestamp_ms and type, and I am making sure I do not send any timestamps greater than server_time_ms.

You can see the updated Battle class here: https://github.com/gegy1000/PokeGOAPI-Java/commit/d7802bdb663685a5f9ad09efe9784637c1b22e70

@firebolt55439 From what you've said above, it looks like the only fields that need to be set on the BattleAction being sent to the server are the ones I mentioned above. Could the required fields have changed in a newer version? Any idea what I'm doing wrong here?

Thanks.

EDIT: Okay, I made a silly mistake. I was performing special attacks when I didn't have enough energy and normal attacks when I did. My problem now is that after my first pokemon faints, the server will continue to send this faint action.

Gegy avatar Dec 11 '16 16:12 Gegy

hi @BadChoicesZ

I am working on fixing Gymbattle in Rocket API C# too. Hope you can share your experience to solve the issue, for you I learn how to do delay between 2 action since I debug and GymAttack work, but when run without debug it got BAD request, I believe that we need delay properly.

Thanks

samuraitruong avatar Jan 03 '17 05:01 samuraitruong

If you have any clues how to use ACTION_SWAP_POKEMON it will be great to know that to. What i'll do i've got always the same result: ERROR_INVALID_ATTACK_ACTIONS

ziomber avatar Jan 27 '17 15:01 ziomber