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

Can't sortie using latest build? #344

Closed AppleBoi86 closed 7 years ago

AppleBoi86 commented 7 years ago

Please read the FAQ/Common Issues section of the README before opening a ticket. Please remove sections of this template you do not find relevant when creating your ticket.

Environment details

Issue

Happens every time. I did remove this from kancolle_auto.py

# Workaround to get jython imports working
# https://bugs.launchpad.net/sikuli/+bug/1504901
# https://github.com/RaiMan/SikuliX-2014/issues/151
import org.sikuli.util.JythonHelper
JythonHelper.get().addSysPath(getBundlePath())

Console log (if applicable)

[2017-03-21 02:23:58] Are there returning expeditions to receive?
[2017-03-21 02:23:59] No, no fleets to receive!
[2017-03-21 02:24:00] Navigating to combat menu with 0 sidestep(s)!
[log] CLICK on L(951,323)@S(0)[0,0 1600x900]
[log] CLICK on L(1104,302)@S(0)[0,0 1600x900]
[log] CLICK on L(1021,444)@S(0)[0,0 1600x900]
[log] CLICK on L(992,396)@S(0)[0,0 1600x900]
[log] CLICK on L(1523,462)@S(0)[0,0 1600x900]
[2017-03-21 02:24:21] Checking fleet condition...
[2017-03-21 02:24:23] Non-catbomb script crash, or catbomb script crash w/ unsupported Viewer!
FindFailed: can not find P(dmg_light.png) S: 0.7 on the screen.
  Line 1574, in file Region.java

[error] script stopped with error in line 536
[error] FindFailed ( can not find P(dmg_light.png) S: 0.7 on the screen. )
Exception in thread "main" java.lang.IllegalStateException: No match found
        at java.util.regex.Matcher.group(Unknown Source)
        at org.sikuli.scriptrunner.JythonScriptRunner.findErrorSourceWalkTrace(JythonScriptRunner.java:326)
        at org.sikuli.scriptrunner.JythonScriptRunner.findErrorSource(JythonScriptRunner.java:290)
        at org.sikuli.scriptrunner.JythonScriptRunner.runPython(JythonScriptRunner.java:200)
        at org.sikuli.scriptrunner.JythonScriptRunner.runScript(JythonScriptRunner.java:162)
        at org.sikuli.basics.SikuliScript.main(SikuliScript.java:181)
        at org.sikuli.ide.SikuliIDE.main(SikuliIDE.java:212)

Relevant config snippet (if applicable)

mrmin123 commented 7 years ago

Interesting. Re-reading the Sikuli docs you're seeing the expected behavior, where findAll() raises the FindFailed exception you're seeing if it doesn't find anything. At the time I switched over from try... except... handling, however, I switched over because the straight findAll() method seemed to work fine. These changes will have to be reverted.

What version of Sikuli are you on? It seems to be behaving differently than mine (mine being potentially incorrect).

waicool20 commented 7 years ago

@mrmin123 instead of reverting the old try...except maybe creating a wrapper function in util.py which returns an empty array in case FindFailed which would be better in case you want to ignore exceptions

mrmin123 commented 7 years ago

@waicool20 that's a good idea. It'll be nice to have any future needed changes to findAll-related code isolated.

AppleBoi86 commented 7 years ago

Sorry for the late reply. I'm using SikuliX 1.0.1.

mrmin123 commented 7 years ago

@AppleBoi86 Please update to 1.1+. See #267

mrmin123 commented 7 years ago

Previously noted inconsistent behavior has been confirmed to be a bug and will be addressed in the next nightly of Sikuli 1.1.1.