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

script [ kancolle_auto ] stopped with error in line 504 #178

Closed cobeng13 closed 8 years ago

cobeng13 commented 8 years ago

Hi. I currently switched to the newest version upon checking. But now it wont run properly. I was using the old version (release r1 (2015-11-08)). And It was working perfectly. Am I doing something wrong?

Here is the link for the screenshot thanks! https://drive.google.com/open?id=0Byx07I9J8bEnWkdkM0t3bTF4Qms

Environment details

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

[description of issue here, along with any screenshots and/or videos]

Console log (if applicable)

[2016-06-09 15:52:35] Reading config file
[2016-06-09 15:52:35] Expeditions (fleet 2: 2, fleet 3: 5, fleet 4: 21) enabled!
[2016-06-09 15:52:35] Config loaded!
[2016-06-09 15:52:35] Reading config file
[2016-06-09 15:52:35] Starting kancolle_auto
[2016-06-09 15:52:35] Finding window!
[2016-06-09 15:52:35] Focus on KanColle!
[log] App.focus: [7136:KanColleViewer!]

[error] script [ kancolle_auto ] stopped with error in line 504
[error] AttributeError ( 'NoneType' object has no attribute 'x' )
[error] --- Traceback --- error source first line: module ( function ) statement 124: util ( rejigger_mouse ) util_settings['game_x'] = temp_game.x - 99
60: main ( focus_window ) rejigger_mouse(kc_window, 370, 770, 100, 400, True)
440: main ( init ) focus_window()
440: main ( init ) focus_window()
[error] --- Traceback --- end --------------

Relevant config snippet (if applicable)

# 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: 3

# 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: 0100

# 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: True

# 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

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

# 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, bd8, bw1, bw2, bw3, bw4, bw5, 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
mrmin123 commented 8 years ago

@cobeng13 What does your [General] section of the config look like? Although if you have the section set up the same as the old version it should still work... Basically that error occurs because sikuli can't find the window you specified. Does the game window actually get selected/brought to the front?

cobeng13 commented 8 years ago

Yes, the window is selected, the mouse moves in the KCV for a while then ends there. Here's a screenshot https://drive.google.com/open?id=0Byx07I9J8bEnNUlSc01rdmhSX1E

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

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

# 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 = 0
mrmin123 commented 8 years ago

Could you try running from the command line directly, not from Sikuli IDE? Instructions are here: https://github.com/mrmin123/kancolle-auto/wiki/Install-kancolle-auto#windows

cobeng13 commented 8 years ago

Tried doing it from command line but im stuck in this part? Is there something missing in my installation? phyton

mrmin123 commented 8 years ago

It says you need to log in and out of your machine again because the PATH was updated. Have you tried that?