tmarenko / mff_auto

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

Setup window appears, and not recognize the emulator #20

Closed noramann closed 3 years ago

tmarenko commented 3 years ago

Any log files or additional information?

noramann commented 3 years ago

This is the last log, i only open start.bat -> Setup and open Nox, but nothing happens, the emulator doesn't appear on Setup. debug_2021-03-22--08-53-01.log Warning

tmarenko commented 3 years ago

Try to remove this file: settings\gui\game.json and run start.bat again. If it fails then send me new log from that setup.

noramann commented 3 years ago

debug_2021-03-22--09-02-39.log

tmarenko commented 3 years ago

I think one of the reason why this happens: not enough OS permissions to get emulator's process here: https://github.com/tmarenko/mff_auto/blob/f21743da7fb02a41972a4b2bfbdfa41bef07eed0/lib/gui/widgets/setup_player.py#L95

Did you try to run start.bat as Administrator?

If it doesn't help you can try to create game.json manually. Structure of game.json file for NoxPlayer: { "timeline_team": 1, "mission_team": 1, "acquire_heroic_quest_rewards": true, "player_name": "NoxPlayer", "player_type": "NoxWindow", "game_app_rect": null } Replace NoxPlayer with your Nox's name from here: image

then put this game.json file into settings\gui folder and try to run the bot. The downside of this method is that you will have empty game_app_rect (because bot calculates it dynamicly in setup) so no restart game/farm bios options for you.

noramann commented 3 years ago

When i try to run as administrator, start.bat closes in miliseconds.

noramann commented 3 years ago

image

tmarenko commented 3 years ago

Did you start the emulator before starting the bot?

noramann commented 3 years ago

Nope

On Mon, 22 Mar 2021, 12:11 Timofey Marenko, @.***> wrote:

Did you start the emulator before starting the bot?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tmarenko/mff_auto/issues/20#issuecomment-804014849, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATK47MAF3ZPXZHFKQNCO5U3TE4XW5ANCNFSM4ZSBSZ6Q .

tmarenko commented 3 years ago

Nope

You should start NoxPlayer and the start the bot. Bot can't get any information from Nox Player for set up because NoxPlayer needs to be running for this.

tmarenko commented 3 years ago

image

You will see your running NoxPlayer then: image

noramann commented 3 years ago

Nothing happens, i downloaded it again and started after having the nox open, I even tried with the bluestacks.

tmarenko commented 3 years ago

Nothing happens, i downloaded it again and started after having the nox open, I even tried with the bluestacks.

You can simply delete settings\gui\game.json to start Setup again, don't need to redownload all files again.

Well, maybe the other reason why this happens is something went wrong with getting key handle from Nox. You can test by editing this file lib\players\android_emulator.py at 154 line here: https://github.com/tmarenko/mff_auto/blob/f21743da7fb02a41972a4b2bfbdfa41bef07eed0/lib/players/android_emulator.py#L154 Replace this with keys_found = True (make sure to keep spaces at the start of the line same) and run Setup again.

Also, what's your OS, OS language and NoxPlayer version?

noramann commented 3 years ago

Putting keys_found = True worked, thanks

tmarenko commented 3 years ago

Putting keys_found = True worked, thanks

Well it's not a real fix because now bot doesn't know how to send keystrokes into emulator now (i.e. you can't use "restart game" function). If you still need ability to restart game, please tell about OS and NoxPlayer version. I'll try to test them myself sometimes later.

noramann commented 3 years ago

Windows 10 and Nox Version 7.0.1.0

tmarenko commented 3 years ago

I couldn't reproduce this issue with brand new Windows 10 Home Edition and NoxPlayer. With clean setup NoxPlayer always has Qt5QWindowToolSaveBits handler for keys. If you will found anything new or related to this issue then reopen it.