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

Enabling Submarine switching causes the script to crash #318

Closed Gbraker7000 closed 7 years ago

Gbraker7000 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

Enabling automatic submarine switching crashes the script, disabling it solves the problem. Resintalling everything on a fresh OS doesnt seem to fix the issue. Launching from command line causes the same effect.

Console log (from KAGA)

[KAGA] [2017-02-24 19:08:10] [c.w.k.KancolleAuto] INFO - Starting new Kancolle Auto session
[KAGA] [2017-02-24 19:08:10] [c.w.k.KancolleAuto] DEBUG - Launching with command: java -jar C:\Users\Bot\Downloads\sikulix.jar -r C:\Users\Bot\Downloads\kancolle-auto-master\kancolle-auto-master\kancolle_auto.sikuli
[KAGA] [2017-02-24 19:08:10] [c.w.k.KancolleAuto] DEBUG - Session profile: {"general":{"offset":-12,"recoveryMethod":"KC3","sleepCycle":20,"program":"Chrome","jstOffset":-12,"paranoia":1,"sleepModifier":0,"basicRecovery":true},"scheduledSleep":{"length":3.5,"enabled":true,"startTime":"0030"},"scheduledStop":{"count":5,"enabled":false,"mode":"TIME"},"expeditions":{"enabled":true,"fleet3":"5","fleet4":"21","fleet2":"2"},"pvp":{"enabled":true,"fleetComp":2},"sortie":{"enabled":true,"nodes":1,"area":"1","fleetComp":1,"nightBattles":[false],"combinedFleet":false,"nodeSelects":"","subarea":"5","formations":["LINE_AHEAD"],"repairLimit":1,"checkFatigue":false,"medalStop":false,"portCheck":false,"lastNodePush":false,"retreatLimit":1,"repairTimeLimit":30},"submarineSwitch":{"enabled":true,"enabledSubs":["I_8"]},"lbas":{"enabled":false,"group1Nodes":[],"enabledGroups":[],"group2Nodes":[],"group3Nodes":[]},"quests":{"enabled":true,"quests":["bd1","bd2","bd3","bd4","bd5","bd6","bd7","bd8","bw1","bw2","bw3","bw4","bw5","bw6","bw7","bw8","bw9","bw10","c2","c3","c4","c8","d2","d3","d4","d9","d11","e3","e4"],"checkSchedule":5},"name":"1-5"}
Feb 24, 2017 7:08:13 PM java.util.prefs.WindowsPreferences <init>
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
[2017-02-24 19:08:24] Reading config file!
[2017-02-24 19:08:24] Scheduled Sleep enabled: ~3.5 hours starting at ~0030
[2017-02-24 19:08:24] Expeditions enabled: fleet 2: 2, fleet 3: 5, fleet 4: 21
[2017-02-24 19:08:24] Combat enabled (PvP mode)
[2017-02-24 19:08:24] Combat enabled (sortie mode): sortieing to 1-5
[error] script [ C:\Users\Bot\Downloads\kancolle-auto-master\kancolle-auto-master\kancolle_auto.sikuli ] stopped with error in line 542
[error] ConfigParser.NoOptionError ( No option 'replacelimit' in section: 'SubmarineSwitch' )
[error] --- Traceback --- error source first
line: module ( function ) statement 
618: ConfigParser (  get ) ConfigParser.NoOptionError: No option 'replacelimit' in section: 'SubmarineSwitch'
359: ConfigParser (  getint )   File "C:\Users\Bot\Downloads\sikulix.jar\Lib\ConfigParser.py", line 356, in _get
108: config_reader (  get_config )     settings['submarine_switch_replace_limit'] = config.getint('SubmarineSwitch', 'ReplaceLimit')
346: main (  init )     settings, sleep_cycle = config_reader.get_config(settings, sleep_cycle)
434: main (  kancolle_auto_wrapper )     init()
542: main (  <module> )     kancolle_auto_wrapper()
[error] --- Traceback --- end --------------
OpenGL Warning: crPixelCopy3D:  simply crMemcpy'ing from srcPtr to dstPtr
OpenGL Warning: crPixelCopy3D:  simply crMemcpy'ing from srcPtr to dstPtr
OpenGL Warning: crPixelCopy3D:  simply crMemcpy'ing from srcPtr to dstPtr
OpenGL Warning: crPixelCopy3D:  simply crMemcpy'ing from srcPtr to dstPtr
OpenGL Warning: crPixelCopy3D:  simply crMemcpy'ing from srcPtr to dstPtr
OpenGL Warning: crPixelCopy3D:  simply crMemcpy'ing from srcPtr to dstPtr
OpenGL Warning: crPixelCopy3D:  simply crMemcpy'ing from srcPtr to dstPtr
OpenGL Warning: crPixelCopy3D:  simply crMemcpy'ing from srcPtr to dstPtr
[KAGA] [2017-02-24 19:08:25] [c.w.k.KancolleAuto] INFO - Kancolle Auto session has terminated!
[KAGA] [2017-02-24 19:08:25] [c.w.k.KancolleAuto] DEBUG - Exit Value was 1
[KAGA] [2017-02-24 19:08:25] [c.w.k.KancolleAuto] INFO - Kancolle Auto didn't terminate gracefully
Feb 24, 2017 7:08:25 PM tornadofx.DefaultErrorHandler uncaughtException
GRAVE: Uncaught error
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
    at java.lang.String.substring(Unknown Source)
    at com.waicool20.kaga.KancolleAuto.saveCrashLog(KancolleAuto.kt:71)
    at com.waicool20.kaga.KancolleAuto.handleCrash(KancolleAuto.kt:57)
    at com.waicool20.kaga.KancolleAuto.startAndWait(KancolleAuto.kt:44)
    at com.waicool20.kaga.views.KagaView$onStartStopButton$1.run(KagaView.kt:146)
    at java.lang.Thread.run(Unknown Source)
mrmin123 commented 7 years ago

As of 2017-02-23 the ReplaceLimit option was introduced to kancolle-auto. It's possible that KAGA does not output this field if it hasn't been updated for it. You'll have to manually add back in the ReplaceLimit line to your config. Please refer to the config file, config_detailed file, and/or the wiki to see where it should go and how it should be used.