TheFunny / ArisuAutoSweeper

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

Added Mission/Commissions/Event #13

Closed RedDeadDepresso closed 6 months ago

RedDeadDepresso commented 6 months ago

I tested for some time and everything works fine. I'll briefly explain how it works:

  1. Read config from MCE/config.json and load the queue
  2. Update the dashboard
  3. For each stage calculate the "realistic count" ie the number of sweeps possible based on the current ap
  4. Sweep the stage for the realistic count
  5. Save the difference between realistic count and the number of sweep wanted by the user. If the difference is 0 remove the stage from the queue.
  6. Keep doing this until realistic count is 0. Recharge AP if enabled and repeat the process again. Otherwise terminate Mission.

Also, I tried to use the functions write_file and read_file from module/config/config.py but they don't work. I think I add enough error handling so it shouldn't be a problem.

Changes made:

  1. Created mission_list.py, a version of task/stage/stage_list.py but with a shorter swipe range, use string comparison instead of integer and regex that also matches stages where the last character is a capital letter for example 3-A. All these changes were made because of Mission.

Optional Optimisations : This is not necessary but would be nice,

TODO:

RedDeadDepresso commented 6 months ago

This is the latest fork of dev with Mission/Commissions/Event and with the updated assets of tactical challenge from the master branch. You don't need to worry about file conflicts.

TheFunny commented 6 months ago

Thanks for the contribution! For generating MCE config, I don't know where to put the code in AAS either. Maybe just let MCE generate the config itself because user have to open that first if they want to use the mission function? I consider this as a temporary solution and the ultimate solution is to implement mission option in AAS gui (I'll try when I'm free).

RedDeadDepresso commented 6 months ago

Done

RedDeadDepresso commented 6 months ago

What is the maximum number of sweeps possible before triggering too many click exceptions? I can set the limit in MCE Manager.

RedDeadDepresso commented 6 months ago

What do you think about this solution to close random popup in main? From my tests it seems to work. This could also work for random popups when entering the game, maybe you could keep pressing the emulator back button until main after Menu button disappears? It will just show option is not available and it won't trigger too many click exceptions since you are not clicking on the screen.

Also, I discovered why Tasks wasn't working for EN. It was because CLAIMED button was different.

TheFunny commented 6 months ago

What is the maximum number of sweeps possible before triggering too many click exceptions? I can set the limit in MCE Manager.

The limit of clicks can be bypassed if you use the function to clean the count of clicks (I've used that in the cafe module when tapping students), but make sure to set another limit such as timeout.

What do you think about this solution to close random popup in main? From my tests it seems to work. This could also work for random popups when entering the game, maybe you could keep pressing the emulator back button until main after Menu button disappears? It will just show option is not available and it won't trigger too many click exceptions since you are not clicking on the screen.

Also, I discovered why Tasks wasn't working for EN. It was because CLAIMED button was different.

That is actually a feasible solution to solve the popups in Global server. I can complete that in the login process later. For claimed button, I just found that the already claimed one and the not claimed one are different from each other, but I haven't got time to fix that. Anyway, thanks for solving this.

RedDeadDepresso commented 6 months ago

Hi, I think you can merge.

For sweeps I would prefer if you could do it yourself since you wrote it and I'm more likely to make mistakes.

The shop seems to work well in Global, just make sure to test it in JP.

At this point, all you have to do is fix momotalk, improve login and sweep for the mission and add ui_ensure for event. If you have any problems with MCE Manager I can try to fix it.

RedDeadDepresso commented 6 months ago

Ok, this is the final fix for task. The claim button has two states: CLAIMED when you have not completed the 9 daily tasks and COMPLETE after you completed them.

TheFunny commented 6 months ago

Thanks. I'll check the functions for JP when I have time.