-
Notifications
You must be signed in to change notification settings - Fork 22
Conversation
Also added return statement if docks are full, since the code below shouldn't be executing anyways. Without it the next sortie time tends to reset to 0 if sub switching is enabled even if their are still subs to be repaired. Causing a loop.
When orel cruising and enabling sub switching, Kancolle Auto uses the last repaired ship repair time as the next sortie schedule even when there might possibly another sub with a shorter repair time. So time is wasted even though it could have used switched into the sub that repaired quicker. I've added a few lines to set the next sortie time to the quickest repair if sub switching is enabled. Also added crashes folder to gitignore |
Sorry I'm getting so long to getting this PR in. Been pretty busy recently. I'll hopefully be able to take a look over the weekend. |
Take your time. Meanwhile I've removed the return statement in the last commit so it attempts to switch subs even if port is full. The loop was caused by 1. no subs were repairing because ports were full 2. you only checked for a repair pattern when in fleetcomp screen. So when it went to fleetcomp screen it just returned True because it didn't find any ships in repair. I've made it scan all the possible damage states, and switch those subs out. A slight improvement? might be to skip any damage state above the repair limit, but its always nice to switch and repair subs any time even if its only scratch damage to recover morale. With that said, the next step is to try repairing damaged subs before every sortie, the script doesn't track the switched out subs that are damaged but not repairing. |
Instead of after seeing there are no slots to repair. Script will loop if there is a ship in fleet under repair, but there is still an empty slot. Timer doesn't get set unless port is full
A couple of things:
This would actually solve a potential issue with your additional 'Set fatest repair time (which might be a sub)' block, which does not sort the
Please remember kancolle-auto isn't designed to only do orel cruising, so outlier behavior for other scenarios and use cases must be accounted for. |
I still think instead of map based scan_list, it's safe to just use the submarine switch conditional to determine it. And I believe the I'll test moving the I've been testing out these modifications for the last few days, and it's been a much better experience in terms of reliability and consistency overall. And on a side note, just wondering why you decided to go the Jython route instead of just using Java, my current experience right now trying to patch stuff here and there is horrible with the dynamic typing of python lol, even with the wonderful autocomplete of IntelliJ+Python plugin |
It wouldn't work based off of the submarine switch flag because the user might be using it on something like 3-2A or 5-4A where a bait submarine is used. You wouldn't want to look through the other damaged ships in this context. I guess that looping behavior is the result of calling It should be It's great that your modifications are more consistent, but if you're not already taking it into account when you're putting the logic together, you should be testing it for all cases where the combat and repair modules might be used, not just Orel which seems to be what your modifications seem to mostly target. I personally don't even run Orel anymore so much of these improvements, while I am thankful for them, do not effect me. On the contrary, it actually makes things worse for my use cases (see para 1). I went with Python because I've been coding in it professionally for many many years. I have no issues with it (I would argue that it's my favorite language) and I don't even use an IDE with autocomplete :) Although it certainly helps that I wrote 99% of the codebase. |
Well actually I've been testing it for orel cruising, 3-2 and 1-5 leveling and well sure it might be checking other ships status too, at most it just wastes a little bit of extra time on that case since the script itself checks if the ship is a sub or not...safely ignoring other ships.
As for that one case, I'm thinking after checking the repair screen, it switches to the fleet comp screen to double check first fleet condition. Again might use a few more seconds but is much more fool-proof. And well since it's almost finished anyways, might as well wait and let it run its course before running the script.
The looping existed before the patches, so I don't think that's the case. OTOH python is pure evil in terms of collaboration of then, I have to keep on jumping to declarations/following the script and stuff just to find what type a variable is, can't work on a section of code in peace |
Regarding Python: you are entitled to your opinions. Thanks for the PR. |
Just some more enhancements after studying the code of kancolle auto
Also added return statement if docks are full, since the code below
shouldn't be executing anyways. Without it the next sortie time tends
to reset to 0 if sub switching is enabled even if their are still subs
to be repaired. Causing a loop.
It starts the next sortie immediately, sees that a sub needs repair, goes to repair screen to find out that there are repairs still goes on, then goes trying to sub switch again which resets the wait time. Rinse and repeat.
Example log: