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

repair start confirm error #382

Closed akagiknowsbest closed 7 years ago

akagiknowsbest commented 7 years ago

Environment details

Issue

Is the issue consistent: consistent

So. to the point: my k-auto had a loop on repair screen all the time. When I tried to use last master version, not released one, it crashed because of bucket reservation features right on the start. I couldn't run it successfully at all. so I used 9.1 late march build again and just manually fixed combat.py 448 line (was it? don't remember already) It started to work finally, yeeeah! but... when it comes to repair start confirmation button on the dark screen with chosen ship, it writes findfailed and crashes. I repeated it few times, increased sleep mod to 4, but even if it loads in a second or less, still "findfailed" and errors.

Console log

[2017-06-10 02:27:20] Checking fleet condition...
[2017-06-10 02:27:22] Light damage: 0; moderate damage: 0; critical damage: 1
[2017-06-10 02:27:23] Fleet needs resupply!
[2017-06-10 02:27:29] Focus on KanColle!
[log] App.focus:  [3960:Chrome]
[2017-06-10 02:27:49] Going home with 0 or less sidestep(s)!
[log] CLICK on L(344,337)@S(0)[0,0 1366x768] (534 msec)
[2017-06-10 02:28:01] At Home!
[2017-06-10 02:28:01] Are there returning expeditions to receive?
[2017-06-10 02:28:02] No, no fleets to receive!
[2017-06-10 02:28:03] Navigating to repair screen with 0 sidestep(s)!
[log] CLICK on L(400,422)@S(0)[0,0 1366x768] (542 msec)
[2017-06-10 02:28:18] Attempting to conduct repairs on 1 ship(s)!
[2017-06-10 02:28:18] Available docks: 2; repair queue: 1
[log] CLICK on L(587,265)@S(0)[0,0 1366x768] (539 msec)
[2017-06-10 02:28:29] Check for critically damaged ships.
[log] CLICK on L(788,221)@S(0)[0,0 1366x768] (538 msec)
[2017-06-10 02:28:30] Starting repair on critically damaged ship!
[2017-06-10 02:28:37] Got valid timer (00:06:30)!
[2017-06-10 02:28:37] Repair should be done at 2017-06-10 02:33:37
[log] CLICK on L(947,540)@S(0)[0,0 1366x768] (540 msec)
[log]  TYPE "#ESC."
[2017-06-10 02:28:52] Non-catbomb script crash, or catbomb script crash w/ unsupported Viewer!
FindFailed: repair_start_confirm.png: (104x28) in S(0)[0,0 1366x768] E:Y, T:3,0
  Line 2757, in file Region.java

[error] script [ D:\kancolle-auto-9.1\kancolle_auto.sikuli ] stopped with error in line 542
[error] FindFailed ( repair_start_confirm.png: (104x28) in S(0)[0,0 1366x768] E:Y, T:3,0 )
[error] --- Traceback --- error source first
line: module ( function ) statement 
584: util (  pattern_generator )     m = match(r'M\[\d+\,\d+ (\d+)x(\d+)\]', str(find(pic)))
543: util (  wait_and_click )     kc_region.wait(pattern_generator(kc_region, pic, expand), time)
516: combat (  go_repair )     wait_and_click(self.kc_region, 'repair_start_confirm.png', 10)
252: main (  sortie_action )     combat_item.go_repair()
412: main (  init )     sortie_action()
434: main (  kancolle_auto_wrapper )     init()
540: main (  <module> )     kancolle_auto_wrapper()
[error] --- Traceback --- end --------------
[KAGA] [2017-06-10 02:28:57] [c.w.k.k.KancolleAuto] INFO - Kancolle Auto session has terminated!
[KAGA] [2017-06-10 02:28:57] [c.w.k.k.KancolleAuto] DEBUG - Exit Value was 1
[KAGA] [2017-06-10 02:28:57] [c.w.k.k.KancolleAuto] INFO - Kancolle Auto didn't terminate gracefully

Relevant config snippet

[General]
Program = Chrome
RecoveryMethod = KC3
BasicRecovery = True
JSTOffset = -6
SleepCycle = 15
Paranoia = 0
SleepModifier = 5

[ScheduledSleep]
Enabled = True
StartTime = 0030
SleepLength = 5.0

[ScheduledStop]
Enabled = False
Mode = TIME
Count = 5

[Expeditions]
Enabled = True
Fleet2 = 2
Fleet3 = 32
Fleet4 = 38

[PvP]
Enabled = False
FleetComp = 1

[Combat]
Enabled = True
FleetComp = 1
Area = 1
Subarea = 5
CombinedFleet = False
Nodes = 1
NodeSelects = 
Formations = line_abreast
NightBattles = False
RetreatLimit = 1
RepairLimit = 1
RepairTimeLimit = 0100
CheckFatigue = False
PortCheck = False
MedalStop = False
LastNodePush = False

maybe there is something more I should write there? or should I check some more lines? It's weird that it crashes immediately at this point. kancolle has no subtitles or other stuff that can be in front of this button, of course. 100% size of course too.

waicool20 commented 7 years ago

Well you can always try to increase the sleep modifier even higher. You sure its not just your internet thats loading the confirmation screen too long ?

akagiknowsbest commented 7 years ago

I was right there, watching by myself, repeated all process few times in front of my eyes. It took less than 1 second to load that screen when sleep modifier was set on 5 sec. so, sure... and it looks kinda weird. cause it should work fine oO... everything is ok with button and with 516 line in combat file about it.

can there be an option to manually through combat.py force script to wait for ~10 sec just in this moment (for sure in Any cases like "suddenly pc will freeze a bit" 10 should be enough. but pc is fast enough for so long sleep mod for eeeveeeryyy buuuttoooon) and then just click on coordinates counted manually in my screen? I don't know how to write it actually. But if script works fine with everyone else, then, maybe it's just my lack of being "special" :D I mean, I guess, there's nothing to fix actually, if it works with others and noone complained but me. So I ask, how to avoid this weird stage and change it on something stupid and simple aka "Method of crutches and bicycles" in my case? what generally should I write instead of "wait_and_click blabla that-invisible-magic-button"?)

akagiknowsbest commented 7 years ago

right now tried with really long sleep mod. nope) still, loaded in one, but nothing happened for 20 seconds and then error.

waicool20 commented 7 years ago

if you really really are confident with your internet you can always modify the script to click that specific region using coordinates instead of trying to find it (and failing)

akagiknowsbest commented 7 years ago

(that's what I'm talking about yes!) so... how should I write this line? it's "wait_and_click(self.kc_region, 'repair_start_confirm.png', 10)" now. I'm not sure, how to write coordinates inside this code instead of png file in right way without ruining everything?) simple screen coordinates go from top left (0; 0) to bottom right afaik from what I read about mouse moving scripts. should I count the pc screen coordinates or ingame window one? if it says self.kc_region - I guess i should count the second option. and... how to write it correctly in it? for example, from top left in game it's x = 500 y = 400

waicool20 commented 7 years ago

This should do Region(self.kc_region.x + xOffset, self.kc_region.y + yOffset, widthOfButton, heightOfButton).click()

just replace the variables with whatever measurements you get relative to the top left corner of kancolle

akagiknowsbest commented 7 years ago

It works perfectly now!~ Thank you!)))

waicool20 commented 7 years ago

@akagiknowsbest Close the issue if it has been resolved