Closed waicool20 closed 7 years ago
@waicool20 the second error (combat_area_3.png FindFailed) can usually be attributed to a lag in the display (took more than 5 seconds for the server to respond) or a Sikuli match failure. If it's the former, I guess I could raise the default wait time to something like 10 seconds (I'll actually go ahead and do that), but if it's the latter, there isn't much I can do.
Oops, hit enter before I was done typing:
The first error is a bit weird... that bit of code only triggers if the repair ports are all full. If it is, it looks to look at the sorted repair_timers
list and gets the first (shortest) timer value to figure out when to check back. Oddly enough, the repair_timers
list is empty, which is why we're getting the error, but also implies that nothing got repaired. I'd need more information on this, like whether or not the ports were actually full, and if they were, if they were filled manually...
Probably not filled manually, since I actually left KAGA running for a while and restarting Kancolle Auto as needed to "farm" these tracebacks.
Port was probably not full, the script usually rotates between 2/3 subs, and one of them is usually done repairing by the time the current one is damaged.
Can't you just check if the size or repair_timers is larger than 1 before running that code?
I'd rather nail down the source of the behavior than add a workaround to make the script not crash when it should, especially when I'm not certain of the cause of the error since depending on the cause it might have unintended consequences further down the line. Doing a bit more digging right now.
Upon further analysis of the logs I've concluded that the crashes are due to all repair ports being full, and the code for recognizing and interpreting the timers for pre-existing repairs not working properly. In the below log snippets you can see that the 'repair should be done' times are after the time of crash:
[2017-01-23 18:46:29] Available docks: 2; repair queue: 1
...
[2017-01-23 18:46:37] Got valid timer (00:17:35)!
[2017-01-23 18:46:37] Repair should be done at 2017-01-23 19:02:37
...
...
...
[2017-01-23 18:56:40] Available docks: 1; repair queue: 1
...
[2017-01-23 18:56:48] Got valid timer (00:15:22)!
[2017-01-23 18:56:48] Repair should be done at 2017-01-23 19:10:48
...
...
...
[2017-01-23 19:02:39] Navigating to repair screen with 0 sidestep(s)!
[log] CLICK on L(187,417)@S(0)[0,0 1920x1080] (521 msec)
[error] script [ /home/waicool20/bin/kancolle-auto/kancolle_auto.sikuli ] stopped with error in line 524
[error] IndexError ( index out of range: 0 )
[2017-01-23 21:02:00] Available docks: 2; repair queue: 1
...
[2017-01-23 21:02:07] Got valid timer (00:25:00)!
[2017-01-23 21:02:07] Repair should be done at 2017-01-23 21:26:07
...
...
...
[2017-01-23 21:14:50] Available docks: 1; repair queue: 1
...
[2017-01-23 21:14:58] Got valid timer (00:15:40)!
[2017-01-23 21:14:58] Repair should be done at 2017-01-23 21:28:58
...
...
...
[2017-01-23 21:23:13] Navigating to repair screen with 0 sidestep(s)!
[log] CLICK on L(226,471)@S(0)[0,0 1920x1080] (521 msec)
[error] script [ /home/waicool20/bin/kancolle-auto/kancolle_auto.sikuli ] stopped with error in line 524
[error] IndexError ( index out of range: 0 )
[error] --- Traceback --- error source first
[2017-01-23 22:15:00] Available docks: 2; repair queue: 1
...
[2017-01-23 22:15:11] Got valid timer (00:19:15)!
[2017-01-23 22:15:11] Repair should be done at 2017-01-23 22:33:11
...
...
...
[2017-01-23 22:23:43] Available docks: 1; repair queue: 1
...
[2017-01-23 22:23:51] Got valid timer (00:11:20)!
[2017-01-23 22:23:51] Repair should be done at 2017-01-23 22:33:51
...
...
...
[2017-01-23 22:29:16] Navigating to repair screen with 0 sidestep(s)!
[log] CLICK on L(195,434)@S(0)[0,0 1920x1080] (522 msec)
[error] script [ /home/waicool20/bin/kancolle-auto/kancolle_auto.sikuli ] stopped with error in line 524
[error] IndexError ( index out of range: 0 )
It indeed always crashes whenever the repair slots are full, I tested it by starting the script with all my repair slots full and it would always crash after navigating to the repair screen. But this also means that the script is crashing whether or not the "Repair should be done at X" message are relevant
Environment details
Issue
Intermittent crashes due to index error in script, I'm not exactly a python person
so I couldn't fix it myself.Console log
Full log and used config here: http://pastebin.com/PZSdk2Vd Just use this regex to find errors:
Main error
6 of these:
1 of this: