tmarenko / mff_auto

Game bot for Marvel Future Fight game.
Apache License 2.0
26 stars 15 forks source link

Setup is not recognizing Nox Player latest Version (7.0.1.1 and above) #28

Open geekoutar opened 3 years ago

geekoutar commented 3 years ago

I've updaed NOX yesterday and now the the aplication is not recognizing the player.

Attached a screenshot. 2021-05-26_19-45-28

geekoutar commented 3 years ago

i've tryed executing as administrator and it didn't fix the issue.

tmarenko commented 3 years ago

Please edit your screenshot and hide your in-game username (or remove it entirely). Your profile could be banned by devs if they somehow end up here. Currently I'm using NoxPlayer 7.0.1.0 so I'll try look into new version soon.

geekoutar commented 3 years ago

Please edit your screenshot and hide your in-game username (or remove it entirely). Your profile could be banned by devs if they somehow end up here. Currently I'm using NoxPlayer 7.0.1.0 so I'll try look into new version soon.

Thanks!!

tmarenko commented 3 years ago

Fixed in https://github.com/tmarenko/mff_auto/commit/6c43146eef5e3413a226bb013870343219a9e7a1 I'm not planning to make a new release on this week so if you want to use new version of NoxPlayer then apply changes from https://github.com/tmarenko/mff_auto/commit/6c43146eef5e3413a226bb013870343219a9e7a1 manually.

geekoutar commented 3 years ago

It recognizes NOX but clicks arent passing through the app to the emulator.

tmarenko commented 3 years ago

This should fix it: https://github.com/tmarenko/mff_auto/commit/271001a17b0540cca03da9e20df4fc32cdb1c52e Still I've encountered another problem on 7.0.1.1 version that key handle window is missing. NoxPlayer's devs restructured window's handles in 7.0.1.1 apparently so all HWNDs are changed. I managed to found main HWND (for clicks) but have no luck with HWND for keyboard interaction. I'll kook into it again later.

dbzdivik commented 3 years ago

++ any luck still with Update ?

tmarenko commented 3 years ago

No. I haven't tested new versions (7.0.1.2 and 7.0.1.3) because I don't have much time for this project right now but as far I can tell in 7.0.1.1 there is not distinct way to determine HWND for keyboard intercation.

tmarenko commented 3 years ago

Another way is force-closing MFF application via adb bridge: https://support.bluestacks.com/hc/en-us/articles/360053245871-Settings-menu-on-BlueStacks-5#%E2%80%9C6%E2%80%9D https://www.bignox.com/blog/how-to-connect-android-studio-with-nox-app-player-for-android-development-and-debug/ adb shell am force-stop com.netmarble.mherosgb

But this would require to implement enabling the debug bridge for each emulator and support for multiple Android instances within emulator.

I'm looking forward for Windows 11's feature for installing Android apps into the system without any additional emulators. That would be a great opportunity to skip support for Nox/BlueStack and do work just within OS itself.

For now NoxPlayer's version will be restricted up to 7.0.1.0: https://github.com/tmarenko/mff_auto/commit/fbcfd128de26c9dd8716e0af26f0f5db916714ce

geniusdragon commented 3 years ago

Does this mean it won't be updated in the future at some point to support newer versions? I had to update my Nox to support 64bit and it's updated to 7.0.1.6 - which means it's now not detected.

tmarenko commented 3 years ago

Eventually it will be updated for newer versions. Windows 11 should be released at October this year. I'll check it's features and I'll release either an update with Windows 11 support or an update with Android Debug Bridge support

geniusdragon commented 3 years ago

I apologise for bringing this up again - I've recently uninstalled nox (as it upgraded to the latest version when I went to install the 64bit version separately), and reinstalled the 7.0.1.0 version, however after rerunning the setup numerous times, the bot still doesn't pick up nox. I'm running bluestacks for the first time purely to be able to run this at the moment, but I'd rather use nox. I uninstalled the latest version, reinstalled the last supported version, and removed the game.json file to reset the setup. Is there anything I may have missed?

tmarenko commented 3 years ago

For those who insterested and willing to test, I've started to adding ADB support at this branch: https://github.com/tmarenko/mff_auto/tree/adb_test

UPD Last build: https://github.com/tmarenko/mff_auto/actions/runs/1351630429

For NoxPlayer you simply need to use this menu:

image Result of setup will be seen in log file:

image

After that just restart bot and ADB should connect itself automatically.

For BlueStacks you need to enable ADB in Settings:

image

and manually copy your device's serial (eg 127.0.0.1:5555 from screenshot) to game.json file:

image

Just in case, close other emulators except the one with MFF installed before doing this.

Basically now you can restart game in any of the emulators (Nox or BlueStacks), touch and swipes are doing over ADB directly. Only screen capturing still using DirectX so bot is still sensetive to emulator's screen resolution.

tmarenko commented 3 years ago

Is there anything I may have missed?

Does it say in the log file that it's right version? Initialized NoxPlayer object with name NoxPlayer version 7.0.1.0? Nox has different behaviour for handles since 7.0.1.1. The version is parsed from Nox.exe: image

geniusdragon commented 3 years ago

For those who insterested and willing to test, I've started to adding ADB support at this branch: https://github.com/tmarenko/mff_auto/tree/adb_test

I've set up a 7.0.1.6 version of Nox to test this, mine doesn't get past starting up the daemon.

2021-10-19 00:23:01,803 - INFO - updater - Loaded version: mff_auto=0.9.2, game=7.5.0, updater=1.1.0
2021-10-19 00:23:02,393 - WARNING - updater - Updates were suspended.
2021-10-19 00:23:04,760 - DEBUG - root - Creating 1 Tesseract API(s) with 'eng' language.
2021-10-19 00:23:05,081 - DEBUG - root - Creating 1 Tesseract API(s) with 'mff+eng' language.
2021-10-19 00:23:06,796 - DEBUG - android_emulator - Initialized NoxPlayer object with name NoxPlayerMain version 7.0.1.6 and resolution (1733, 975); main window: (3, 32, 1736, 1007), parent: (80, 12);
2021-10-19 00:23:14,204 - DEBUG - main - Saving setting from first setup.
2021-10-19 00:23:14,220 - DEBUG - android_emulator - Initialized NoxPlayer object with name NoxPlayerMain version 7.0.1.6 and resolution (1733, 975); main window: (3, 32, 1736, 1007), parent: (80, 12);
2021-10-19 00:23:18,104 - INFO - android_emulator - b''
2021-10-19 00:23:23,136 - INFO - android_emulator - b'* daemon not running. starting it now on port 5037 *\r\n* daemon started successfully *\r\n'
geniusdragon commented 3 years ago

Is there anything I may have missed?

Does it say in the log file that it's right version? Initialized NoxPlayer object with name NoxPlayer version 7.0.1.0? Nox has different behaviour for handles since 7.0.1.1. The version is parsed from Nox.exe: image

It never shows the emulator window in the setup, so I can't select it for it to load. Looking at the details, the file information is the same as the picture you've shown.

tmarenko commented 3 years ago

It never shows the emulator window in the setup, so I can't select it for it to load. Looking at the details, the file information is the same as the picture you've shown.

Something probably wrong with structure on Nox's windows. Try WinSpy tool (https://sourceforge.net/projects/winspyex) at Nox's window, tree strtucture should look like this: image

I've set up a 7.0.1.6 version of Nox to test this, mine doesn't get past starting up the daemon.

ADB daemon started (daemon started successfully) but after that it should show something like: INFO - main - Found device over ADB with installed game: 127.0.0.1:62001 I think the problem is either ADB isn't seeing emulator or can't find MFF installed. I've added more logging to understand what's happening. Aplly commit (https://github.com/tmarenko/mff_auto/commit/ab05492d7fab2d0544f2d7122d01cfeb6b863445) or download new build (https://github.com/tmarenko/mff_auto/actions/runs/1354963531) and try to setup ADB connection again.

geniusdragon commented 3 years ago

In the log, you'll see the first time I tried, which was with nox sitting on the main home screen of the emulator. The second was with MFF loaded up (just in case it needed to be).

2021-10-19 01:18:00,812 - INFO - updater - Loaded version: mff_auto=0.9.2, game=7.5.0, updater=1.1.0
2021-10-19 01:18:01,424 - WARNING - updater - Updates were suspended.
2021-10-19 01:18:03,760 - DEBUG - root - Creating 1 Tesseract API(s) with 'eng' language.
2021-10-19 01:18:03,969 - DEBUG - root - Creating 1 Tesseract API(s) with 'mff+eng' language.
2021-10-19 01:18:05,704 - DEBUG - android_emulator - Initialized NoxPlayer object with name NoxPlayerMain version 7.0.1.6 and resolution (1733, 975); main window: (3, 32, 1736, 1007), parent: (80, 12);
2021-10-19 01:18:07,952 - DEBUG - main - Saving setting from first setup.
2021-10-19 01:18:07,966 - DEBUG - android_emulator - Initialized NoxPlayer object with name NoxPlayerMain version 7.0.1.6 and resolution (1733, 975); main window: (3, 32, 1736, 1007), parent: (80, 12);
2021-10-19 01:18:11,416 - DEBUG - android_emulator - Restarting ADB server by path: C:\Program Files (x86)\Nox\bin\nox_adb.exe
2021-10-19 01:18:11,432 - INFO - android_emulator - b''
2021-10-19 01:18:16,461 - INFO - android_emulator - b'* daemon not running. starting it now on port 5037 *\r\n* daemon started successfully *\r\n'
2021-10-19 01:18:16,461 - DEBUG - android_emulator - Found devices over ADB: []
2021-10-19 01:18:16,461 - ERROR - main - Can't find device over ADB with installed Marvel Future Fight.
2021-10-19 01:18:53,070 - DEBUG - android_emulator - Restarting ADB server by path: C:\Program Files (x86)\Nox\bin\nox_adb.exe
2021-10-19 01:18:53,087 - INFO - android_emulator - b''
2021-10-19 01:18:58,125 - INFO - android_emulator - b'* daemon not running. starting it now on port 5037 *\r\n* daemon started successfully *\r\n'
2021-10-19 01:18:58,126 - DEBUG - android_emulator - Found devices over ADB: []
2021-10-19 01:18:58,126 - ERROR - main - Can't find device over ADB with installed Marvel Future Fight.

Same result of course.

tmarenko commented 3 years ago

2021-10-19 01:18:16,461 - DEBUG - android_emulator - Found devices over ADB: []

For some reason no device was found. Usually Nox connects automatically every emulator:

image

UPD: I've tried 7.0.1.6 and it seems it has problems with ADB. You probably will have better luck with BlueStacks because device's serial can be seen right in the settings.

geniusdragon commented 3 years ago

Bluestacks was successful and is working quite well :)

FDC18 commented 3 years ago

Another way is force-closing MFF application via adb bridge: https://support.bluestacks.com/hc/en-us/articles/360053245871-Settings-menu-on-BlueStacks-5#%E2%80%9C6%E2%80%9D https://www.bignox.com/blog/how-to-connect-android-studio-with-nox-app-player-for-android-development-and-debug/ adb shell am force-stop com.netmarble.mherosgb

But this would require to implement enabling the debug bridge for each emulator and support for multiple Android instances within emulator.

I'm looking forward for Windows 11's feature for installing Android apps into the system without any additional emulators. That would be a great opportunity to skip support for Nox/BlueStack and do work just within OS itself.

For now NoxPlayer's version will be restricted up to 7.0.1.0: fbcfd12

Windows 11 now supports android app sideloading via WSA https://www.notebookcheck.net/Tutorial-Get-started-with-the-Android-Subsystem-on-Windows-11-Sideload-APKs-and-even-enable-Google-Play-Services.574829.0.html

KnightM1 commented 2 years ago

2021-10-19 01:18:16,461 - DEBUG - android_emulator - Found devices over ADB: []

For some reason no device was found. Usually Nox connects automatically every emulator:

image

UPD: I've tried 7.0.1.6 and it seems it has problems with ADB. You probably will have better luck with BlueStacks because device's serial can be seen right in the settings.

Есть новые версии с использованием ADB что бы юзать новый нокс?