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

Frequent Crash on laptop #222

Closed Zylphex closed 8 years ago

Zylphex commented 8 years ago

Hello,

I've been having a consistent issue that's exclusive when I try to run the auto script on my laptop. Everything works fine except when it reaches the repair menu and I always get find failed errors on repair_start_confirm. I've tried replacing the image with one I've taken with a laptop. I've tried adjusting sleep modifier variable to various settings and it has had no effect. The script has run fine in every other screen. Sorties/Expeditions/etc. http://i.imgur.com/naOYoyv.png A picture for reference at the moment of the script crash. Any assistance at all would be greatly appreciated.

Environment details

Is the issue consistent (can be reproduced consistently) or is it transient (only happens sometimes)? Please check one of the boxes:

[replace this line with a description of issue, along with any screenshots and/or videos. Please be descriptive as possible, describing step by step what is happening in the game]

Console log (if applicable)

[debug] repair_start.png has appeared.
[debug] waiting for P(repair_start.png) S: 0.8 T: -1,13 to appear
[debug] P(repair_start.png) S: 0.8 T: -1,13 has appeared.
[log] CLICK on L(970,952)@S(0)[0,0 1920x1200]
[debug] waiting for repair_start_confirm.png to appear
[debug] repair_start_confirm.png has not appeared.
←[91m[2016-08-21 20:58:24] Non-catbomb script crash, or catbomb script crash w/
unsupported Viewer!←[0m
FindFailed: can not find repair_start_confirm.png on the screen.
  Line 1574, in file Region.java

[error] script stopped with error in line 445
[error] FindFailed ( can not find repair_start_confirm.png on the screen. )

Relevant config snippet (if applicable)

###########################################################################
# ============================= IMPORTANT!! ============================= #
# Please refer to the wiki pages for guidance on setting up this file!:   #
# Detailed explanation of config file:                                    #
#   https://github.com/mrmin123/kancolle-auto/wiki/Setup-config.ini       #
# Example configs:                                                        #
#   https://github.com/mrmin123/kancolle-auto/wiki/Example-configs        #
#   https://github.com/mrmin123/kancolle-auto/wiki/Example-Event-configs  #
###########################################################################

[General]
# The program/window name of your Kancolle container. Examples include Google Chrome,
# Firefox, KanColleViewer!, KanColleTool Viewer, Electronic Observer, etc...
Program: Chromium

# Which built-in recovery method to use when you get catbomb'ed. Valid options are Browser,
# KC3, KCV, KCT, and EO.
RecoveryMethod: KC3

# Your machine's timezone's difference to JST in full hours. Relevant to the Quests and PvP
# modules. Default is 0, same timezone as JST.
JSTOffset: 0

# How often kancolle-auto should run its loop, specified in full seconds. A lower value will make
# kancolle-auto be quicker to respond to timers, while a higher value will make it slower, but
# perhaps guard against bot-detection. Default value is 20.
SleepCycle: 20

# Specifies the desired # of menus to randomly walk through. The number of sidesteps range from 0
# to the Paranoia value. Setting this value to at least 1 is recommended (0 to 1 sidesteps).
Paranoia: 1

# If you have a slow computer/network connection, you may encounter frequent FindFailed errors.
# Increase this value by whole numbers (seconds) to increase the length of all sleep/wait timers
# to avoid this. Default is 0.
SleepModifier: 2

[ScheduledSleep]
# Set to True if you want kancolle-auto to automatically sleep/pause at set times. Highly
# recommended that you set this to True if you intend to run kancolle-auto for a long period of
# time.
Enabled: False

# Define around when you would like schedule sleep to start, in military time. Default time is
#0030, meaning that Schedule Sleep will begin sometimes between 12:30AM and 1AM. Relative to your
# computer's time.
StartTime: 0030

# How long you want the sleep to last, in hours (decimals are OK). Anywhere between 0 to 10 minutes
# are added randomly to the actual timer. Default value is 3.5 (hours).
SleepLength: 3.5

[ScheduledStop]
# Set to True if you want kancolle-auto to automatically stop and exit after a set number of hours,
# expeditions, sorties, or PvPs. You will have to manually restart kancolle-auto after this.
Enabled: False

# Define what you want to base the stop count on. Valid options are 'time', 'expedition', 'sortie',
# and 'pvp'.
Mode: time

# Define how many of the above kancolle-auto should perform before automatically stopping.
Count: 5

[Expeditions]
# Set to True if you want kancolle-auto to run expeditions; False if not.
Enabled: True

# Define which Expedition a fleet should go on. If you do not have a Fleet unlocked
# or you don't want it to run an expedition, just leave its value blank.
Fleet2: 2
Fleet3: 21
Fleet4: 5

[PvP]
# Set to True if you want Fleet 1 to run PvP sorties; False if not. NOTE: line-ahead formation
# will be selected for everything, regardless of enemy fleet...
Enabled: False

# Specify which saved fleet composition should be used for PvP, with the first saved fleet being 1.
# NOTE: this value is only relevant if both PvP and Combat modules are enabled with different
# fleets assigned to them! Setting the FleetComp value to 0 for either module, or setting them to
# the same value will disable the fleet composition switcher.
FleetComp: 1

[Combat]
# Set to True if you want Fleet 1 to run combat sorties; False if not.
Enabled: True

# Specify which saved fleet composition should be used for Combat, with the first saved fleet
# being 1.
# NOTE: this value is only relevant if both PvP and Combat modules are enabled with different
# fleets assigned to them! Setting the FleetComp value to 0 for either module, or setting them to
# the same value will disable the fleet composition switcher.
FleetComp: 0

# Set which area you want to sortie to.
# Example 1: if you're running 3-2-A, set this to '3'
# Example 2: if you're running 2-3 (Orel), set this to '2'
# Example 3: if you're running Events, set this to 'E'
Area: 2

# Set which subarea you want to sortie to.
# Example 1: if you're running 3-2-A, set this to '2'
# Example 2: if you're running 2-3 (Orel), set this to '3'
# Example 3: if you're running the first map (1) of the second screen of maps (2) in the Event
#   screen, set this to '2-1'
Subarea: 3

# Specify whether the map you're running utilizes Combined Fleets or not. Only relevant for Events.
# Will automatically handle FCFs and the extra ships needing repairs + resupplies. This also turns
# off PvP and Fleet 2's Expedition, regardless of what you input above.
CombinedFleet: False

# Maximum number of combat nodes to run. Resource/hazard nodes do not count.
# Example 1: if you're running 3-2-A, set this to '1' (1st node only)
# Example 2: if you're running 2-3 (Orel), set this to '3' or above
Nodes: 5

# If the map you are sortieing to involves node selections, use this to point at the image
# generated for that specific node. For example, if you want to always head to node K on E-3 of
# Winter 2016, set this to '_node_E-3-K' to reference the '_node_E-3-K.png' image included.
# For other maps, please generate this image yourself (a 70px x 70px image of the node during
# node selection, with the desired node being in the center of the image).
NodeSelects:

# Formations to use at each combat node, separated by commas. Valid options are
# line_ahead, double_line, diamond, echelon, or line_abreast. If the number of
# formations you've specified does not match the number of nodes you specified above,
# the script will default to line_ahead for the remaining nodes.
# Example 1: if you're running 3-2-A, set this to 'line_ahead'
# Example 2: if you're running 2-3 (Orel), set this to 'line_ahead' (remaining nodes
#     defaults to 'line_ahead')
# For combined fleets, the valid options are combinedfleet_1, combinedfleet_2, combinedfleet_3,
# combinedfleet_4, in order of how they show up in the formation selection screen (left to right,
# top to bottom).
Formations: line_ahead  

# Whether or not to engage in night battle at each combat node, separated by commas.
# Valid options are True (to engage in night battle) and False (to avoid night battle).
# If the number of night battle options you've specified does not match the number of
# nodes you specified above, the script will default to True for the remaining nodes.
# Example 1: if you're running 3-2-A, set this to 'False'
# Example 2: if you're running 2-3 (Orel), set this to 'False' (remaining nodes defaults
#     to 'True')
NightBattles: False

# Set the damage threshold for your ships. RetreatLimit specifies when sortie should be cancelled
# (retreat from sortie), and RepairLimit specifies which ships should be repaired before
# sortieing again. In addition, the tool will automatically not sortie if any ships are at the
# RepairLimit threshold. 0 = light damage, 1 = moderate damage, 2 = critical damage.
# Example: If you want the script to retreat when any ship is at critical damage, but also repair
#     any ships at moderate damage, set RetreatLimit to 2, RepairLimit to 1.
RetreatLimit: 2
RepairLimit: 1

# Set the repair time limit for repairs. kancolle-auto will automatically use a bucket to repair a
# ship if its repair time is above this # of hours. Integer values only, please. If you want to
# never use buckets, set this to '9900'. A limit of '9500' and below will allow the repair script
# to use a bucket if the OCR cannot properly read the timer, so adjust this accordingly. If you
# always want to use buckets, set it to '0'.
RepairTimeLimit: 9900

# Whether or not to find submarines under repair to switch out so kancolle-auto can continue
# sorties. Useful for maps where submarines are used to tank hits, such as 2-3 (Orel) or 3-2-A.
SubmarineSwitch: False

# Whether or not to consider fatigue/morale before sorties. If the ships have an unhappy face
# (morale of 29 or below) the script will wait for a set amount of time for morale to recover.
CheckFatigue: True

# Whether or not to sortie when the port (ship slots) is full. Set to True if you do not want
# sorties to occur when your port is full. Port checking is automatically done when sortieing to
# Event maps, since sortieing is prohibited when you do not have 5 free ship slots.
PortCheck: False

# Set this to True if you want kancolle-auto to stop sortieing to the specified map once the medal
# has been obtained. Only applicable to the monthly EOs (1-5, 2-5, 3-5, 4-5, 5-5).
MedalStop: False

# WARNING: READ THIS
# Whether or not to 'push' past the max number of defined combat nodes, REGARDLESS OF THE STATE
# OF YOUR FLEET. Only do this if the last node is a resource/non-combat node, like the end of 1-6
# and your path is 100% fixed!!! YOU MAY LOSE SHIPS WITH THIS SET TO TRUE.
LastNodePush: False

[LBAS]
# Set to True if you want kancolle-auto to sortie with LBAS support
Enabled: False

# Enabled air support groups for the sortie, delimited by commas. Values should be 1, 2, or 3
EnabledGroups: 1

# Node image names for each of the above enabled air support groups. Each group should have two
# nodes assigned to them. You'll have to generate these images yourself
Group1Nodes: _node_lbas_E-2-I_1.png, _node_lbas_E-2-I_2.png
Group2Nodes:
Group3Nodes:

[Quests]
# Set to True if you want kancolle-auto to manage quests; False if not.
Enabled: False

# Quests to check for. Please check the Wiki linked above for a list of supported quests. Defaults
# to a list of most generic quests. kancolle-auto will ignore quests if they are not completable
# as specified by your config (if PvP is disabled, PvP quests will not be activated, and so on).
Quests: bd1, bd2, bd3, bd4, bd5, bd6, bd7, bd8, bw1, bw2, bw3, bw4, bw5, bw6, bw7, c2, c3, c4, c8, d2, d3, d4, d9, d11, e3, e4

# How often should quests be checked? Settings this to 1 will make quests be checked after every
# expedition and sortie. Default is 3.
CheckSchedule: 3
Zylphex commented 8 years ago

Also would like to add when I run the script with the same settings on PC it works completely fine.

mrmin123 commented 8 years ago

@Zylphex That's a very specific case, so I probably won't be able to help much with it.

Try replacing this line in kancolle_auto.py:

# debug_find('dmg_critical.png', 'Chrome', 0.75)  # For debugging purposes only!

to (notice it's not a comment anymore)

debug_find('repair_start.png', 'Chrome', 0.8)  # For debugging purposes only!

and try running the script again on the laptop. If you're getting a match there, then dunno what to say...

Zylphex commented 8 years ago

Thanks for the help mrmin, It did find a match and I still got the error. I'll continue tweaking the script and maybe I'll figure it out.

Aug 22, 2016 10:29:55 AM java.util.prefs.WindowsPreferences WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0 x80000002. Windows RegCreateKeyEx(...) returned error code 5. [debug] Running on Java 8 (1.8.0_101-b13) [debug] ResourceLoaderBasic: check: we are running on arch: amd64 [debug] ResourceLoaderBasic: check: using Java at: C:/Program Files/Java/jre1.8. 0_101/ [debug] Screen: initScreens: basic initialization (1 Screen(s) found) [log] App.focus Chromium(0) #0 [debug] waiting for P(repair_start_confirm.png) S: 0.8 to appear [debug] P(repair_start_confirm.png) S: 0.8 has appeared.

[error] script stopped with error in line 382 [error] Could not evaluate error source nor reason. Analyze StackTrace! [error] Traceback (most recent call last): File "C:\kancolleauto\kancolle_auto.sikuli\kancolle_auto.py", line 382, in <mo dule> debug_find('repair_start_confirm.png', 'Chromium', 0.8) # For debugging pu rposes only! File "C:\kancolleauto\kancolle_auto.sikuli\util.sikuli\util.py", line 627, in debug_find raise SystemExit

mrmin123 commented 8 years ago

@Zylphex yea I can't really help you there. Closing this as I don't think it's a kancolle-auto problem.