Egoistically / ALAuto

Azur Lane bot based on azurlane-auto. Discord: https://discord.gg/vCFxDen.
Do What The F*ck You Want To Public License
106 stars 43 forks source link

Color screen, raw screencap and improved dorm refilling #129

Closed asd111333 closed 4 years ago

asd111333 commented 4 years ago
  1. add support for screencap raw mode
  2. improve dorm refilling
  3. extend Utils.find and Utils.find_and_touch with color screen
  4. Utils.update_screen now stores a copy of color screen
  5. add screen and color screen as class variable of Utils
  6. add Utils.get_region_color_average
hjk22 commented 4 years ago

Thank you! Now the refilling function is actually useful! I still haven't tested your changes though: after I'm done with that, I will update you!

hjk22 commented 4 years ago

I found out that get_region_color_average works only with numpy version >= 1.18.0, since in the previous versions numpy.expand_dims' axis parameter didn't accept tuples but only ints. Anyway, after updating the library there weren't problems, so we'll just need to specify that in the requirements.

As for the supplies used to refill the bar, it would be nice if you could specify which ones can be used from the configuration file's settings. I don't know if you want to implement that too, but it would be great if you did.

asd111333 commented 4 years ago

I am willing to do it, but I need sometime to understand how the configuration parser works.

hjk22 commented 4 years ago

I read your changes and the option you provided in the configuration file was what I wanted, so good job! If I had to nitpick, I would say it would have been better using commas as separator for the values instead of a space, but that's my opinion.

I saw that you have also updated the dependencies in requirements.txt, and while there's no problem updating scipy, I'm not sure about opencv. I know that the function findContours has been slightly changed from v3, where it returned three values instead of two in v4. Do you know if other functions have been changed (or at least the ones used in ALAuto)? Have you been running the bot with opencv4?

asd111333 commented 4 years ago

I haven't tested it with the combat module. But it should work fine with the other modules.

hjk22 commented 4 years ago

I know for sure that find_siren_elites will need to be updated, but using grab_contours from imutils is enough to fix it. As for the rest, I'll run some tests later.

hjk22 commented 4 years ago

I found no problems with updating the dependencies, so I think we can proceed with your changes. Would you mind doing a rebase and resolve the conflicts?

asd111333 commented 4 years ago

Updated. Please test it again. It also includes adding Screenshot mode in config.ini.

hjk22 commented 4 years ago

Good work! Thank you very much!