perryhuynh / kcauto

kcauto, the successor to kancolle-auto, a Kantai Collection (Kancolle) bot/automation tool
GNU General Public License v3.0
68 stars 23 forks source link

Ship switcher and Quest module work wrong #425

Open yjjieqc opened 4 years ago

yjjieqc commented 4 years ago

Environment details

Issue variability

Is the issue consistent (can be reproduced consistently) or is it intermittent (only happens sometimes)?: Yes

Issue

I mask quest Bd7 in quest module, but kcauto always deactivate the quest. Another question is the ship switcher module that kcauto always repair the ship only. I want to switch moderate and heavy damage ship out by using damage:>=3 and one slot of my switch in criteria is class:13:>:25:<=:1:<:100:locked:,class:14:>:25:<=:1:<:100:locked:. All SS/SSVs has duplicators. Is any question in my setting? I paste my config file below.

{
  "general.jst_offset": 0,
  "general.interaction_mode": "direct_control",
  "general.chrome_dev_port": 9222,
  "general.paused": false,
  "expedition.enabled": true,
  "expedition.fleet_2": [
    2
  ],
  "expedition.fleet_3": [
    5
  ],
  "expedition.fleet_4": [
    21
  ],
  "pvp.enabled": false,
  "pvp.fleet_preset": null,
  "combat.enabled": true,
  "combat.sortie_map": "2-1",
  "combat.fleet_mode": "standard",
  "combat.fleet_presets": [],
  "combat.node_selects": [],
  "combat.retreat_points": [],
  "combat.push_nodes": [],
  "combat.node_formations": [
    "1:line_ahead",
    "2:line_ahead",
    "3:line_ahead"
  ],
  "combat.node_night_battles": [
    "1:True"
  ],
  "combat.retreat_limit": 4,
  "combat.repair_limit": 3,
  "combat.repair_timelimit_hours": 4,
  "combat.repair_timelimit_minutes": 0,
  "combat.lbas_groups": [],
  "combat.lbas_group_1_nodes": [],
  "combat.lbas_group_2_nodes": [],
  "combat.lbas_group_3_nodes": [],
  "combat.check_fatigue": false,
  "combat.check_lbas_fatigue": false,
  "combat.reserve_repair_dock": false,
  "combat.port_check": false,
  "combat.clear_stop": false,
  "event_reset.enabled": false,
  "event_reset.frequency": 3,
  "event_reset.reset_difficulty": 3,
  "event_reset.farm_difficulty": 2,
  "ship_switcher.enabled": true,
  "ship_switcher.slots": {
    "1": "damage:>=:3|class:13:>:25:<=:1:<:100:locked:,class:14:>:25:<=:1:<:100:locked:",
    "2": "damage:>=:3|class:13:>:25:<=:1:<:100:locked:,class:14:>:25:<=:1:<:100:locked:",
    "3": "damage:>=:3|class:13:>:25:<=:1:<:100:locked:,class:14:>:25:<=:1:<:100:locked:",
    "4": "damage:>=:3|class:13:>:25:<=:1:<:100:locked:,class:14:>:25:<=:1:<:100:locked:",
    "5": "damage:>=:3|class:13:>:25:<=:1:<:100:locked:,class:14:>:25:<=:1:<:100:locked:",
    "6": "damage:>=:3|class:13:>:25:<=:1:<:100:locked:,class:14:>:25:<=:1:<:100:locked:"
  },
  "passive_repair.enabled": false,
  "passive_repair.repair_threshold": 1,
  "passive_repair.slots_to_reserve": 1,
  "quest.enabled": true,
  "quest.quests": [
    "Bd1",
    "Bd2",
    "Bd3",
    "Bd5",
    "Bd6",
    "Bd7",
    "Bd8",
    "Bw1",
    "Bw2",
    "Bw3",
    "Bw4",
    "Bd4",
    "D2",
    "D3",
    "D4",
    "E3",
    "E4"
  ],
  "scheduler.enabled": false,
  "scheduler.rules": []
}

solved issue

Issue

Please provide a thorough description of the issue. Screenshots, videos, or at least a step-by-step description of what is happening in the game is typically necessary to debug. It could not find the game page in chrome. and if run chrome in GUI 3rd page, it crashed.

Log

C:\Program Files (x86)\Google\Chrome\Application>chrome.exe --remote-debugging-port=9222 http://www.dmm.com/netgame/social/-/gadgets/=/app_id=854854/

[2019-12-22 14:20:50] Initializing kcauto.
[2019-12-22 14:20:50] Config successfully loaded.
[2019-12-22 14:20:50] Fleet 1 activated.
[2019-12-22 14:20:50] Expedition module enabled.
[2019-12-22 14:20:50] Quest module enabled.
[2019-12-22 14:20:50] Combat module enabled.
[2019-12-22 14:20:50] Hooking into Chrome.
[2019-12-22 14:20:54] No Kantai Collection tab found in Chrome. Shutting down kcauto.
Traceback (most recent call last):
  File "C:\Users\lonel\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Users\lonel\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "kcauto\__main__.py", line 14, in <module>
    from kcauto_wrapper import kcauto_main
  File "kcauto\kcauto_wrapper.py", line 5, in <module>
    import kcauto as _
  File "kcauto\kcauto.py", line 203, in <module>
    kcauto = Kcauto()
  File "kcauto\kcauto.py", line 23, in __init__
    kca_u.kca.hook_chrome(port=cfg.config.general.chrome_dev_port)
  File "kcauto\util\kca.py", line 74, in hook_chrome
    "No running Kantai Collection tab found in Chrome.")
Exception: No running Kantai Collection tab found in Chrome.
[2019-12-22 14:20:55] Terminated kcauto subprocess via GUI.
stackhanovets commented 4 years ago

The game tab must be active and the related Chrome window must be on top. Is it so?

yjjieqc commented 4 years ago

The game tab must be active and the related Chrome window must be on top. Is it so?

YES. I start chrome with this commandchrome.exe --remote-debugging-port=9222 http://www.dmm.com/netgame/social/-/gadgets/=/app_id=854854/, only one tab in chrome and start kcauto at start page. but kcauto can't find the game page.

stackhanovets commented 4 years ago

Well, I do not think starting a browser from the console is a good practice since you can easily launch it with escalated privileges. Try to create new shortcut with required arguments. But if you've decided to use an in-house batch script, you can try something like this...

@ECHO off

START "" %CHROME_BIN%  --remote-debugging-port=9222 --new-window "http://www.dmm.com/netgame/social/-/gadgets/=/app_id=854854/"

ECHO Waiting the game load. Make sure the Chrome window is active!
TIMEOUT 30

CD %KCAUTO_DIR%
SET PYTHONIOENCODING=utf-8
python kcauto --cli
yjjieqc commented 4 years ago

thanks, it works sometimes. I don't know what's the matter. How do you use this in windows.

stackhanovets commented 4 years ago

@yjjieqc Please ask a more detailed question.