Skip to content
This repository has been archived by the owner on Apr 19, 2022. It is now read-only.

Expeditions doesn't run. #371

Closed
Kiras756 opened this issue Jul 20, 2019 · 17 comments · Fixed by #375
Closed

Expeditions doesn't run. #371

Kiras756 opened this issue Jul 20, 2019 · 17 comments · Fixed by #375

Comments

@Kiras756
Copy link

Environment details

  • kcauto version (version on first line of CHANGELOG.md): 7.5.0
  • Viewer/browser: Opera
  • Operating system and/or VM: Windows XP SP3

Issue variability

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

Issue

Kcauto trying to sent expeditions, but fails every time. I'm tried to put lower text_similiarity, but without any effect.

Log

�[94m[2019-07-20 02:49:44] Initializing config module.�[0m
�[94m[2019-07-20 02:49:44] Reading config.�[0m
�[94m[2019-07-20 02:49:44] Starting kcauto!�[0m
[log] App.focus:  [2756:Opera]
�[94m[2019-07-20 02:49:52] At home�[0m
�[94m[2019-07-20 02:49:52] Refreshing home.�[0m
[log] CLICK on L(158,512)@S(0)[0,0 1280x1024] (515 msec)
[log] CLICK on L(159,567)@S(0)[0,0 1280x1024] (516 msec)
[log] App.focus:  [2756:Opera]
�[94m[2019-07-20 02:50:06] At home�[0m
�[94m[2019-07-20 02:50:06] Navigating to expedition screen.�[0m
[log] CLICK on L(341,595)@S(0)[0,0 1280x1024] (515 msec)
[log] CLICK on L(1073,547)@S(0)[0,0 1280x1024] (516 msec)
�[94m[2019-07-20 02:50:11] Sortieing fleet 2 to expedition 5�[0m
[log] CLICK on L(219,831)@S(0)[0,0 1280x1024] (516 msec)
�[91m[2019-07-20 02:50:16] Could not find desired expedition (5). Please make sure it is unlocked.�[0m
[info] Exit code: 1
@Kiras756
Copy link
Author

@mrmin123
Copy link
Collaborator

As of 7.5.0, the TEXT_SIMILARITY flag no longer has an impact on the expedition module as the expedition module is now mainly reliant on OCR. I believe the difference in font-rendering, however, continues to cause issues, even for OCR.

Could you add this line after line 188 in expedition.py and report back the logs?:

            print(expedition_name)

@mrmin123
Copy link
Collaborator

Also, try turning on ClearType..:

@Kiras756
Copy link
Author

Turning on ClearType has no effect.

Tried to put code-line
https://funkyimg.com/i/2VBM5.png
but KCauto returns an error

[error] script [ C:\Sikuli 1.1.3\kcauto-master\kcauto.sikuli ] stopped with error at line --unknown--
[error] Error caused by: Traceback (most recent call last):
  File "C:\Sikuli 1.1.3\kcauto-master\kcauto.sikuli\kcauto.py", line 15, in <module>
    from main import KCAuto  # noqa
  File "C:\Sikuli 1.1.3\kcauto-master\kcauto.sikuli\main.py", line 3, in <module>
    from expedition import ExpeditionModule, ExpeditionFleet
  File "C:\Application Data\Sikulix\Lib\sikuli\SikuliImporter.py", line 45, in load_module
    return self._load_module(module_name)
  File "C:\Application Data\Sikulix\Lib\sikuli\SikuliImporter.py", line 34, in _load_module
    return imp.load_module(fullname, file, pathname, desc)
  File "<string>", line None
SyntaxError: !!WHILE IMPORTING!! mismatched input '' expecting DEDENT (expedition.py, line 189)

@mrmin123
Copy link
Collaborator

Make sure you're using spaces to indent, not tabs.

@mrmin123
Copy link
Collaborator

Also, are you sure ClearType is turned on? I'd expect it to look like something like this, with anti-aliased fonts:

@Kiras756
Copy link
Author

Honestly, I see no effect on digits.
https://funkyimg.com/i/2VBN7.png

Make sure you're using spaces to indent, not tabs.
ow, okay, but nothing new

�[94m[2019-07-20 06:37:43] Initializing config module.�[0m
�[94m[2019-07-20 06:37:43] Reading config.�[0m
�[94m[2019-07-20 06:37:43] Starting kcauto!�[0m
[log] App.focus:  [3808:Opera]
�[94m[2019-07-20 06:37:51] At home�[0m
�[94m[2019-07-20 06:37:51] Refreshing home.�[0m
[log] CLICK on L(525,450)@S(0)[0,0 1280x1024] (531 msec)
[log] CLICK on L(158,536)@S(0)[0,0 1280x1024] (516 msec)
[log] App.focus:  [3808:Opera]
�[94m[2019-07-20 06:38:05] At home�[0m
�[94m[2019-07-20 06:38:05] Navigating to expedition screen.�[0m
[log] CLICK on L(345,543)@S(0)[0,0 1280x1024] (532 msec)
[log] CLICK on L(1097,447)@S(0)[0,0 1280x1024] (516 msec)
�[94m[2019-07-20 06:38:10] Sortieing fleet 2 to expedition 5�[0m
[log] CLICK on L(257,826)@S(0)[0,0 1280x1024] (516 msec)
�[91m[2019-07-20 06:38:15] Could not find desired expedition (5). Please make sure it is unlocked.�[0m
[info] Exit code: 1

@mrmin123
Copy link
Collaborator

Interesting. The issue isn't actually the OCR of the expedition number... it's the matching on the expedition rank:

image

(non-black in that square highlights differences)

Try changing line 182 from

            Pattern(rank_symbol).exact())

to

            rank_symbol)

If this also fails, you might have to generate your own captures of the expedition_rank_*.png assets for the moment...

@Kiras756
Copy link
Author

Changing line 182 helped! Now all expeditions successfully sent!

@mrmin123
Copy link
Collaborator

Cool. Let's keep this open for a bit more while I ascertain if this should be part of the main codebase or a spotfix.

@mrmin123 mrmin123 self-assigned this Jul 20, 2019
@mrmin123 mrmin123 added the bug label Jul 20, 2019
@Kiras756
Copy link
Author

hmm
seems like not all is good
sometimes KCauto return the same error, what before

�[94m[2019-07-20 06:56:09] Initializing config module.�[0m
�[94m[2019-07-20 06:56:09] Reading config.�[0m
�[94m[2019-07-20 06:56:09] Starting kcauto!�[0m
[log] App.focus:  [2580:Opera]
�[94m[2019-07-20 06:56:17] At home�[0m
�[94m[2019-07-20 06:56:17] Refreshing home.�[0m
[log] CLICK on L(503,489)@S(0)[0,0 1280x1024] (516 msec)
[log] CLICK on L(152,524)@S(0)[0,0 1280x1024] (516 msec)
[log] App.focus:  [2580:Opera]
�[94m[2019-07-20 06:56:32] At home�[0m
�[94m[2019-07-20 06:56:32] Navigating to expedition screen.�[0m
[log] CLICK on L(300,478)@S(0)[0,0 1280x1024] (516 msec)
[log] CLICK on L(988,387)@S(0)[0,0 1280x1024] (516 msec)
�[94m[2019-07-20 06:56:37] Sortieing fleet 2 to expedition 5�[0m
[log] CLICK on L(210,828)@S(0)[0,0 1280x1024] (516 msec)
05
�[94m[2019-07-20 06:56:43] Click position 780,585.�[0m
[log] CLICK on L(1106,830)@S(0)[0,0 1280x1024] (516 msec)
�[93m[2019-07-20 06:56:48] Fleet needs resupply!�[0m
[log] CLICK on L(772,807)@S(0)[0,0 1280x1024] (516 msec)
�[94m[2019-07-20 06:56:49] Resupplying with supply fairy.�[0m
[log] CLICK on L(853,793)@S(0)[0,0 1280x1024] (516 msec)
�[94m[2019-07-20 06:56:55] Fleet 2 sortied. Expected return time: 2019-07-20 08:26:25�[0m
�[94m[2019-07-20 06:56:59] Sortieing fleet 3 to expedition 21�[0m
[log] CLICK on L(344,831)@S(0)[0,0 1280x1024] (516 msec)
21
�[94m[2019-07-20 06:57:04] Click position 432,600.�[0m
[log] CLICK on L(993,820)@S(0)[0,0 1280x1024] (516 msec)
[log] CLICK on L(654,326)@S(0)[0,0 1280x1024] (516 msec)
�[93m[2019-07-20 06:57:12] Fleet needs resupply!�[0m
[log] CLICK on L(765,797)@S(0)[0,0 1280x1024] (515 msec)
�[94m[2019-07-20 06:57:13] Resupplying with supply fairy.�[0m
[log] CLICK on L(1059,835)@S(0)[0,0 1280x1024] (516 msec)
�[94m[2019-07-20 06:57:18] Fleet 3 sortied. Expected return time: 2019-07-20 09:16:48�[0m
�[94m[2019-07-20 06:57:24] Sortieing fleet 4 to expedition 38�[0m
[log] CLICK on L(531,825)@S(0)[0,0 1280x1024] (516 msec)
37
35
36
39
38
�[94m[2019-07-20 06:57:29] Click position 556,643.�[0m
[log] CLICK on L(1154,845)@S(0)[0,0 1280x1024] (515 msec)
[log] CLICK on L(704,310)@S(0)[0,0 1280x1024] (515 msec)
�[93m[2019-07-20 06:57:37] Fleet needs resupply!�[0m
[log] CLICK on L(768,797)@S(0)[0,0 1280x1024] (515 msec)
�[94m[2019-07-20 06:57:38] Resupplying with supply fairy.�[0m
[log] CLICK on L(989,804)@S(0)[0,0 1280x1024] (516 msec)
�[94m[2019-07-20 06:57:43] Fleet 4 sortied. Expected return time: 2019-07-20 09:52:13�[0m
�[92m[2019-07-20 06:57:48] End of cycle 1�[0m
�[92m[2019-07-20 06:57:48] Fleet 2: Expedition returns at 2019-07-20 08:26:25�[0m
�[92m[2019-07-20 06:57:48] Fleet 3: Expedition returns at 2019-07-20 09:16:48�[0m
�[92m[2019-07-20 06:57:48] Fleet 4: Expedition returns at 2019-07-20 09:52:13�[0m
�[92m[2019-07-20 06:57:48] Expeditions sent: 3 / received: 0�[0m
�[92m[2019-07-20 06:57:48] Resupplies: 0 || Fairy resupplies: 3�[0m
�[92m[2019-07-20 06:57:48] Recoveries done: 0�[0m
�[92m[2019-07-20 06:57:48] kcauto has been running for 0 hours 1 minutes (started on 2019-07-20 06:56:09)�[0m
�[94m[2019-07-20 08:26:48] At side menu�[0m
�[94m[2019-07-20 08:26:48] Going home.�[0m
[log] CLICK on L(44,535)@S(0)[0,0 1280x1024] (516 msec)
[log] CLICK on L(133,540)@S(0)[0,0 1280x1024] (515 msec)
�[94m[2019-07-20 08:26:56] Click position 658,332.�[0m
�[94m[2019-07-20 08:26:56] An expedition fleet has returned. Probably fleet 2�[0m
�[94m[2019-07-20 08:27:07] Click position 1053,345.�[0m
�[94m[2019-07-20 08:27:09] Click position 805,680.�[0m
[log] App.focus:  [2580:Opera]
�[94m[2019-07-20 08:27:18] At home�[0m
�[94m[2019-07-20 08:27:18] Navigating to expedition screen.�[0m
[log] CLICK on L(300,501)@S(0)[0,0 1280x1024] (516 msec)
[log] CLICK on L(1100,416)@S(0)[0,0 1280x1024] (516 msec)
�[94m[2019-07-20 08:27:25] Sortieing fleet 2 to expedition 5�[0m
[log] CLICK on L(217,834)@S(0)[0,0 1280x1024] (516 msec)
05
�[94m[2019-07-20 08:27:29] Click position 763,587.�[0m
[log] CLICK on L(1122,835)@S(0)[0,0 1280x1024] (515 msec)
�[93m[2019-07-20 08:27:35] Fleet needs resupply!�[0m
[log] CLICK on L(770,806)@S(0)[0,0 1280x1024] (516 msec)
�[94m[2019-07-20 08:27:36] Resupplying with supply fairy.�[0m
[log] CLICK on L(888,807)@S(0)[0,0 1280x1024] (515 msec)
�[94m[2019-07-20 08:27:41] Fleet 2 sortied. Expected return time: 2019-07-20 09:57:11�[0m
�[92m[2019-07-20 08:27:45] End of cycle 2�[0m
�[92m[2019-07-20 08:27:45] Fleet 2: Expedition returns at 2019-07-20 09:57:11�[0m
�[92m[2019-07-20 08:27:45] Fleet 3: Expedition returns at 2019-07-20 09:16:48�[0m
�[92m[2019-07-20 08:27:45] Fleet 4: Expedition returns at 2019-07-20 09:52:13�[0m
�[92m[2019-07-20 08:27:45] Expeditions sent: 4 (2.62/hr) / received: 1 (0.66/hr)�[0m
�[92m[2019-07-20 08:27:45] Resupplies: 0 || Fairy resupplies: 4 (2.62/hr)�[0m
�[92m[2019-07-20 08:27:45] Recoveries done: 0�[0m
�[92m[2019-07-20 08:27:45] kcauto has been running for 1 hours 31 minutes (started on 2019-07-20 06:56:09)�[0m
�[94m[2019-07-20 09:17:10] At side menu�[0m
�[94m[2019-07-20 09:17:10] Going home.�[0m
[log] CLICK on L(130,515)@S(0)[0,0 1280x1024] (516 msec)
�[94m[2019-07-20 09:17:15] Click position 597,608.�[0m
�[94m[2019-07-20 09:17:15] An expedition fleet has returned. Probably fleet 3�[0m
�[94m[2019-07-20 09:17:26] Click position 995,354.�[0m
�[94m[2019-07-20 09:17:29] Click position 804,333.�[0m
[log] App.focus:  [2580:Opera]
�[94m[2019-07-20 09:17:38] At home�[0m
�[94m[2019-07-20 09:17:38] Navigating to expedition screen.�[0m
[log] CLICK on L(318,549)@S(0)[0,0 1280x1024] (515 msec)
[log] CLICK on L(975,603)@S(0)[0,0 1280x1024] (516 msec)
�[94m[2019-07-20 09:17:42] Sortieing fleet 3 to expedition 21�[0m
[log] CLICK on L(358,830)@S(0)[0,0 1280x1024] (515 msec)
21
�[94m[2019-07-20 09:17:47] Click position 557,590.�[0m
[log] CLICK on L(1171,805)@S(0)[0,0 1280x1024] (515 msec)
[log] CLICK on L(658,328)@S(0)[0,0 1280x1024] (516 msec)
�[93m[2019-07-20 09:17:54] Fleet needs resupply!�[0m
[log] CLICK on L(765,804)@S(0)[0,0 1280x1024] (515 msec)
�[94m[2019-07-20 09:17:55] Resupplying with supply fairy.�[0m
[log] CLICK on L(1064,809)@S(0)[0,0 1280x1024] (515 msec)
�[94m[2019-07-20 09:18:00] Fleet 3 sortied. Expected return time: 2019-07-20 11:37:30�[0m
�[92m[2019-07-20 09:18:05] End of cycle 3�[0m
�[92m[2019-07-20 09:18:05] Fleet 2: Expedition returns at 2019-07-20 09:57:11�[0m
�[92m[2019-07-20 09:18:05] Fleet 3: Expedition returns at 2019-07-20 11:37:30�[0m
�[92m[2019-07-20 09:18:05] Fleet 4: Expedition returns at 2019-07-20 09:52:13�[0m
�[92m[2019-07-20 09:18:05] Expeditions sent: 5 (2.11/hr) / received: 2 (0.85/hr)�[0m
�[92m[2019-07-20 09:18:05] Resupplies: 0 || Fairy resupplies: 5 (2.11/hr)�[0m
�[92m[2019-07-20 09:18:05] Recoveries done: 0�[0m
�[92m[2019-07-20 09:18:05] kcauto has been running for 2 hours 21 minutes (started on 2019-07-20 06:56:09)�[0m
�[94m[2019-07-20 09:52:27] At side menu�[0m
�[94m[2019-07-20 09:52:27] Going home.�[0m
[log] CLICK on L(139,531)@S(0)[0,0 1280x1024] (516 msec)
�[94m[2019-07-20 09:52:32] Click position 775,499.�[0m
�[94m[2019-07-20 09:52:32] An expedition fleet has returned. Probably fleet 4�[0m
�[94m[2019-07-20 09:52:43] Click position 1049,389.�[0m
�[94m[2019-07-20 09:52:45] Click position 995,502.�[0m
[log] App.focus:  [2580:Opera]
�[94m[2019-07-20 09:52:55] At home�[0m
�[94m[2019-07-20 09:52:55] Navigating to expedition screen.�[0m
[log] CLICK on L(339,547)@S(0)[0,0 1280x1024] (515 msec)
[log] CLICK on L(1089,476)@S(0)[0,0 1280x1024] (515 msec)
�[94m[2019-07-20 09:52:59] Sortieing fleet 4 to expedition 38�[0m
[log] CLICK on L(562,840)@S(0)[0,0 1280x1024] (515 msec)
�[91m[2019-07-20 09:53:04] Could not find desired expedition (38). Please make sure it is unlocked.�[0m
[info] Exit code: 1

It can happen right after start script or some time later, for a while I use wscript for restart KCauto every time after error exit.

@mrmin123
Copy link
Collaborator

@Kiras756 try increasing the wait in L171 (Util.kc_sleep(2)).

@Kiras756
Copy link
Author

I will report when pass enough time.

@Kiras756
Copy link
Author

Well, KCauto already run for about 20.5 hours without any error.

@mrmin123
Copy link
Collaborator

A combination of increasing the wait on L171 to 2 and increasing the region padding on L186 to 38 seems to have resolved the issue for most individuals reporting the issue. Will test a bit further before cutting a release.

@kenahamtan
Copy link

I started to have issue with exp 05 after 8/8 update. No issue with 15,25,35.

OCR of 05 became 0S

�]9;11;"java.exe: ExtSetAttributes(0x0E)"�\�]9;11;"java.exe: ExtSetAttributes(0x07)"�\�[94m[2019-08-09 07:42:08] Sortieing fleet 3 to expedition 5�[0m
�]9;11;"java.exe: ExtSetAttributes(0x09)"�\�]9;11;"java.exe: ExtSetAttributes(0x07)"�[log] CLICK on L(241,1012)@s(0)[0,0 1920x1080] (531 msec)
0S
06
07
�[91m[2019-08-09 07:42:13] Could not find desired expedition (5). Please make sure it is unlocked.�[0m
�]9;11;"java.exe: ExtSetAttributes(0x0C)"�\�]9;11;"java.exe: ExtSetAttributes(0x07)"�[info] Exit code: 1

@kenahamtan
Copy link

I added this after line 188 in expedition.py

expedition_name = expedition_name.replace('S', '5')

seems to work for exp 05 for now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants