mrmin123 / kancolle-auto

Kantai Collection (Kancolle) bot/automation tool - DEPERECATED - see kcauto-kai:
https://github.com/mrmin123/kcauto-kai
54 stars 22 forks source link

Help with modifying the script #139

Closed Aftersky closed 8 years ago

Aftersky commented 8 years ago

I find the wait time for certain actions like clicking on combat start button is a bit too long (30-45s) or compass spinning (10-15s) even with SleepCycle set to 0. Also, when a sortie is cancelled due to low fatigue, next sortie time is set to ~10 mins after when the fleet typically only need ~5 mins to recover.

Which part of the script can I modify to lower these timer? I tried looking into combat.py but there is no obvious line with such values to change.

Thanks!

mrmin123 commented 8 years ago

Hey @Aftersky what you want to do is remove the is the sleep(2) in the loop_pre_combat() and loop_post_formation() methods in combat.py. I am going to remove these sleeps in the next release.

That said, even with the removal of the sleeps you'll find the performance to be still a bit slow. Each loop checks for the presence of the compass, node select(s) (if relevant), formation, retreat image, next button, alternative next button, and catbomb. That's a lot of images to check for.

mrmin123 commented 8 years ago

Also, the delay on the combat start button is due to checking for damage states and/or morale. If you want to risk the possibility of sortieing with critically damaged ships, you can remove the self.tally_damages(add) line in the pre_sortie_check() method, also in the Combat module. Also set morale check to False in the config.

Aftersky commented 8 years ago

@mrmin123 Thanks. What about the next_sortie_time after the sortie is cancelled? And would you mind explaining wait_and_click(self.kc_window, 'next.png', 30, expand_areas('next')) Does 30 represent timeout? it seems too long to be in second and too short to be millisecond though. I want to change all of them to make the script faster at the risk of instability.

Also unrelated, does the computer processor performance directly translate to how fast the script is able to identify what's going on the screen or is there some kind of hard limitation with sikuli?

mrmin123 commented 8 years ago

@Aftersky The wait_and_click() function operates by checking for the image in the specified region for the specified amount of time (30 seconds in this case) before throwing a FindFailed. 30 represents timeout in the sense that it'll look for next.png for 30 seconds before deciding that the script cannot continue. It'll actually click the moment it finds the image.

And yes, I don't know the specifics, but CPU and RAM does directly influence how fast the script can ID image matches. This has been alluded to in multiple posts by the Sikuli maintainer.