tmarenko / mff_auto

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

Close all apps not working after updating nox :( #16

Closed DoTheDream closed 3 years ago

DoTheDream commented 3 years ago

It seems the bot can identify where it is but can't click it or something? Does it click it or use a keyboard function or something so that means the shortcut is wrong?

2020-12-24 21:10:44,913 - root - DEBUG - NoxPlayer1 None: found Close App shortcut at position 11 2020-12-24 21:10:44,914 - root - WARNING - NoxPlayer1 None: shortcut position is greater than 10, can't be casted via keyboard. Try to open NoxPlayer settings -> Interface settings and then change position of Close all apps toolbar and then restart the bot. 2020-12-24 21:10:44,914 - root - DEBUG - Initialized NoxWindow object with name NoxPlayer1 version 7.0.0.8 and resolution (1752, 986); main window: (2, 32, 1754, 1018), parent: (82, 10) 2020-12-24 21:10:44,915 - root - DEBUG - NoxPlayer1 7.0.0.8: found Close App shortcut at position 11 2020-12-24 21:10:44,916 - root - WARNING - NoxPlayer1 7.0.0.8: shortcut position is greater than 10, can't be casted via keyboard. Try to open NoxPlayer settings -> Interface settings and then change position of Close all apps toolbar and then restart the bot. 2020-12-24 21:10:50,730 - root - INFO - NoxPlayer1: saved config file clone_Nox_1_conf.ini. Need to restart emulator to apply changes. 2020-12-24 21:11:19,174 - main - DEBUG - Saving setting from first setup. 2020-12-24 21:11:19,194 - root - DEBUG - NoxPlayer1 None: found Close App shortcut at position 8 2020-12-24 21:11:19,195 - root - DEBUG - Initialized NoxWindow object with name NoxPlayer1 version 7.0.0.8 and resolution (1752, 986); main window: (2, 32, 1754, 1018), parent: (82, 10) 2020-12-24 21:11:19,199 - root - DEBUG - NoxPlayer1 7.0.0.8: found Close App shortcut at position 8

2020-12-24 21:12:13,946 - root - DEBUG - NoxPlayer1 7.0.0.8: found Close App shortcut at position 8 2020-12-24 21:13:09,253 - threading - ERROR - <class 'AttributeError'> 'NoneType' object has no attribute 'crop' File "C:\MFF\lib\gui\widgets\game_image.py", line 30, in update_image screen = self.player.get_screen_image() File "C:\MFF\lib\players\android_emulator.py", line 176, in get_screen_image screen = self._get_screen().crop(box)

2020-12-24 21:13:09,733 - root - DEBUG - NoxPlayer1 7.0.0.8: found Close App shortcut at position 11 2020-12-24 21:13:09,733 - root - WARNING - NoxPlayer1 7.0.0.8: shortcut position is greater than 10, can't be casted via keyboard. Try to open NoxPlayer settings -> Interface settings and then change position of Close all apps toolbar and then restart the bot. 2020-12-24 21:14:27,259 - single_task_manager - DEBUG - Task was forcibly stopped. 2020-12-24 21:14:27,261 - main - DEBUG - Game settings saved.

and after I click the "make nox restartable" it appears that the close all apps button is reset to position 11

tmarenko commented 3 years ago

Have you tried to make Nox restartable and then restart emulator and bot after? image

2020-12-24 21:12:13,946 - root - DEBUG - NoxPlayer1 7.0.0.8: found Close App shortcut at position 8

This line means that everything should be fine but I don't understand why after that shortcut position was changed back to 11. Maybe in new Nox's version they changed config file or made it readonly.

If it doesn't help then you can manually change shortcut position in Nox's settings: image find Order of toolbar and reposition a bit left (it becomes on keyboard shortcut) image

Currently I don't have much time to test new Nox (holidays) so if none of this worked for you then try to install previous Nox version.

DoTheDream commented 3 years ago

I edited my post as of what happens when i click the make restartable option, it resets to 11 but then again when I start the bot states that it has been found at 8

tmarenko commented 3 years ago

Probably a new behaviour with config file in new Nox then. Have you tried to change order manually in Nox's settings?

DoTheDream commented 3 years ago

Yes that's what I'm doing, I'm placing it at position 8 but the bot won't click it... I don't know if it matters but that white line around nox (I guess that's the bot reading the screen right?) goes all around the game window but not the entire nox window if you understand what I'm saying

tmarenko commented 3 years ago

white line around nox

Yeah that is screen reading. It should only see game/emulator without Nox's interface. Basically bot clicks a keyboard shortcut CTRL+number from 1 to 10 (if position = 1 then CTRL+0, if position = 10 then CTRL+9)

tmarenko commented 3 years ago

Well maybe they changed in new Nox that position = 1 now makes it CTRL+1 instead of old CTRL+0. I'll try to test new Nox as soon as possible.

DoTheDream commented 3 years ago

so at position 8 it should be clicking ctr+7 which is correct for my game, but it won't click it for some reason, that's very strange

DoTheDream commented 3 years ago

I can manually edit the shortcut keys so that wouldn't be an issue, and it's still ctrl+0 for the first shortcut

tmarenko commented 3 years ago

so at position 8 it should be clicking ctr+7 which is correct for my game

Okay so same behaviour as in old Nox.

but it won't click it for some reason

Was it working fine with Nox 6.x.x.x version?

DoTheDream commented 3 years ago

Yes it was working fine

tmarenko commented 3 years ago

OK. I'll try to test new Nox as soon as possible. Wait for a fix 🙂

DoTheDream commented 3 years ago

2020-12-24 22:02:48,206 - game - DEBUG - Closing game. 2020-12-24 22:02:50,144 - game - DEBUG - Starting game. 2020-12-24 22:02:54,391 - game - DEBUG - Game started successfully.

It even thinks it's working :D

DoTheDream commented 3 years ago

It just came to my mind that I'm using nova launcher on new nox so it won't change the position of the game with the free add stuff, could that be the case?

Edit: it's not cause keyboard shortcut works

tmarenko commented 3 years ago

I'm using nova launcher

I'm using MIUI launcher on one bot and default Nox launcher on another. No ads in Nox 6.3.0.5 for me so MFF app position is always the same.

The keyboard shortcut is need to close game first. Does it close?

DoTheDream commented 3 years ago

I mean that if I manually hit ctrl+7 then the game closes yes, but the bot won't do it although it thinks it did

edit: i switched to new one cause I had way too many crushes with 6.3 I also debloated the new one so it's good now

tmarenko commented 3 years ago

Keyboard shortcut fixed in a26032b3512f4b1a28f5fb47ea7fab42477752e1

The Make NoxPlayer restartable button was removed because Nox 7 is rewriting config file itself after any changes. For Nox 7 you should change order of Close all apps manually.

DoTheDream commented 3 years ago

It is working now after the update 👍