TheFunny / ArisuAutoSweeper

蔚蓝档案脚本 | Blue Archive Auto Script | WIP
GNU General Public License v3.0
205 stars 12 forks source link

Added lesson and minor improvements to mission and shop #15

Closed RedDeadDepresso closed 8 months ago

RedDeadDepresso commented 9 months ago

Hi, I implemented lesson using some of the code from another blue archive script, BAAH: https://github.com/sanmusen214/BAAH I've included the licenses so it shouldn't be a problem and from my testing it seems to work fine.

For mission:

For shop I corrected an error with the swipe logic.

Also, I tried to implement a way navigate the event page but strangely it fails to recognise the stages. For example, 08 is often mistaken for 00. I tried using the default stage_list but it doesn't work. I've also tried using a separate OCR_INDEX for event, but it still doesn't work. This is strange since it worked in BAAuto without any problem.

TheFunny commented 9 months ago

For the recognition of stage number, I've noticed that the error frequently occurs while in Global but seldom occurs in JP from my test. I'm also confused and I just choose to delete any result that equals to 00 because there doesn't exist ant stage 00 in game. The default stage_list class is designed for bounty and scrimmage but I have left the method to change the assets used for recognition. You can just create an instance of stage_list by giving other assets as arguments so it can be adapted for other modules.

RedDeadDepresso commented 9 months ago

This was my first approach, I created a new instance of StageList with OCR_INDEX replaced with a new one for Event but it didn't work.

I then tried changing the ocr model to zht and then zhs, having more success with zhs and being able to detect all stages of the event, mission and commissions. However, when trying to sweep 08, AAS says it is not sweepable when in fact it is. It's strange, it was able to detect that event 07 was sweepable and all stages of mission and commission I assigned. Any idea what the problem might be?

Screenshot_2024 01 02_21 19 24 013 2024-01-02_aas.txt

After some tests only 01, 02 and 07 are sweepable.

TheFunny commented 9 months ago

Maybe you can check the actual searching area. The list item in event is larger than that in bounty and scrimmage so you may have to substitute the asset of list item as well. And you can try to use a larger padding (I remember it's one parameter of function to select enter button). The two methods may help you with solving this problem.

RedDeadDepresso commented 9 months ago

Thanks, I added the event stage list assets and everything works.

RedDeadDepresso commented 9 months ago

Ok, looks like momotalk works great after I got rid of wait_until_stable and used a timer and this image to wait. However, I'm not sure how stable it would be on a low-end PC as the image appears for a few seconds.

Also, when will you be free? I tried to fix as many bugs as possible, but I might miss some and I'm not sure everything will work on JP. CHATTING

RedDeadDepresso commented 9 months ago

One more thing, can I add shutdown option when task queue is empty? I miss it a bit from BAAuto.

TheFunny commented 9 months ago

I plan to start working on the script after Jan 14th, from when I will have much more spare time. For adding the shutdown option, of course you can since that can be useful to many users.

RedDeadDepresso commented 9 months ago

Would using customtkinter cause problems when converting AAS to exe?

TheFunny commented 9 months ago

I have no idea and I haven't tried that yet. I've heard that this may cause problem so you may have to try that on your own for now.

RedDeadDepresso commented 9 months ago

I downloaded the release and modified the repository section in config/deploy.yaml to my dev branch. It seems to work fine since I added customtkinter to requirements.txt but if you find any problem we could just remove it and use tkinter messagebox which is part of the standard library.

RedDeadDepresso commented 9 months ago

Also, I added exit AAS, emulator and shutdown. Exiting AAS and emulator only works for Windows, while shut down works for Windows, Linux, and Mac OS. I tested and they also work well.

You can merge, but I recommend doing it when you are free so I can spend more time testing and fixing bugs.

TheFunny commented 9 months ago

OK. Thanks for the contribution.

RedDeadDepresso commented 8 months ago

Hi, I added Traditional Chinese since I already had some screenshots from BAAuto and from my tests it works well.

Only thing missing is momotalk as I ran out of students to interact with after testing EN and some popups except reward, affection, location. I won't be able to provide the popups because I don't know Chinese.

One strange thing I noticed is that tasks and campaigns have the same name in traditional Chinese. This gave some problems when using ui_ensure, so I used this image for tasks and it works fine. TASK_CHECK

RedDeadDepresso commented 8 months ago

Here a list of assets to add for JP:

For login:

For page:

For popup:

RedDeadDepresso commented 8 months ago

Also, I released the binaries for MCE Manager and Input Helper. You can find them here: https://github.com/RedDeadDepresso/MCE-Manager/releases/tag/v1.0.0 Just extract them and add them to ArisuAutoSweeper folder.

RedDeadDepresso commented 8 months ago

Hi, you can merge. I made sure that AAS could start from the login page and tried to implement random popup closing when using the ui_ensure and ui_goto.

If you have time you could make the following improvements:

TheFunny commented 8 months ago

Thanks for the contribution. One problem I found so far is that there doesn't exist a year in JP login and I have to find an alternative for that. I consider change the OCR_YEAR to version number at the top right. Anyway, I'll try to solve this.