XVs32 / kcauto_custom

kcauto_custom, the successor to kcauto, a Kantai Collection (Kancolle) bot / automation tool
https://xvs32.github.io/kcauto_custom/
GNU General Public License v3.0
8 stars 2 forks source link

Heavy damage not being detected for bucket usage #96

Open Danielosama opened 6 months ago

Danielosama commented 6 months ago

Environment details

Issue variability

Intermittent

Issue

KC Auto seems to be unable to detect Heavy Damage when selecting a bucekt for repairs.

It can see 2 ships heavily damaged (see below), but for some reason the "repair time" for I504 is 0d0h0m (so no bucket used) even though it clearly isn't the case.

Log

[2024-03-10 17:56:10] Fleet 1 has ships with Heavy damage or above.
[2024-03-10 17:56:10] Retreating from sortie.
[2024-03-10 17:56:18] sortie handle end
[2024-03-10 17:56:18] Next sortie at 2024-03-10 17:56:18
[2024-03-10 17:56:18] Sortie queue updated:[]
[2024-03-10 17:56:19] Finding kancolle.
[2024-03-10 17:56:21] At home
[2024-03-10 17:56:21] Navigating to repair screen.
[2024-03-10 17:56:37] Selecting lvl180 伊504 (pg1#0).
[2024-03-10 17:56:40] Ship repair time of 0d 0h 0m 0s.
[2024-03-10 17:56:49] Selecting lvl147 伊201 改 (pg1#1).
[2024-03-10 17:56:52] Ship repair time of 0d 1h 15m 5s.
[2024-03-10 17:56:52] Using bucket to repair.
[2024-03-10 17:57:02] At side menu
[2024-03-10 17:57:02] Going home.
[2024-03-10 17:57:11] kcauto has been running for 0d 1h 19m 42s (loop 139).
[2024-03-10 17:57:11] Next sortie at 2024-03-10 17:56:18 / 132 sorties (5.21/hr) / 650 nodes fought (25.66/hr) / 0 ships rescued (0.00/hr)
[2024-03-10 17:57:11] 60 Expeditions sent (2.37/hr) / 57 Expeditions received (2.25/hr)
[2024-03-10 17:57:11] Fleet 1 / Minor fleet damage / Heavy Fatigue
[2024-03-10 17:57:11] Fleet 2 / On expedition / Returning at 2024-03-10 17:56:43
[2024-03-10 17:57:11] Fleet 3 / On expedition / Returning at 2024-03-10 18:58:49
[2024-03-10 17:57:11] Fleet 4 / On expedition / Returning at 2024-03-10 18:02:21
[2024-03-10 17:57:11] 138 resupplies done (5.45/hr) / 54 provisional resupplies done (2.13/hr)
[2024-03-10 17:57:11] 7 repairs done (0.28/hr) / 5 buckets used (0.20/hr)
[2024-03-10 17:57:11] Active Scheduler rules:
[2024-03-10 17:57:11] - Sleep kcauto for ~00:46. at 2024-03-10 21:28:37
[2024-03-10 17:57:11] - Sleep kcauto for ~05:52. at 2024-03-11 07:00:43
[2024-03-10 17:57:11] Fuel:142602 (Δ9527 : 376.14/hr) / Ammo:267784 (Δ-177 : -6.99/hr) / Steel:296157 (Δ2499 : 98.66/hr) / Bauxite:347480 (Δ9323 : 368.09/hr) / Bucket:944 (Δ13 : 0.51/hr)
[2024-03-10 17:57:31] Fleet 2 has returned!
[2024-03-10 17:57:31] Finding kancolle.
[2024-03-10 17:57:33] At home
[2024-03-10 17:57:33] Refreshing home.
[2024-03-10 17:57:52] At home
[2024-03-10 17:57:52] Refreshing home.
[2024-03-10 17:58:07] Set sortie queue ['7-4']
[2024-03-10 17:58:07] Combat fleet is under repair.
[2024-03-10 17:58:07] Next sortie at 2024-03-10 20:25:14

image

XVs32 commented 6 months ago

Interesting.... This looks like an api/network issue to me, 0d0h0m shows that kcauto wasn't able to fetch the repair time for I-504,

  1. Is this happening every time?
  2. I can see kcauto was able to fetch the repair time for I-201 (1h 15m 5s), was that the correct repair time for I-201?
Danielosama commented 6 months ago

1) no, it's very sporadic

2) yes, that was the correct repair time for I-201

XVs32 commented 6 months ago

I see, I will dig deeper into source code to see if I can find anything wrong This will probably have to wait for a while till I can reproduce the situation or figure out something

Thank you for the report

Danielosama commented 6 months ago

FYI, adding a 2sec delay (SLEEP_MODIFIER) to all of KCAuto's actions has seemingly fixed this issue.

I reckon sometimes a random lag spike would cause the reported issue.

Still, it's strange because my internet connection is cabled and very stable, and this never happened (as far as I recall) with KCAuto Kai.

I'll keep an eye out in case it comes back.