perryhuynh / kcauto Goto Github PK
View Code? Open in Web Editor NEWkcauto, the successor to kancolle-auto, a Kantai Collection (Kancolle) bot/automation tool
License: GNU General Public License v3.0
kcauto, the successor to kancolle-auto, a Kantai Collection (Kancolle) bot/automation tool
License: GNU General Public License v3.0
When you turn LBAS on, active or defensive mode, kc-kai is expecting to see the sortie button with the green lbas bar for example:
but when you want to just turn LBAS on defensive there is no sortie button with the green lbas bar.
for example, sortie with 3 LBAS on defensive mode
A solution to this problem would be to check if the user as turned on LBAS but has selected no nodes, inferring that the LBAS's are on defensive mode, then just finding the red sortie bar when at the sortie screen.
Upon reaching filling all ship slots, the script would automatically scrap all unlocked ships (including or excluding equipment using the slider). A huge disclaimer would obviously need to be issued as well.
Reported on Discord. Check logic.
As far as I can tell, what's happening is:
_run_loop_between_nodes
resolves ending at a resource node as True
_run_loop_during_battle
now hangs foreverThe intended behavior seems to be that _run_loop_during_battle
resolves the resource node screen, which isn't happening because the boss dialogue stuff has already resolved it.
Possible fixes:
After further testing on E-4, discussions with users, and introspection, I'm making the decision to drop the live node detection feature in the Combat module.
While the node detection feature worked well in preliminary testing, actual use cases proved to be much more challenging. Even during feature development multiple issues made it difficult to implement:
Various workarounds were implemented to try and combat these issues but on maps like E-4 it led to too many false detection of nodes. I feel like I've done all I can tweaking the asset-matching tools I have with Sikuli so I am dropping the feature.
Thankfully the infrastructure built to support live node detection gives us a number of periphery wins that will not change:
mapData
module the ability to click nodes based on their coordinates for node selection and LBAS assignment will remain asset-lessCombatModule
class since it is no longer dependent on the map node data ✔️Config
module needs to be updated to account for config changes ✔️So we've got a combo box in the config generator. There are some unobvious text values. How about replacing the text:
with readable image tumbnails? E.g. wiki.
So I got the RepairLimit: minor
parameter and the ship with less damage percentage than the whole first repair queue page. The script just clicked and clicked until I have changed page. Is there a way to search the damaged ship assigned to fleet across the repair queue pages?
$ sed 's|[0-9]\+-[0-9]\+-[0-9]\+|date|g' output | sed 's|[0-9]\+:[0-9]\+:[0-9]\+|time|g' | sed 's|[0-9]\+x[0-9]\+|resolution|g' | sed 's|[0-9]\+:Chrome|Chrome|'
[date time] Initializing config module
[date time] Reading config
[date time] Validating config
[date time] Starting kancolle-auto!
[log] App.focus: [Chrome]
[date time] At home
[date time] At home
[date time] Refreshing home.
[log] CLICK on L(329,352)@S(0)[0,0 resolution] (779 msec)
[log] CLICK on L(78,353)@S(0)[0,0 resolution] (537 msec)
[log] App.focus: [Chrome]
[date time] At home
[date time] At home
[date time] At home
[date time] Navigating to expedition screen.
[log] CLICK on L(225,379)@S(0)[0,0 resolution] (549 msec)
[log] CLICK on L(699,285)@S(0)[0,0 resolution] (572 msec)
[date time] Sortieing fleet 2 to expedition 38
[log] CLICK on L(378,544)@S(0)[0,0 resolution] (576 msec)
[log] CLICK on L(316,445)@S(0)[0,0 resolution] (529 msec)
[date time] Got valid timer (time)!
[date time] Expedition is already running. Return time: date time
[date time] Sortieing fleet 3 to expedition 5
[log] CLICK on L(140,537)@S(0)[0,0 resolution] (593 msec)
[log] CLICK on L(261,410)@S(0)[0,0 resolution] (585 msec)
[date time] Got valid timer (time)!
[date time] Expedition is already running. Return time: date time
[date time] Sortieing fleet 4 to expedition 6
[log] CLICK on L(241,438)@S(0)[0,0 resolution] (531 msec)
[log] CLICK on L(706,553)@S(0)[0,0 resolution] (673 msec)
[log] CLICK on L(457,226)@S(0)[0,0 resolution] (560 msec)
[log] CLICK on L(633,556)@S(0)[0,0 resolution] (728 msec)
[date time] Fleet 4 sortied. Expected return time: date time
[log] App.focus: [Chrome]
[date time] At side menu
[date time] Going home.
[log] CLICK on L(31,423)@S(0)[0,0 resolution] (569 msec)
[log] CLICK on L(85,375)@S(0)[0,0 resolution] (638 msec)
[date time] At home
[date time] At home
[date time] Navigating to combat screen.
[log] CLICK on L(198,398)@S(0)[0,0 resolution] (544 msec)
[log] CLICK on L(257,371)@S(0)[0,0 resolution] (611 msec)
[log] CLICK on L(445,553)@S(0)[0,0 resolution] (561 msec)
[log] CLICK on L(736,376)@S(0)[0,0 resolution] (563 msec)
[log] CLICK on L(292,327)@S(0)[0,0 resolution] (650 msec)
[log] CLICK on L(683,550)@S(0)[0,0 resolution] (560 msec)
{'medium': False, 'high': False}
[date time] Canceling combat sortie: 1 ships above damage threshold.
[date time] At side menu
[date time] Going home.
[log] CLICK on L(25,270)@S(0)[0,0 resolution] (629 msec)
[log] CLICK on L(74,356)@S(0)[0,0 resolution] (764 msec)
[date time] At home
[date time] Navigating to repair screen.
[log] CLICK on L(281,470)@S(0)[0,0 resolution] (770 msec)
[log] CLICK on L(25,419)@S(0)[0,0 resolution] (589 msec)
[date time] Begin repairing fleets.
[log] CLICK on L(311,270)@S(0)[0,0 resolution] (552 msec)
[date time] Picking damaged ship from combat fleet(s) to repair.
[log] CLICK on L(231,272)@S(0)[0,0 resolution] (540 msec)
[date time] Picking damaged ship from combat fleet(s) to repair.
[log] CLICK on L(250,357)@S(0)[0,0 resolution] (550 msec)
[date time] Picking damaged ship from combat fleet(s) to repair.
[log] CLICK on L(280,281)@S(0)[0,0 resolution] (576 msec)
...
[date time] Picking damaged ship from combat fleet(s) to repair.
[log] CLICK on L(529,251)@S(0)[0,0 resolution] (573 msec)
[date time] Got valid timer (time)!
[log] CLICK on L(766,402)@S(0)[0,0 resolution] (574 msec)
[log] CLICK on L(705,540)@S(0)[0,0 resolution] (581 msec)
[log] CLICK on L(489,507)@S(0)[0,0 resolution] (550 msec)
[date time] End of cycle 1
[date time] Next combat sortie at date time
[date time] Fleet 2: Expedition returns at date time
[date time] Fleet 3: Expedition returns at date time
[date time] Fleet 4: Expedition returns at date time
[date time] Expeditions sent: 1 / received: 0
[date time] Combat done: 0 / attempted: 1
[date time] Resupplies: 0 || Repairs: 1 || Buckets: 1
[date time] Recoveries done: 0
Also the debugging dict {'medium': False, 'high': False}
How about a humanization?
print('Fatiqued:', ', '.join({k.title() + ': ' + str(sum([d[k]])) for k in d}))
I think ShipSwitcher is stable syntactically, but there may be functional and behavioral edge cases that I may not have accounted for. Please report ShipSwitcher-related bugs here, along with relevant logs (if available) and the ShipSwitcher config section you used.
Issue w/ modification of mutable variable in init
.
Currently the set configs on web webUI reset every time you go to the About tab and back, but changes should be kept consistent. Requires dumping of relevant data to redux store and propagating the local states from the store.
Reported on Discord. Needs further testing and potential tweaking of thresholds.
edit: medium fatigue, specifically
Few maps were tested, the interruptions had happened from time to time and had thrown similar tracebacks.
Log:
[date time] Expeditions sent: 3 / received: 2
[date time] Combat done: 4 / attempted: 6
[date time] Resupplies: 6 || Repairs: 5 || Buckets: 5
[date time] Recoveries done: 0
[log] App.focus: [Chrome]
[date time] At side menu
[date time] Going home.
[log] CLICK on L(78,367)@S(0)[0,0 resolution] (553 msec)
[date time] At home
[date time] At home
[date time] Navigating to combat screen.
[log] CLICK on L(205,404)@S(0)[0,0 resolution] (555 msec)
[log] CLICK on L(209,337)@S(0)[0,0 resolution] (572 msec)
[log] CLICK on L(717,555)@S(0)[0,0 resolution] (529 msec)
[date time] Begin resupplying LBAS groups.
[log] CLICK on L(196,507)@S(0)[0,0 resolution] (559 msec)
[date time] Resupplying LBAS group 1.
{'medium': False, 'high': False}
[date time] LBAS group switched to sortie mode.
[log] CLICK on L(261,505)@S(0)[0,0 resolution] (561 msec)
[log] CLICK on L(632,386)@S(0)[0,0 resolution] (531 msec)
[log] CLICK on L(731,559)@S(0)[0,0 resolution] (555 msec)
[log] CLICK on L(427,227)@S(0)[0,0 resolution] (546 msec)
{'medium': False, 'high': False}
[log] CLICK on L(655,552)@S(0)[0,0 resolution] (605 msec)
[date time] Assign LBAS groups to nodes.
[date time] Assigning nodes for LBAS group 1.
[log] CLICK on L(658,173)@S(0)[0,0 resolution] (634 msec)
[date time] Fleet at Node Q
[date time] Engaging the enemy in diamond formation.
[log] CLICK on L(738,295)@S(0)[0,0 resolution] (657 msec)
[date time] Continuing sortie.
[log] CLICK on L(313,332)@S(0)[0,0 resolution] (566 msec)
[date time] Fleet at Node K
[date time] Engaging the enemy in line ahead formation.
[log] CLICK on L(434,295)@S(0)[0,0 resolution] (559 msec)
[date time] Continuing sortie.
[log] CLICK on L(315,354)@S(0)[0,0 resolution] (589 msec)
[date time] Fleet at Node L
[date time] Engaging the enemy in line ahead formation.
[log] CLICK on L(468,293)@S(0)[0,0 resolution] (634 msec)
[date time] Continuing sortie.
[log] CLICK on L(313,341)@S(0)[0,0 resolution] (585 msec)
[date time] Fleet at Node M
[date time] Engaging the enemy in diamond formation.
[log] CLICK on L(692,292)@S(0)[0,0 resolution] (577 msec)
[date time] Continuing sortie.
[log] CLICK on L(300,342)@S(0)[0,0 resolution] (594 msec)
[date time] Fleet at Node P(backup)
[date time] Engaging the enemy in line ahead formation.
[log] CLICK on L(470,299)@S(0)[0,0 resolution] (658 msec)
[date time] Commencing night battle.
[log] CLICK on L(520,332)@S(0)[0,0 resolution] (572 msec)
[log] App.focus: [Chrome]
[date time] Irrecoverable crash
FindFailed: next.png: (resolution) seen at (746, 528) with 1.00 in R[718,502 resolution]@S(0) E:Y, T:1.0
Line 2755, in file Region.java
[error] script [ .../kcauto-kai/kcauto-kai.sikuli ] stopped with error in line 76
[error] FindFailed ( next.png: (resolution) seen at (746, 528) with 1.00 in R[718,502 resolution]@S(0) E:Y, T:1.0 )
[error] --- Traceback --- error source first
line: module ( function ) statement
328: combat ( _run_combat_logic ) self.regions['lower_right_corner'].wait('next.png', 30)
116: combat ( combat_logic_wrapper ) self._run_combat_logic()
310: main ( run_combat_cycle ) if self.modules['combat'].combat_logic_wrapper():
64: main ( <module> ) kcauto_kai.run_combat_cycle()
[error] --- Traceback --- end --------------
Cfg:
[Combat]
Enabled: True
Map: E-2
FleetMode: striking
CombatNodes: 5
NodeSelects:
RetreatLimit: heavy
RepairLimit: moderate
RepairTimeLimit: 0100
LBASGroups: 1
LBASGroup1Nodes: P,P
LBASGroup2Nodes:
LBASGroup3Nodes:
MiscOptions: CheckFatigue,PortCheck
I've been unable to startup KCauto-Kai. Here's the log command prompt returned.
C:\Users[REDACTED]>java -jar "C:\Users[REDACTED]\Desktop\KC Auto Kai\SikuliX\sikulix.jar" -r "C:\Users[REDACTED]\Desktop\KC Auto Kai\kcauto-kai-master\kcauto-kai.sikuli"
�[94m[2017-11-28 00:20:05] Initializing config module�[0m
�[94m[2017-11-28 00:20:05] Reading config�[0m
�[94m[2017-11-28 00:20:05] Validating config�[0m
�[94m[2017-11-28 00:20:05] Starting kancolle-auto!�[0m
[log] App.focus: [3544:Chrome]
[log] App.focus: [3544:Chrome]
[error] script [ C:\Users[REDACTED]\Desktop\KC Auto Kai\kcauto-kai-master\kcauto-kai.sikuli ] stopped with error in line 76
[error] AttributeError ( 'NoneType' object has no attribute 'mouseMove' )
[error] --- Traceback --- error source first
line: module ( function ) statement
27: recovery ( recover ) kc_region.mouseMove(Location(0, 0))
[error] --- Traceback --- end --------------
I replaced all instances of my name with [REDACTED]. Hope that won't harm the debugging.
EDIT: I also tried to do what is listed on the original kcauto page for AttributeError ( 'NoneType' object has no attribute 'x' ) error, but it's still not working.
When using Engine: live
, not defining anything under Formations:
will cause the script to crash.
Relevant stack trace:
[error] script [ /home/ttk/kcauto-kai/kcauto-kai.sikuli ] stopped with error in line 64
[error] KeyError ( 'formations' )
[error] --- Traceback --- error source first
line: module ( function ) statement
616: combat ( _resolve_formation ) custom_formations = self.config.combat['formations']
471: combat ( _run_loop_between_nodes ) formations = self._resolve_formation()
309: combat ( _run_combat_logic ) at_node = self._run_loop_between_nodes()
113: combat ( combat_logic_wrapper ) self._run_combat_logic()
310: main ( run_combat_cycle ) if self.modules['combat'].combat_logic_wrapper():
64: main ( <module> ) kcauto_kai.run_combat_cycle()
[error] --- Traceback --- end --------------
and/or more descriptive labels.
I used a translator. Please excuse.
In Orel process or other process, The repair docks are empty, there's a replacement submarines.
but process sleep 1 hour in expedition screen. Of course Scheduled Sleep is false.
5 cycle and 1 hour break, n cycle 1 hour break..
I think the program has more sleep time than I think.
By what standards does the resting process work?
Can I change this break time or frequency?
By using a translator, this issue could look offensive. But please forgive me for I have no such intention. I would like you to accept it as either a just question or a suggestion.
Related but not completely overlapping with #16.
Immediate goals:
Goals for 1.0.0 release:
Post-1.0.0 release goals:
Will spin out additional tickets as needed.
Can we get separate sleep system for expedition and combat?
Ex.Combat 3 hour a day but keep expedition 21 hour a day.
edit: to clarify, bring back the ability to stop the script based on time or combat count.
As an added feature, add in the ability to just stop the combat module based on time or combat count.
Reminder to self: there's a reliance on the Quest module in the PvP module which causes the script to crash if PvP is on but Quest is not. Remove this.
Fleet, Util, Combat?
For live combat engine.
Reported on Discord. webUI issue.
Drag+Drop and/or Dialog option to import config file to easily populate the config screen.
Given the Fleet4: 9998
parameter, the 4th fleet has been sent to the expedition # 33 (W5) actually.
So it comes to my attention that during combat the VM slows down and lags constantly. Checking process manager turns out that 100% CPU is being used. So I did a quick test with KCA and KCAK(KCA-kai) and take results for most basic functions of KCA:
Spec:
intel i5 6300HQ 2.3GHz turbo 3.2GHz - 2 Core 100% exec cap
1536MB RAM
128MB VRAM
So is the additional constant check of KCAK causing the spike in CPU consumption? And can it be optimized like current KCA fork?
combat loop doesn't close if sortie ends on resource node, and causes the script to crash on an expedition return screen
[log] CLICK on L(507,319)@S(0)[0,0 1280x800] (542 msec)
�[94m[2018-02-26 11:50:11] Fleet 1 damage counts: 0 heavy / 3 moderate / 0 minor�[0m
�[94m[2018-02-26 11:50:20] Continuing sortie.�[0m
[log] CLICK on L(286,317)@S(0)[0,0 1280x800] (528 msec)
[error] script [ C:\Users\DJJMA\Downloads\kcauto-kai-master\kcauto-kai.sikuli ] stopped with error at line --unknown--
[error] Error caused by: Traceback (most recent call last):
File "C:\Users\DJJMA\Downloads\kcauto-kai-master\kcauto-kai.sikuli\kcauto-kai.py", line 65, in <module>
kcauto_kai.run_combat_cycle()
File "C:\Users\DJJMA\Downloads\kcauto-kai-master\kcauto-kai.sikuli\kcauto-kai.py", line 65, in <module>
kcauto_kai.run_combat_cycle()
File "C:\Users\DJJMA\Downloads\kcauto-kai-master\kcauto-kai.sikuli\main.py", line 329, in run_combat_cycle
self._run_fast_expedition_check()
File "C:\Users\DJJMA\Downloads\kcauto-kai-master\kcauto-kai.sikuli\main.py", line 215, in _run_fast_expedition_check
Nav.goto(self.regions, 'home')
File "C:\Users\DJJMA\Downloads\kcauto-kai-master\kcauto-kai.sikuli\nav.sikuli\nav.py", line 239, in goto
if current_location.name == 'home':
AttributeError: 'NoneType' object has no attribute 'name'
While not too difficult to implement, I don't know if people actually use it. Could people add a reaction to this with the thumbs up if you do, thumbs down if you don't?
I used a translator. I hope you will excuse me.
Are you considering creating a shortcut key to end the program?
When Fleet mode striking to go E6, I saw the program close after clicking on the third fleet. So I replaced fleet_3_active.png and combat_start_lbas.png, but the result was the same.
I want to send an error log, but I can't find the folder where the log is stored...
This is part of an error log that was captured instantaneously.
And, This is the contents of the config file.
config automatically generated from kcauto-kai frontend
[General]
Program: Chrome
JSTOffset: 0
[ScheduledSleep]
Enabled: False
StartTime: 0000
SleepLength: 4
[Expeditions]
Enabled: False
Fleet2: 2
Fleet3:
Fleet4: 38
[PvP]
Enabled: False
[Combat]
Enabled: True
Engine: live
Map: E-6
FleetMode: striking
CombatNodes: 7
NodeSelects:
Formations: 1:diamond,2:vanguard,3:vanguard,4:vanguard,5:diamond,6:line_ahead
NightBattles: 6:True
RetreatLimit: heavy
RepairLimit: minor
RepairTimeLimit: 0030
LBASGroups: 1,2,3
LBASGroup1Nodes: U,U
LBASGroup2Nodes: U,U
LBASGroup3Nodes: O,O
MiscOptions: CheckFatigue
[ShipSwitcher]
Enabled: False
Slot1Criteria:
Slot1Ships:
Slot2Criteria:
Slot2Ships:
Slot3Criteria:
Slot3Ships:
Slot4Criteria:
Slot4Ships:
Slot5Criteria:
Slot5Ships:
Slot6Criteria:
Slot6Ships:
[Quests]
Enabled: False
for event maps, players often want to farm maps on a lower difficulty before clearing. in order to avoid clearing the map by fully depleting the hp-bar players reset the difficulty before the hp-bar is fully depleted.
it would be nice if kca-kai could also reset the difficulty at the beginning of a session and then over and over after x amount of sorties.
_filter_ships()
might get multithreaded, which causes crashes - need to factor out and linearizeSome issues I've encountered so far:
light
under Retreat Limit
or Repair Limit
sets the config option to light
causing the script to crash, when it should be minor
The event is coming here!
Event-specific assets such as panel images, arrow images, and map JSON will be posted here (or post them here, if you'd like to share them).
I am working on KAGA - Discord (Yuu Bot) integration, would be nice to have resource reporting so users can query the status of the script and maybe more information like their resource count on our alt-discord server
And crashes/catbombs can be notified using PMs
Critical bug.
stuck on the battle report screen.
I've got following error message.
[log] App.focus: [4400:Chrome]
�[91m[2017-12-13 10:25:16] Irrecoverable crash�[0m
FindFailed: mvp_marker.png: (24x10) seen at (1506, 379) with 0.80 in R[1105,81 8
00x480]@S(0) E:Y, T:1.0
Line 2781, in file Region.java
[error] script [ C:\kcauto-kai\kcauto-kai.sikuli ] stopped with error in line 76
[error] FindFailed ( mvp_marker.png: (24x10) seen at (1506, 379) with 0.80 in R[
1105,81 800x480]@S(0) E:Y, T:1.0 )
[error] --- Traceback --- error source first
line: module ( function ) statement
341: combat ( _run_combat_logic ) self.regions['game'].wait('mvp_marker.png
', 30)
116: combat ( combat_logic_wrapper ) self._run_combat_logic()
313: main ( run_combat_cycle ) if self.modules['combat'].combat_logic_wrapp
er():
64: main ( <module> ) kcauto_kai.run_combat_cycle()
[error] --- Traceback --- end --------------
Option to use the Resupply Fairy for Expeditions vs going into the Resupply menu.
Might have to wrangle ConfigParser
a bit.
lbas_resupply_menu_button_event.png
doesn't exist in world 6 so the script fails to find the asset
The ring icon sometimes occludes the damage and fatigue icons. Attempt to alleviate false negatives that may arise due to occlusion.
Again.
Due to the design the pause wouldn't go into effect until a loop is complete.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.