kwsch / SysBot.NET

sys-botbase client for remote control automation of Nintendo Switch consoles.
https://projectpokemon.org/home/files/file/4207-sysbot-automatic-build/
GNU Affero General Public License v3.0
463 stars 270 forks source link

Error when both pokemon are the same. #121

Closed ZyC0R3 closed 2 years ago

ZyC0R3 commented 2 years ago

Went and caugh a fesh helioptile Traded it for an oddish , the bot sent me the pk8 file - (694_-Helioptile-_2B830407FE96)

Edited the helioptile from level 31 to 41 - (694 - Helioptile - CBC10407FE96) And trade it back to my game Then i edited it again and made it level 51 - (694 - Helioptile - D0C70407FE96) I then trade the new lvl 51 back to game and picked the lvl 41 to send to the bot.

The trade is successful and i recive the newley edited level 51 but the bot then give this error.

Oops! Something happened. Canceling the trade: TrainerTooSlow. Trade canceled: TrainerTooSlow

https://drive.google.com/drive/folders/1KQ0BnGbEX5lQ2T-bZ1cxd1iACycwr9ok?usp=sharing (the link is the PK files)

Lusamine commented 2 years ago

The bot uses this comparison to see if the requested Pokémon is different from what remains in the box at the end of the trade. https://github.com/kwsch/SysBot.NET/blob/cd9e66c27c22399b84acc4decc74adb870ca1b86/SysBot.Pokemon/SWSH/BotTrade/PokeTradeBot.cs#L375-L383

If you traded exactly the same Pokémon for itself, it would also not be able to identify a trade had happened. If you end up with the same thing, isn't that the same thing as not trading?

This has always been a possibility. Since the trade goes through and it would be pointless to trade for the same Pokémon, I haven't considered this a big problem. We would have to alter the check to cover more cases like this.

ZyC0R3 commented 2 years ago

Ah, that make perfect sense, thank you for getting back so fast.

Is there any way to change the error message then, so if it's the same Pokémon it does not say Trainer Too Slow.

As there has been a modification to the pk8 file, the (I'm guessing it's a hash variable) in the file name is different can these not be compared to determine if it's a different Pokémon.

Lusamine commented 2 years ago

Will still fail if you injected the exact same mon on both sides, but should catch more editing cases.

https://github.com/kwsch/SysBot.NET/commit/8274c7f7bf7d679401acebc02f508f777fa6a8b4