drgoku282 / PKMN-NTR

A Pokémon on-the air memory editing/reading program with bots for Nintendo 3DS.
http://gbatemp.net/threads/pkmn-ntr-real-time-memory-editing-program-for-pok%C3%A9mon-games-wip.448588/
GNU General Public License v3.0
90 stars 24 forks source link

The end all Gen 7 WT reliability thread #159

Open k20stitch opened 6 years ago

k20stitch commented 6 years ago

Sorry for adding yet another Gen 7 WT issue, but I'd like to use this one to help explain what I've discovered is causing the following issues:

These issues all have the same thing in common, they get stuck attempting the next trade. It also seemed like the bot was incorrectly picking Pokemon despite having the correct coordinates.

https://github.com/drgoku282/PKMN-NTR/issues/138 https://github.com/drgoku282/PKMN-NTR/issues/152 https://github.com/drgoku282/PKMN-NTR/issues/154

So what's really happening? I ran the bot over and over again with a complete dex and recorded the logs side by side the video output. During this time, I also never encountered any pokemon that evolved via trade.

After the trade is detected, the program waits for 30 seconds. In my own build, I raised this to 35 for trouble shooting.

NTR: Read data at address 0x006A62E6
NTR: Expected value 0x00003F80 to 0x00003F80
NTR: Read 0x4 bytes at address 0x006A62E6
packet: cmd = 9, dataLen = 4
NTR: Read sucessful - 0x00003F80
NTR: Value in range: YES
Bot: Trade detected
NTR: Read pokémon data at box 1, slot 1
NTR: Read 0xE8 bytes at address 0x33015AB0
packet: cmd = 9, dataLen = 232
NTR: Read sucessful - PID 0x5B38E62F
Bot: Wait 35 seconds

At this point, I'm at the "Start" wonder trade screen. The correct screen to be at. NTR is expecting 0x0 @ 0x006A62B2 but instead gets 0x00003F80. What's really interesting, is that this value of "tradeready" for the "trademenuoff". Anyways, this causes the bot to enter another state where it begins button mashing A.

Bot: Test if the trade is 
NTR: Read data at address 0x006A62B2
NTR: Expected value 0x00000000 to 0x00000000
NTR: Read 0x4 bytes at address 0x006A62B2
packet: cmd = 9, dataLen = 4
NTR: Read sucessful - 0x00003F80
NTR: Value in range: NO
Bot: Press A button
NTR: Send button command 0xFFE
NTR: Button command sent correctly
Bot: Test if the trade is 
NTR: Read data at address 0x006A62B2
NTR: Expected value 0x00000000 to 0x00000000
NTR: Read 0x4 bytes at address 0x006A62B2
packet: cmd = 9, dataLen = 4
NTR: Read sucessful - 0x00003F80
NTR: Value in range: NO
Bot: Press A button
NTR: Send button command 0xFFE
NTR: Button command sent correctly
Bot: Test if the trade is 
NTR: Read data at address 0x006A62B2
NTR: Expected value 0x00000000 to 0x00000000
NTR: Read 0x4 bytes at address 0x006A62B2
packet: cmd = 9, dataLen = 4
NTR: Read sucessful - 0x00003F80
NTR: Value in range: NO
Bot: Press A button
NTR: Send button command 0xFFE
NTR: Button command sent correctly
Bot: Test if the trade is 
NTR: Read data at address 0x006A62B2
NTR: Expected value 0x00000000 to 0x00000000
NTR: Read 0x4 bytes at address 0x006A62B2
packet: cmd = 9, dataLen = 4
NTR: Read sucessful - 0x00000000
NTR: Value in range: YES

At this point the bot finally finds what it's looking for but it's already selected slot 1 at this point since the A button has been pressed three times. The first A clicks "start", they second A happens during a black screen and is ignored, The third A selects the Pokemon in slot 1. This is where people incorrectly assume that the bot has picked the wrong monster. Now all of a sudden, the bot proceeds to touch the correct coordinates but the touch is effectively ignored, because slot 1 has already been selected. Sometimes, it corrects itself from here, other times it's in a continuous button mashing state. The bot state that it enters incorrectly is .TryFinish -> !tradeevo -> isUSUM -> Push A

Bot: Look for pokemon to trade
NTR: Read pokémon data at box 1, slot 2
NTR: Read 0xE8 bytes at address 0x33015B98
packet: cmd = 9, dataLen = 232
NTR: Read sucessful - PID 0xD34F8FFE
Bot: Pokémon found - 0x2D98
Bot: Test if the Wonder Trade screen is shown
NTR: Read data at address 0x006A62B2 during 5000 ms
NTR: Expected value 0x00000000 to 0x00000040
NTR: Read 0x4 bytes at address 0x006A62B2
packet: cmd = 9, dataLen = 4
NTR: Read sucessful - 0x00000000
NTR: Value in range: YES
Bot: Press Start
NTR: Send button command 0xFFE during 250 ms
NTR: Button command sent, no feedback provided
Bot: Test if the boxes are shown
NTR: Read data at address 0x006A6132 during 5000 ms
NTR: Expected value 0x00004221 to 0x00004221
NTR: Read 0x4 bytes at address 0x006A6132
packet: cmd = 9, dataLen = 4
NTR: Read sucessful - 0x00004221
NTR: Value in range: YES
Bot: Touch pokémon
NTR: Touch the screen at 60,70
NTR: Touch screen command sent correctly
Bot: Test if pokemon is selected
NTR: Read pokémon data at offset 0x30000298
NTR: Read 0xE8 bytes at address 0x30000298
packet: cmd = 9, dataLen = 232
NTR: Read sucessful - PID 0x5B38E62F
Bot: Picked incorrect pokemon
Bot: Cancel selection and check again
NTR: Read pokémon data at box 1, slot 2
NTR: Read 0xE8 bytes at address 0x33015B98
packet: cmd = 9, dataLen = 232
NTR: Read sucessful - PID 0xD34F8FFE
NTR: Send button command 0xFFD
NTR: Button command sent correctly
Bot: Touch pokémon
NTR: Touch the screen at 60,70
NTR: Touch screen command sent correctly
Bot: Test if pokemon is selected
NTR: Read pokémon data at offset 0x30000298
NTR: Read 0xE8 bytes at address 0x30000298
packet: cmd = 9, dataLen = 232
NTR: Read sucessful - PID 0xD34F8FFE
Bot: Press Start
NTR: Send button command 0xFFE
NTR: Button command sent correctly
Bot: Press Yes
NTR: Send button command 0xFFE
NTR: Button command sent correctly
Bot: Test if the boxes are not shown
NTR: Read data at address 0x006A6132 during 10000 ms
NTR: Expected value 0x00004222 to 0x00004222
NTR: Read 0x4 bytes at address 0x006A6132
packet: cmd = 9, dataLen = 4
NTR: Read sucessful - 0x00004221
NTR: Value in range: No
NTR: Read 0x4 bytes at address 0x006A6132
packet: cmd = 9, dataLen = 4
NTR: Read sucessful - 0x00004222
NTR: Value in range: YES
Bot: Wait for trade
Bappsack commented 6 years ago

This also can be solved with another Offset for the WT Button, i have another Offset for that. The Trade Ready isnt really needed, This is what i use:

Begin Trade-> wait 30 Seconds, check Offset for WT Button, repeat if Offset Value doesnt match.

The current WT Button Offset returns also a 0x00 if a Trade Evolution comes, this might cause some Errors.

k20stitch commented 6 years ago

How can i dump memory addresses as certain offsets with NTR?

Bappsack commented 6 years ago

Ntr Plugins or Luma debugger

k20stitch notifications@github.com schrieb am Mo., 9. Apr. 2018, 22:54:

How can i dump memory addresses as certain offsets with NTR?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/drgoku282/PKMN-NTR/issues/159#issuecomment-379890787, or mute the thread https://github.com/notifications/unsubscribe-auth/AbaWP5FItR1mOWe0YhMZ-dLnn9fqYZRmks5tm8p4gaJpZM4TF0kd .

MarcTowler commented 6 years ago

is there any updates on this? Been having issues with SM and USUM... Fails after first pokemon @drgoku282

D35P4C1T0 commented 6 years ago

Do you mind sharing the 35 seconds build?