Compare commits
46 Commits
dda9a54f86
...
dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
ff2f226713
|
|||
|
8177d0f56d
|
|||
|
b606108871
|
|||
|
be09b39bbe
|
|||
|
fafb9d5a5c
|
|||
|
998d52b56c
|
|||
|
3e6a82764a
|
|||
|
3cd8161afb
|
|||
|
02b8de6d18
|
|||
|
7a321eae48
|
|||
|
ad19268e5a
|
|||
|
8bc170e170
|
|||
|
1d618d1624
|
|||
|
9eb3bde649
|
|||
|
62ef4c733c
|
|||
|
27dbd31434
|
|||
|
74ef1a7b4d
|
|||
|
43282354cd
|
|||
|
f92d92aec0
|
|||
|
3a00c47125
|
|||
|
bca3395cb9
|
|||
|
766cb78377
|
|||
|
84acb67061
|
|||
|
9c07251669
|
|||
|
19272d6cbe
|
|||
|
f268cfeda8
|
|||
|
37b5d4e4d2
|
|||
|
29bd71ccc8
|
|||
|
d5f4891d4e
|
|||
|
9a500b9191
|
|||
|
180fa6aa7d
|
|||
|
4325118562
|
|||
|
2adf3f9efe
|
|||
|
648bbb8a63
|
|||
|
f73bba3e20
|
|||
|
e321fd7e28
|
|||
|
6215f061c8
|
|||
|
72a948da68
|
|||
|
c69a8543c6
|
|||
|
c16e50157e
|
|||
|
2cd705b5ba
|
|||
|
f70e75f1a6
|
|||
|
861cf9a2da
|
|||
|
437977ef63
|
|||
|
123c248f43
|
|||
|
1461cc41c6
|
|
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 6.2 KiB |
|
Before Width: | Height: | Size: 9.7 KiB After Width: | Height: | Size: 8.9 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 9.2 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 9.4 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 4.6 KiB |
|
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 7.2 KiB |
|
Before Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 9.9 KiB After Width: | Height: | Size: 9.4 KiB |
|
Before Width: | Height: | Size: 7.8 KiB After Width: | Height: | Size: 6.8 KiB |
|
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 6.5 KiB |
@@ -377,6 +377,7 @@ pre.rich-traceback-code {
|
||||
#pywebio-scope-scheduler-bar,
|
||||
#pywebio-scope-log-bar,
|
||||
#pywebio-scope-log,
|
||||
#pywebio-scope-daemon-log-bar,
|
||||
#pywebio-scope-daemon-overview #pywebio-scope-groups {
|
||||
font-weight: 500;
|
||||
margin: 0.3125rem;
|
||||
|
||||
@@ -133,12 +133,13 @@ pre.rich-traceback-code {
|
||||
color: #c9d1d9;
|
||||
}
|
||||
|
||||
#pywebio-scope-scheduler-bar,
|
||||
#pywebio-scope-log-bar,
|
||||
#pywebio-scope-log,
|
||||
#pywebio-scope-running,
|
||||
#pywebio-scope-pending,
|
||||
#pywebio-scope-waiting,
|
||||
#pywebio-scope-scheduler-bar,
|
||||
#pywebio-scope-log-bar,
|
||||
#pywebio-scope-log,
|
||||
#pywebio-scope-daemon-log-bar,
|
||||
#pywebio-scope-daemon-overview #pywebio-scope-groups {
|
||||
background-color: #2f3136;
|
||||
border: 1px solid #21262d;
|
||||
|
||||
@@ -133,12 +133,13 @@ pre.rich-traceback-code {
|
||||
border: 1px solid lightgrey;
|
||||
}
|
||||
|
||||
#pywebio-scope-scheduler-bar,
|
||||
#pywebio-scope-log-bar,
|
||||
#pywebio-scope-log,
|
||||
#pywebio-scope-running,
|
||||
#pywebio-scope-pending,
|
||||
#pywebio-scope-waiting,
|
||||
#pywebio-scope-scheduler-bar,
|
||||
#pywebio-scope-log-bar,
|
||||
#pywebio-scope-log,
|
||||
#pywebio-scope-daemon-log-bar,
|
||||
#pywebio-scope-daemon-overview #pywebio-scope-groups {
|
||||
background-color: white;
|
||||
border: 1px solid lightgrey;
|
||||
|
||||
|
After Width: | Height: | Size: 5.0 KiB |
|
After Width: | Height: | Size: 6.1 KiB |
|
After Width: | Height: | Size: 5.3 KiB |
|
After Width: | Height: | Size: 5.7 KiB |
|
After Width: | Height: | Size: 6.6 KiB |
|
After Width: | Height: | Size: 4.6 KiB |
|
After Width: | Height: | Size: 5.5 KiB |
|
After Width: | Height: | Size: 6.2 KiB |
|
After Width: | Height: | Size: 5.5 KiB |
|
After Width: | Height: | Size: 6.5 KiB |
|
After Width: | Height: | Size: 6.0 KiB |
|
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 5.8 KiB |
|
After Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 9.1 KiB After Width: | Height: | Size: 6.2 KiB |
|
Before Width: | Height: | Size: 9.6 KiB After Width: | Height: | Size: 6.5 KiB |
|
Before Width: | Height: | Size: 9.1 KiB After Width: | Height: | Size: 7.1 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 7.0 KiB |
|
Before Width: | Height: | Size: 7.2 KiB After Width: | Height: | Size: 8.0 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 8.1 KiB |
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 7.2 KiB |
|
Before Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 9.7 KiB |
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 6.7 KiB |
|
After Width: | Height: | Size: 6.4 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 7.1 KiB |
|
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 7.2 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 8.7 KiB After Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 6.0 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 9.1 KiB After Width: | Height: | Size: 9.8 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 9.1 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 6.9 KiB |
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 4.7 KiB |
|
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 4.6 KiB |
|
Before Width: | Height: | Size: 7.2 KiB |
|
Before Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 8.6 KiB After Width: | Height: | Size: 7.5 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 7.8 KiB |
|
Before Width: | Height: | Size: 7.2 KiB After Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 6.5 KiB |
|
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 4.8 KiB |
@@ -250,11 +250,8 @@
|
||||
}
|
||||
},
|
||||
"Momotalk": {
|
||||
"Scheduler": {
|
||||
"Enable": false,
|
||||
"NextRun": "2020-01-01 00:00:00",
|
||||
"Command": "Momotalk",
|
||||
"ServerUpdate": "04:00"
|
||||
"Momotalk": {
|
||||
"Enable": true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -770,7 +770,8 @@
|
||||
6,
|
||||
7,
|
||||
8,
|
||||
9
|
||||
9,
|
||||
10
|
||||
]
|
||||
},
|
||||
"Count": {
|
||||
@@ -792,7 +793,8 @@
|
||||
6,
|
||||
7,
|
||||
8,
|
||||
9
|
||||
9,
|
||||
10
|
||||
]
|
||||
},
|
||||
"Count": {
|
||||
@@ -814,7 +816,8 @@
|
||||
6,
|
||||
7,
|
||||
8,
|
||||
9
|
||||
9,
|
||||
10
|
||||
]
|
||||
},
|
||||
"Count": {
|
||||
@@ -1059,28 +1062,10 @@
|
||||
}
|
||||
},
|
||||
"Momotalk": {
|
||||
"Scheduler": {
|
||||
"Momotalk": {
|
||||
"Enable": {
|
||||
"type": "checkbox",
|
||||
"value": false,
|
||||
"option": [
|
||||
true,
|
||||
false
|
||||
]
|
||||
},
|
||||
"NextRun": {
|
||||
"type": "datetime",
|
||||
"value": "2020-01-01 00:00:00",
|
||||
"validate": "datetime"
|
||||
},
|
||||
"Command": {
|
||||
"type": "input",
|
||||
"value": "Momotalk",
|
||||
"display": "hide"
|
||||
},
|
||||
"ServerUpdate": {
|
||||
"type": "input",
|
||||
"value": "04:00",
|
||||
"value": true,
|
||||
"display": "hide"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,17 +156,17 @@ Bounty:
|
||||
Highway:
|
||||
Stage:
|
||||
value: 0
|
||||
option: [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]
|
||||
option: [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]
|
||||
Count: 2
|
||||
DesertRailroad:
|
||||
Stage:
|
||||
value: 0
|
||||
option: [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]
|
||||
option: [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]
|
||||
Count: 2
|
||||
Schoolhouse:
|
||||
Stage:
|
||||
value: 0
|
||||
option: [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]
|
||||
option: [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]
|
||||
Count: 2
|
||||
|
||||
Scrimmage:
|
||||
@@ -267,3 +267,10 @@ ItemStorage:
|
||||
stored: StoredTacticalChallengeTicket
|
||||
order: 6
|
||||
color: "#7ac8e5"
|
||||
|
||||
# ==================== Momotalk ====================
|
||||
|
||||
Momotalk:
|
||||
Enable:
|
||||
value: true
|
||||
display: hide
|
||||
@@ -33,7 +33,13 @@
|
||||
"tasks": [
|
||||
"Circle",
|
||||
"Task",
|
||||
"Mail",
|
||||
"Mail"
|
||||
]
|
||||
},
|
||||
"Tool": {
|
||||
"menu": "collapse",
|
||||
"page": "tool",
|
||||
"tasks": [
|
||||
"Momotalk"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -80,5 +80,12 @@ Reward:
|
||||
- Scheduler
|
||||
Mail:
|
||||
- Scheduler
|
||||
|
||||
# ==================== Tool ====================
|
||||
|
||||
Tool:
|
||||
menu: 'collapse'
|
||||
page: 'tool'
|
||||
tasks:
|
||||
Momotalk:
|
||||
- Scheduler
|
||||
- Momotalk
|
||||
@@ -87,15 +87,15 @@ class GeneratedConfig:
|
||||
Bounty_OnError = 'skip' # stop, skip
|
||||
|
||||
# Group `Highway`
|
||||
Highway_Stage = 0 # 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
|
||||
Highway_Stage = 0 # 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
|
||||
Highway_Count = 2
|
||||
|
||||
# Group `DesertRailroad`
|
||||
DesertRailroad_Stage = 0 # 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
|
||||
DesertRailroad_Stage = 0 # 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
|
||||
DesertRailroad_Count = 2
|
||||
|
||||
# Group `Schoolhouse`
|
||||
Schoolhouse_Stage = 0 # 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
|
||||
Schoolhouse_Stage = 0 # 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
|
||||
Schoolhouse_Count = 2
|
||||
|
||||
# Group `Scrimmage`
|
||||
@@ -166,3 +166,6 @@ class GeneratedConfig:
|
||||
ItemStorage_BountyTicket = {}
|
||||
ItemStorage_ScrimmageTicket = {}
|
||||
ItemStorage_TacticalChallengeTicket = {}
|
||||
|
||||
# Group `Momotalk`
|
||||
Momotalk_Enable = True
|
||||
|
||||
@@ -15,6 +15,10 @@
|
||||
"Reward": {
|
||||
"name": "Reward",
|
||||
"help": ""
|
||||
},
|
||||
"Tool": {
|
||||
"name": "Tools",
|
||||
"help": ""
|
||||
}
|
||||
},
|
||||
"Task": {
|
||||
@@ -251,7 +255,7 @@
|
||||
},
|
||||
"SecondCafe": {
|
||||
"name": "Second Floor",
|
||||
"help": "JP server only\nEnable auto switch to second floor and perform interaction"
|
||||
"help": "Enable auto switch to second floor and perform interaction"
|
||||
}
|
||||
},
|
||||
"Invitation": {
|
||||
@@ -502,7 +506,8 @@
|
||||
"6": "06 - Overpass F",
|
||||
"7": "07 - Overpass G",
|
||||
"8": "08 - Overpass H",
|
||||
"9": "09 - Overpass I"
|
||||
"9": "09 - Overpass I",
|
||||
"10": "10 - Overpass J"
|
||||
},
|
||||
"Count": {
|
||||
"name": "Sweep X times",
|
||||
@@ -526,7 +531,8 @@
|
||||
"6": "06 - Abandoned Train F",
|
||||
"7": "07 - Abandoned Train G",
|
||||
"8": "08 - Abandoned Train H",
|
||||
"9": "09 - Abandoned Train I"
|
||||
"9": "09 - Abandoned Train I",
|
||||
"10": "10 - Abandoned Train J"
|
||||
},
|
||||
"Count": {
|
||||
"name": "Sweep X times",
|
||||
@@ -550,7 +556,8 @@
|
||||
"6": "06 - Besieged Classroom F",
|
||||
"7": "07 - Besieged Classroom G",
|
||||
"8": "08 - Besieged Classroom H",
|
||||
"9": "09 - Besieged Classroom I"
|
||||
"9": "09 - Besieged Classroom I",
|
||||
"10": "10 - Besieged Classroom J"
|
||||
},
|
||||
"Count": {
|
||||
"name": "Sweep X times",
|
||||
@@ -846,6 +853,16 @@
|
||||
"help": ""
|
||||
}
|
||||
},
|
||||
"Momotalk": {
|
||||
"_info": {
|
||||
"name": "Momotalk",
|
||||
"help": "Tools need to stop the scheduler and then run independently"
|
||||
},
|
||||
"Enable": {
|
||||
"name": "",
|
||||
"help": ""
|
||||
}
|
||||
},
|
||||
"Gui": {
|
||||
"Aside": {
|
||||
"Install": "Install",
|
||||
|
||||
@@ -15,6 +15,10 @@
|
||||
"Reward": {
|
||||
"name": "收菜",
|
||||
"help": ""
|
||||
},
|
||||
"Tool": {
|
||||
"name": "工具",
|
||||
"help": ""
|
||||
}
|
||||
},
|
||||
"Task": {
|
||||
@@ -251,7 +255,7 @@
|
||||
},
|
||||
"SecondCafe": {
|
||||
"name": "第二咖啡厅",
|
||||
"help": "仅支持日服\n自动切换第二咖啡厅进行互动点击"
|
||||
"help": "自动切换第二咖啡厅进行互动点击"
|
||||
}
|
||||
},
|
||||
"Invitation": {
|
||||
@@ -502,7 +506,8 @@
|
||||
"6": "06 - 高架公路 F",
|
||||
"7": "07 - 高架公路 G",
|
||||
"8": "08 - 高架公路 H",
|
||||
"9": "09 - 高架公路 I"
|
||||
"9": "09 - 高架公路 I",
|
||||
"10": "10 - 高架公路 J"
|
||||
},
|
||||
"Count": {
|
||||
"name": "扫荡次数",
|
||||
@@ -526,7 +531,8 @@
|
||||
"6": "06 - 被遗弃的列车 F",
|
||||
"7": "07 - 被遗弃的列车 G",
|
||||
"8": "08 - 被遗弃的列车 H",
|
||||
"9": "09 - 被遗弃的列车 I"
|
||||
"9": "09 - 被遗弃的列车 I",
|
||||
"10": "10 - 被遗弃的列车 J"
|
||||
},
|
||||
"Count": {
|
||||
"name": "扫荡次数",
|
||||
@@ -550,7 +556,8 @@
|
||||
"6": "06 - 被袭击的教室 F",
|
||||
"7": "07 - 被袭击的教室 G",
|
||||
"8": "08 - 被袭击的教室 H",
|
||||
"9": "09 - 被袭击的教室 I"
|
||||
"9": "09 - 被袭击的教室 I",
|
||||
"10": "10 - 被袭击的教室 J"
|
||||
},
|
||||
"Count": {
|
||||
"name": "扫荡次数",
|
||||
@@ -846,6 +853,16 @@
|
||||
"help": ""
|
||||
}
|
||||
},
|
||||
"Momotalk": {
|
||||
"_info": {
|
||||
"name": "Momotalk",
|
||||
"help": "工具需要停止调度器再单独运行"
|
||||
},
|
||||
"Enable": {
|
||||
"name": "",
|
||||
"help": ""
|
||||
}
|
||||
},
|
||||
"Gui": {
|
||||
"Aside": {
|
||||
"Install": "安装",
|
||||
|
||||
@@ -611,7 +611,7 @@ class AlasGUI(Frame):
|
||||
[
|
||||
put_scope("scheduler-bar"),
|
||||
put_scope("groups"),
|
||||
put_scope("log-bar"),
|
||||
put_scope("daemon-log-bar"),
|
||||
put_scope("log", [put_html("")]),
|
||||
],
|
||||
)
|
||||
@@ -625,7 +625,7 @@ class AlasGUI(Frame):
|
||||
[
|
||||
put_scope(
|
||||
"_daemon_upper",
|
||||
[put_scope("scheduler-bar"), put_scope("log-bar")],
|
||||
[put_scope("scheduler-bar"), put_scope("daemon-log-bar")],
|
||||
),
|
||||
put_scope("groups"),
|
||||
put_scope("log", [put_html("")]),
|
||||
@@ -654,16 +654,17 @@ class AlasGUI(Frame):
|
||||
scope="scheduler_btn",
|
||||
)
|
||||
|
||||
with use_scope("log-bar"):
|
||||
put_text(t("Gui.Overview.Log")).style(
|
||||
"font-size: 1.25rem; margin: auto .5rem auto;"
|
||||
)
|
||||
put_scope(
|
||||
"log-bar-btns",
|
||||
[
|
||||
put_scope("log_scroll_btn"),
|
||||
],
|
||||
)
|
||||
with use_scope("daemon-log-bar"):
|
||||
with use_scope("log-title"):
|
||||
put_text(t("Gui.Overview.Log")).style(
|
||||
"font-size: 1.25rem; margin: auto .5rem auto;"
|
||||
)
|
||||
put_scope(
|
||||
"log-bar-btns",
|
||||
[
|
||||
put_scope("log_scroll_btn"),
|
||||
],
|
||||
)
|
||||
|
||||
switch_log_scroll = BinarySwitchButton(
|
||||
label_on=t("Gui.Button.ScrollON"),
|
||||
|
||||
@@ -6,11 +6,12 @@ from multiprocessing import Process
|
||||
from typing import Dict, List, Union
|
||||
|
||||
from filelock import FileLock
|
||||
from rich.console import Console, ConsoleRenderable
|
||||
|
||||
from module.config.utils import filepath_config
|
||||
from module.logger import logger, set_file_logger, set_func_logger
|
||||
from module.webui.fake import get_config_mod, mod_instance
|
||||
from module.webui.setting import State
|
||||
from rich.console import Console, ConsoleRenderable
|
||||
|
||||
|
||||
class ProcessManager:
|
||||
@@ -147,6 +148,10 @@ class ProcessManager:
|
||||
if e is not None:
|
||||
AzurLaneAutoScript.stop_event = e
|
||||
ArisuAutoSweeper(config_name=config_name).loop()
|
||||
elif func == "Momotalk":
|
||||
from tasks.momotalk.momotalk import MomoTalk
|
||||
|
||||
MomoTalk(config=config_name, task="Momotalk").run()
|
||||
else:
|
||||
logger.critical(f"No function matched: {func}")
|
||||
logger.info(f"[{config_name}] exited. Reason: Finish\n")
|
||||
|
||||
@@ -103,10 +103,10 @@ CIRCLE_CHECK = ButtonWrapper(
|
||||
),
|
||||
zht=Button(
|
||||
file='./assets/zht/base/page/CIRCLE_CHECK.png',
|
||||
area=(93, 3, 224, 39),
|
||||
search=(73, 0, 244, 59),
|
||||
color=(187, 197, 206),
|
||||
button=(93, 3, 224, 39),
|
||||
area=(106, 10, 161, 38),
|
||||
search=(86, 0, 181, 58),
|
||||
color=(154, 167, 180),
|
||||
button=(106, 10, 161, 38),
|
||||
),
|
||||
)
|
||||
COMMISSIONS_CHECK = ButtonWrapper(
|
||||
@@ -207,6 +207,13 @@ GACHA_CHECK = ButtonWrapper(
|
||||
)
|
||||
HOME = ButtonWrapper(
|
||||
name='HOME',
|
||||
jp=Button(
|
||||
file='./assets/jp/base/page/HOME.png',
|
||||
area=(1224, 10, 1250, 35),
|
||||
search=(1204, 0, 1270, 55),
|
||||
color=(162, 176, 202),
|
||||
button=(1224, 10, 1250, 35),
|
||||
),
|
||||
share=Button(
|
||||
file='./assets/share/base/page/HOME.png',
|
||||
area=(1218, 8, 1253, 41),
|
||||
@@ -251,6 +258,13 @@ MAIL_CHECK = ButtonWrapper(
|
||||
)
|
||||
MAIN_GO_TO_CAFE = ButtonWrapper(
|
||||
name='MAIN_GO_TO_CAFE',
|
||||
jp=Button(
|
||||
file='./assets/jp/base/page/MAIN_GO_TO_CAFE.png',
|
||||
area=(86, 632, 113, 670),
|
||||
search=(66, 612, 133, 690),
|
||||
color=(174, 222, 246),
|
||||
button=(86, 632, 113, 670),
|
||||
),
|
||||
share=Button(
|
||||
file='./assets/share/base/page/MAIN_GO_TO_CAFE.png',
|
||||
area=(81, 638, 102, 668),
|
||||
@@ -261,6 +275,13 @@ MAIN_GO_TO_CAFE = ButtonWrapper(
|
||||
)
|
||||
MAIN_GO_TO_CIRCLE = ButtonWrapper(
|
||||
name='MAIN_GO_TO_CIRCLE',
|
||||
jp=Button(
|
||||
file='./assets/jp/base/page/MAIN_GO_TO_CIRCLE.png',
|
||||
area=(531, 631, 561, 659),
|
||||
search=(511, 611, 581, 679),
|
||||
color=(182, 230, 254),
|
||||
button=(531, 631, 561, 659),
|
||||
),
|
||||
share=Button(
|
||||
file='./assets/share/base/page/MAIN_GO_TO_CIRCLE.png',
|
||||
area=(542, 630, 581, 665),
|
||||
@@ -271,6 +292,13 @@ MAIN_GO_TO_CIRCLE = ButtonWrapper(
|
||||
)
|
||||
MAIN_GO_TO_CRAFTING = ButtonWrapper(
|
||||
name='MAIN_GO_TO_CRAFTING',
|
||||
jp=Button(
|
||||
file='./assets/jp/base/page/MAIN_GO_TO_CRAFTING.png',
|
||||
area=(645, 627, 667, 662),
|
||||
search=(625, 607, 687, 682),
|
||||
color=(206, 235, 251),
|
||||
button=(645, 627, 667, 662),
|
||||
),
|
||||
share=Button(
|
||||
file='./assets/share/base/page/MAIN_GO_TO_CRAFTING.png',
|
||||
area=(665, 622, 693, 664),
|
||||
@@ -281,6 +309,13 @@ MAIN_GO_TO_CRAFTING = ButtonWrapper(
|
||||
)
|
||||
MAIN_GO_TO_GACHA = ButtonWrapper(
|
||||
name='MAIN_GO_TO_GACHA',
|
||||
jp=Button(
|
||||
file='./assets/jp/base/page/MAIN_GO_TO_GACHA.png',
|
||||
area=(871, 626, 893, 671),
|
||||
search=(851, 606, 913, 691),
|
||||
color=(172, 223, 242),
|
||||
button=(871, 626, 893, 671),
|
||||
),
|
||||
share=Button(
|
||||
file='./assets/share/base/page/MAIN_GO_TO_GACHA.png',
|
||||
area=(900, 623, 924, 670),
|
||||
@@ -291,6 +326,13 @@ MAIN_GO_TO_GACHA = ButtonWrapper(
|
||||
)
|
||||
MAIN_GO_TO_MAIL = ButtonWrapper(
|
||||
name='MAIN_GO_TO_MAIL',
|
||||
jp=Button(
|
||||
file='./assets/jp/base/page/MAIN_GO_TO_MAIL.png',
|
||||
area=(1144, 27, 1165, 44),
|
||||
search=(1124, 7, 1185, 64),
|
||||
color=(102, 125, 168),
|
||||
button=(1144, 27, 1165, 44),
|
||||
),
|
||||
share=Button(
|
||||
file='./assets/share/base/page/MAIN_GO_TO_MAIL.png',
|
||||
area=(1130, 29, 1156, 49),
|
||||
@@ -301,26 +343,47 @@ MAIN_GO_TO_MAIL = ButtonWrapper(
|
||||
)
|
||||
MAIN_GO_TO_MOMOTALK = ButtonWrapper(
|
||||
name='MAIN_GO_TO_MOMOTALK',
|
||||
jp=Button(
|
||||
file='./assets/jp/base/page/MAIN_GO_TO_MOMOTALK.png',
|
||||
area=(125, 118, 146, 151),
|
||||
search=(105, 98, 166, 171),
|
||||
color=(244, 200, 211),
|
||||
button=(125, 118, 146, 151),
|
||||
),
|
||||
share=Button(
|
||||
file='./assets/share/base/page/MAIN_GO_TO_MOMOTALK.png',
|
||||
area=(154, 134, 177, 158),
|
||||
search=(134, 114, 197, 178),
|
||||
color=(255, 219, 227),
|
||||
button=(154, 134, 177, 158),
|
||||
area=(138, 130, 159, 161),
|
||||
search=(118, 110, 179, 181),
|
||||
color=(251, 215, 224),
|
||||
button=(138, 130, 159, 161),
|
||||
),
|
||||
)
|
||||
MAIN_GO_TO_PURCHASE = ButtonWrapper(
|
||||
name='MAIN_GO_TO_PURCHASE',
|
||||
jp=Button(
|
||||
file='./assets/jp/base/page/MAIN_GO_TO_PURCHASE.png',
|
||||
area=(122, 209, 148, 243),
|
||||
search=(102, 189, 168, 263),
|
||||
color=(190, 222, 246),
|
||||
button=(122, 209, 148, 243),
|
||||
),
|
||||
share=Button(
|
||||
file='./assets/share/base/page/MAIN_GO_TO_PURCHASE.png',
|
||||
area=(148, 204, 183, 253),
|
||||
search=(128, 184, 203, 273),
|
||||
color=(172, 214, 239),
|
||||
button=(148, 204, 183, 253),
|
||||
area=(136, 210, 165, 250),
|
||||
search=(116, 190, 185, 270),
|
||||
color=(175, 216, 240),
|
||||
button=(136, 210, 165, 250),
|
||||
),
|
||||
)
|
||||
MAIN_GO_TO_SCHEDULE = ButtonWrapper(
|
||||
name='MAIN_GO_TO_SCHEDULE',
|
||||
jp=Button(
|
||||
file='./assets/jp/base/page/MAIN_GO_TO_SCHEDULE.png',
|
||||
area=(198, 634, 217, 667),
|
||||
search=(178, 614, 237, 687),
|
||||
color=(176, 222, 243),
|
||||
button=(198, 634, 217, 667),
|
||||
),
|
||||
share=Button(
|
||||
file='./assets/share/base/page/MAIN_GO_TO_SCHEDULE.png',
|
||||
area=(194, 638, 216, 672),
|
||||
@@ -331,6 +394,13 @@ MAIN_GO_TO_SCHEDULE = ButtonWrapper(
|
||||
)
|
||||
MAIN_GO_TO_SHOP = ButtonWrapper(
|
||||
name='MAIN_GO_TO_SHOP',
|
||||
jp=Button(
|
||||
file='./assets/jp/base/page/MAIN_GO_TO_SHOP.png',
|
||||
area=(752, 628, 786, 665),
|
||||
search=(732, 608, 806, 685),
|
||||
color=(168, 221, 248),
|
||||
button=(752, 628, 786, 665),
|
||||
),
|
||||
share=Button(
|
||||
file='./assets/share/base/page/MAIN_GO_TO_SHOP.png',
|
||||
area=(773, 630, 816, 667),
|
||||
@@ -341,36 +411,43 @@ MAIN_GO_TO_SHOP = ButtonWrapper(
|
||||
)
|
||||
MAIN_GO_TO_TASK = ButtonWrapper(
|
||||
name='MAIN_GO_TO_TASK',
|
||||
jp=Button(
|
||||
file='./assets/jp/base/page/MAIN_GO_TO_TASK.png',
|
||||
area=(30, 214, 55, 248),
|
||||
search=(10, 194, 75, 268),
|
||||
color=(186, 218, 245),
|
||||
button=(30, 214, 55, 248),
|
||||
),
|
||||
share=Button(
|
||||
file='./assets/share/base/page/MAIN_GO_TO_TASK.png',
|
||||
area=(52, 220, 78, 248),
|
||||
search=(32, 200, 98, 268),
|
||||
color=(226, 207, 203),
|
||||
button=(52, 220, 78, 248),
|
||||
area=(47, 219, 70, 246),
|
||||
search=(27, 199, 90, 266),
|
||||
color=(212, 204, 208),
|
||||
button=(47, 219, 70, 246),
|
||||
),
|
||||
)
|
||||
MAIN_GO_TO_WORK = ButtonWrapper(
|
||||
name='MAIN_GO_TO_WORK',
|
||||
jp=Button(
|
||||
file='./assets/jp/base/page/MAIN_GO_TO_WORK.png',
|
||||
area=(1167, 605, 1241, 632),
|
||||
search=(1147, 585, 1261, 652),
|
||||
color=(135, 149, 169),
|
||||
button=(1167, 605, 1241, 632),
|
||||
area=(1167, 668, 1222, 688),
|
||||
search=(1147, 648, 1242, 708),
|
||||
color=(141, 156, 174),
|
||||
button=(1167, 668, 1222, 688),
|
||||
),
|
||||
en=Button(
|
||||
file='./assets/en/base/page/MAIN_GO_TO_WORK.png',
|
||||
area=(1127, 605, 1250, 637),
|
||||
search=(1107, 585, 1270, 657),
|
||||
color=(90, 112, 141),
|
||||
button=(1127, 605, 1250, 637),
|
||||
area=(1143, 591, 1241, 613),
|
||||
search=(1123, 571, 1261, 633),
|
||||
color=(110, 129, 154),
|
||||
button=(1143, 591, 1241, 613),
|
||||
),
|
||||
zht=Button(
|
||||
file='./assets/zht/base/page/MAIN_GO_TO_WORK.png',
|
||||
area=(1167, 595, 1277, 637),
|
||||
search=(1147, 575, 1280, 657),
|
||||
color=(73, 100, 133),
|
||||
button=(1167, 595, 1277, 637),
|
||||
area=(1188, 586, 1241, 613),
|
||||
search=(1168, 566, 1261, 633),
|
||||
color=(141, 155, 174),
|
||||
button=(1188, 586, 1241, 613),
|
||||
),
|
||||
)
|
||||
MISSION_CHECK = ButtonWrapper(
|
||||
@@ -399,6 +476,13 @@ MISSION_CHECK = ButtonWrapper(
|
||||
)
|
||||
MOMOTALK_CHECK = ButtonWrapper(
|
||||
name='MOMOTALK_CHECK',
|
||||
jp=Button(
|
||||
file='./assets/jp/base/page/MOMOTALK_CHECK.png',
|
||||
area=(144, 107, 169, 130),
|
||||
search=(124, 87, 189, 150),
|
||||
color=(253, 211, 219),
|
||||
button=(144, 107, 169, 130),
|
||||
),
|
||||
share=Button(
|
||||
file='./assets/share/base/page/MOMOTALK_CHECK.png',
|
||||
area=(144, 107, 169, 130),
|
||||
@@ -589,48 +673,48 @@ WORK_GO_TO_BOUNTY = ButtonWrapper(
|
||||
name='WORK_GO_TO_BOUNTY',
|
||||
jp=Button(
|
||||
file='./assets/jp/base/page/WORK_GO_TO_BOUNTY.png',
|
||||
area=(667, 383, 764, 409),
|
||||
search=(647, 363, 784, 429),
|
||||
color=(171, 187, 212),
|
||||
button=(667, 383, 764, 409),
|
||||
area=(679, 401, 741, 417),
|
||||
search=(659, 381, 761, 437),
|
||||
color=(155, 164, 186),
|
||||
button=(679, 401, 741, 417),
|
||||
),
|
||||
en=Button(
|
||||
file='./assets/en/base/page/WORK_GO_TO_BOUNTY.png',
|
||||
area=(671, 409, 760, 440),
|
||||
search=(651, 389, 780, 460),
|
||||
color=(183, 202, 227),
|
||||
button=(671, 409, 760, 440),
|
||||
area=(668, 385, 756, 412),
|
||||
search=(648, 365, 776, 432),
|
||||
color=(180, 198, 223),
|
||||
button=(668, 385, 756, 412),
|
||||
),
|
||||
zht=Button(
|
||||
file='./assets/zht/base/page/WORK_GO_TO_BOUNTY.png',
|
||||
area=(668, 410, 770, 438),
|
||||
search=(648, 390, 790, 458),
|
||||
color=(170, 185, 211),
|
||||
button=(668, 410, 770, 438),
|
||||
area=(667, 383, 769, 410),
|
||||
search=(647, 363, 789, 430),
|
||||
color=(169, 184, 209),
|
||||
button=(667, 383, 769, 410),
|
||||
),
|
||||
)
|
||||
WORK_GO_TO_COMMISSIONS = ButtonWrapper(
|
||||
name='WORK_GO_TO_COMMISSIONS',
|
||||
jp=Button(
|
||||
file='./assets/jp/base/page/WORK_GO_TO_COMMISSIONS.png',
|
||||
area=(653, 475, 749, 501),
|
||||
search=(633, 455, 769, 521),
|
||||
color=(171, 185, 208),
|
||||
button=(653, 475, 749, 501),
|
||||
area=(661, 504, 724, 521),
|
||||
search=(641, 484, 744, 541),
|
||||
color=(155, 163, 184),
|
||||
button=(661, 504, 724, 521),
|
||||
),
|
||||
en=Button(
|
||||
file='./assets/en/base/page/WORK_GO_TO_COMMISSIONS.png',
|
||||
area=(656, 494, 803, 517),
|
||||
search=(636, 474, 823, 537),
|
||||
color=(192, 204, 221),
|
||||
button=(656, 494, 803, 517),
|
||||
area=(653, 477, 787, 496),
|
||||
search=(633, 457, 807, 516),
|
||||
color=(187, 199, 218),
|
||||
button=(653, 477, 787, 496),
|
||||
),
|
||||
zht=Button(
|
||||
file='./assets/zht/base/page/WORK_GO_TO_COMMISSIONS.png',
|
||||
area=(656, 492, 757, 519),
|
||||
search=(636, 472, 777, 539),
|
||||
color=(177, 190, 212),
|
||||
button=(656, 492, 757, 519),
|
||||
area=(654, 474, 753, 503),
|
||||
search=(634, 454, 773, 523),
|
||||
color=(179, 192, 213),
|
||||
button=(654, 474, 753, 503),
|
||||
),
|
||||
)
|
||||
WORK_GO_TO_EVENT = ButtonWrapper(
|
||||
@@ -661,95 +745,95 @@ WORK_GO_TO_MISSION = ButtonWrapper(
|
||||
name='WORK_GO_TO_MISSION',
|
||||
jp=Button(
|
||||
file='./assets/jp/base/page/WORK_GO_TO_MISSION.png',
|
||||
area=(722, 155, 807, 199),
|
||||
search=(702, 135, 827, 219),
|
||||
color=(173, 188, 211),
|
||||
button=(722, 155, 807, 199),
|
||||
area=(710, 220, 769, 249),
|
||||
search=(690, 200, 789, 269),
|
||||
color=(137, 153, 180),
|
||||
button=(710, 220, 769, 249),
|
||||
),
|
||||
en=Button(
|
||||
file='./assets/en/base/page/WORK_GO_TO_MISSION.png',
|
||||
area=(720, 160, 871, 206),
|
||||
search=(700, 140, 891, 226),
|
||||
color=(192, 204, 221),
|
||||
button=(720, 160, 871, 206),
|
||||
area=(721, 158, 873, 197),
|
||||
search=(701, 138, 893, 217),
|
||||
color=(180, 195, 215),
|
||||
button=(721, 158, 873, 197),
|
||||
),
|
||||
zht=Button(
|
||||
file='./assets/zht/base/page/WORK_GO_TO_MISSION.png',
|
||||
area=(719, 152, 805, 202),
|
||||
search=(699, 132, 825, 222),
|
||||
color=(182, 194, 214),
|
||||
button=(719, 152, 805, 202),
|
||||
area=(720, 152, 812, 200),
|
||||
search=(700, 132, 832, 220),
|
||||
color=(181, 195, 215),
|
||||
button=(720, 152, 812, 200),
|
||||
),
|
||||
)
|
||||
WORK_GO_TO_SCHOOL_EXCHANGE = ButtonWrapper(
|
||||
name='WORK_GO_TO_SCHOOL_EXCHANGE',
|
||||
jp=Button(
|
||||
file='./assets/jp/base/page/WORK_GO_TO_SCHOOL_EXCHANGE.png',
|
||||
area=(636, 566, 753, 592),
|
||||
search=(616, 546, 773, 612),
|
||||
color=(176, 187, 207),
|
||||
button=(636, 566, 753, 592),
|
||||
area=(642, 606, 721, 624),
|
||||
search=(622, 586, 741, 644),
|
||||
color=(167, 174, 192),
|
||||
button=(642, 606, 721, 624),
|
||||
),
|
||||
en=Button(
|
||||
file='./assets/en/base/page/WORK_GO_TO_SCHOOL_EXCHANGE.png',
|
||||
area=(643, 572, 778, 602),
|
||||
search=(623, 552, 798, 622),
|
||||
color=(190, 203, 221),
|
||||
button=(643, 572, 778, 602),
|
||||
area=(635, 569, 769, 597),
|
||||
search=(615, 549, 789, 617),
|
||||
color=(198, 204, 216),
|
||||
button=(635, 569, 769, 597),
|
||||
),
|
||||
zht=Button(
|
||||
file='./assets/zht/base/page/WORK_GO_TO_SCHOOL_EXCHANGE.png',
|
||||
area=(643, 575, 764, 601),
|
||||
search=(623, 555, 784, 621),
|
||||
color=(171, 185, 208),
|
||||
button=(643, 575, 764, 601),
|
||||
area=(635, 567, 761, 594),
|
||||
search=(615, 547, 781, 614),
|
||||
color=(181, 191, 209),
|
||||
button=(635, 567, 761, 594),
|
||||
),
|
||||
)
|
||||
WORK_GO_TO_STORY = ButtonWrapper(
|
||||
name='WORK_GO_TO_STORY',
|
||||
jp=Button(
|
||||
file='./assets/jp/base/page/WORK_GO_TO_STORY.png',
|
||||
area=(998, 155, 1078, 199),
|
||||
search=(978, 135, 1098, 219),
|
||||
color=(215, 221, 232),
|
||||
button=(998, 155, 1078, 199),
|
||||
area=(993, 220, 1081, 250),
|
||||
search=(973, 200, 1101, 270),
|
||||
color=(209, 214, 224),
|
||||
button=(993, 220, 1081, 250),
|
||||
),
|
||||
en=Button(
|
||||
file='./assets/en/base/page/WORK_GO_TO_STORY.png',
|
||||
area=(994, 159, 1109, 211),
|
||||
search=(974, 139, 1129, 231),
|
||||
color=(208, 215, 228),
|
||||
button=(994, 159, 1109, 211),
|
||||
area=(996, 159, 1112, 205),
|
||||
search=(976, 139, 1132, 225),
|
||||
color=(200, 209, 225),
|
||||
button=(996, 159, 1112, 205),
|
||||
),
|
||||
zht=Button(
|
||||
file='./assets/zht/base/page/WORK_GO_TO_STORY.png',
|
||||
area=(995, 153, 1086, 201),
|
||||
search=(975, 133, 1106, 221),
|
||||
color=(181, 192, 212),
|
||||
button=(995, 153, 1086, 201),
|
||||
area=(991, 152, 1093, 202),
|
||||
search=(971, 132, 1113, 222),
|
||||
color=(190, 200, 218),
|
||||
button=(991, 152, 1093, 202),
|
||||
),
|
||||
)
|
||||
WORK_GO_TO_TACTICAL_CHALLENGE = ButtonWrapper(
|
||||
name='WORK_GO_TO_TACTICAL_CHALLENGE',
|
||||
jp=Button(
|
||||
file='./assets/jp/base/page/WORK_GO_TO_TACTICAL_CHALLENGE.png',
|
||||
area=(801, 565, 920, 593),
|
||||
search=(781, 545, 940, 613),
|
||||
color=(172, 186, 209),
|
||||
button=(801, 565, 920, 593),
|
||||
area=(821, 600, 911, 620),
|
||||
search=(801, 580, 931, 640),
|
||||
color=(156, 164, 185),
|
||||
button=(821, 600, 911, 620),
|
||||
),
|
||||
en=Button(
|
||||
file='./assets/en/base/page/WORK_GO_TO_TACTICAL_CHALLENGE.png',
|
||||
area=(1012, 532, 1152, 591),
|
||||
search=(992, 512, 1172, 611),
|
||||
color=(199, 211, 227),
|
||||
button=(1012, 532, 1152, 591),
|
||||
area=(803, 566, 922, 623),
|
||||
search=(783, 546, 942, 643),
|
||||
color=(186, 201, 220),
|
||||
button=(803, 566, 922, 623),
|
||||
),
|
||||
zht=Button(
|
||||
file='./assets/zht/base/page/WORK_GO_TO_TACTICAL_CHALLENGE.png',
|
||||
area=(1014, 530, 1120, 569),
|
||||
search=(994, 510, 1140, 589),
|
||||
color=(190, 201, 219),
|
||||
button=(1014, 530, 1120, 569),
|
||||
area=(801, 564, 908, 595),
|
||||
search=(781, 544, 928, 615),
|
||||
color=(179, 192, 213),
|
||||
button=(801, 564, 908, 595),
|
||||
),
|
||||
)
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
from module.base.button import ButtonWrapper
|
||||
from module.base.decorator import run_once, Config
|
||||
from module.base.decorator import Config, run_once
|
||||
from module.base.timer import Timer
|
||||
from module.base.utils import get_color
|
||||
from module.exception import GameNotRunningError, GamePageUnknownError, RequestHumanTakeover
|
||||
from module.logger import logger
|
||||
from module.ocr.ocr import Ocr, Digit
|
||||
from module.ocr.ocr import Digit, Ocr
|
||||
from tasks.base.assets.assets_base_page import BACK
|
||||
from tasks.base.main_page import MainPage
|
||||
from tasks.base.page import Page, page_main
|
||||
@@ -23,7 +23,8 @@ class UI(MainPage):
|
||||
# temporary block check for jp
|
||||
@Config.when(Emulator_GameLanguage='jp')
|
||||
def appear_trademark_year(self):
|
||||
return False
|
||||
# this disables using back button in jp due to a login issue
|
||||
return True
|
||||
|
||||
@Config.when(Emulator_GameLanguage=None)
|
||||
def appear_trademark_year(self):
|
||||
|
||||
@@ -117,10 +117,10 @@ OCR_TICKET = ButtonWrapper(
|
||||
),
|
||||
zht=Button(
|
||||
file='./assets/zht/bounty/OCR_TICKET.png',
|
||||
area=(155, 81, 206, 119),
|
||||
search=(135, 61, 226, 139),
|
||||
color=(209, 217, 221),
|
||||
button=(155, 81, 206, 119),
|
||||
area=(168, 84, 219, 121),
|
||||
search=(148, 64, 239, 141),
|
||||
color=(202, 210, 216),
|
||||
button=(168, 84, 219, 121),
|
||||
),
|
||||
)
|
||||
SELECT_DESERT_RAILROAD = ButtonWrapper(
|
||||
|
||||
@@ -27,144 +27,96 @@ CAFE_FIRST = ButtonWrapper(
|
||||
name='CAFE_FIRST',
|
||||
jp=Button(
|
||||
file='./assets/jp/cafe/CAFE_FIRST.png',
|
||||
area=(82, 152, 136, 175),
|
||||
search=(62, 132, 156, 195),
|
||||
color=(111, 127, 147),
|
||||
button=(82, 152, 136, 175),
|
||||
area=(96, 92, 111, 110),
|
||||
search=(76, 72, 131, 130),
|
||||
color=(185, 192, 200),
|
||||
button=(96, 92, 111, 110),
|
||||
),
|
||||
en=Button(
|
||||
file='./assets/en/cafe/CAFE_FIRST.png',
|
||||
area=(82, 152, 136, 175),
|
||||
search=(62, 132, 156, 195),
|
||||
color=(111, 127, 147),
|
||||
button=(82, 152, 136, 175),
|
||||
area=(205, 96, 215, 107),
|
||||
search=(185, 76, 235, 127),
|
||||
color=(176, 184, 194),
|
||||
button=(205, 96, 215, 107),
|
||||
),
|
||||
zht=Button(
|
||||
file='./assets/zht/cafe/CAFE_FIRST.png',
|
||||
area=(82, 152, 136, 175),
|
||||
search=(62, 132, 156, 195),
|
||||
color=(111, 127, 147),
|
||||
button=(82, 152, 136, 175),
|
||||
area=(153, 93, 164, 109),
|
||||
search=(133, 73, 184, 129),
|
||||
color=(172, 180, 190),
|
||||
button=(153, 93, 164, 109),
|
||||
),
|
||||
)
|
||||
CAFE_INVITE = ButtonWrapper(
|
||||
name='CAFE_INVITE',
|
||||
jp=Button(
|
||||
file='./assets/jp/cafe/CAFE_INVITE.png',
|
||||
area=(816, 635, 845, 655),
|
||||
search=(796, 615, 865, 675),
|
||||
color=(173, 182, 192),
|
||||
button=(816, 635, 845, 655),
|
||||
area=(870, 637, 903, 663),
|
||||
search=(850, 617, 923, 683),
|
||||
color=(253, 217, 235),
|
||||
button=(870, 637, 903, 663),
|
||||
),
|
||||
en=Button(
|
||||
file='./assets/en/cafe/CAFE_INVITE.png',
|
||||
area=(816, 635, 845, 655),
|
||||
search=(796, 615, 865, 675),
|
||||
color=(173, 182, 192),
|
||||
button=(816, 635, 845, 655),
|
||||
area=(870, 637, 903, 663),
|
||||
search=(850, 617, 923, 683),
|
||||
color=(253, 217, 235),
|
||||
button=(870, 637, 903, 663),
|
||||
),
|
||||
zht=Button(
|
||||
file='./assets/zht/cafe/CAFE_INVITE.png',
|
||||
area=(816, 635, 845, 655),
|
||||
search=(796, 615, 865, 675),
|
||||
color=(173, 182, 192),
|
||||
button=(816, 635, 845, 655),
|
||||
area=(870, 637, 903, 663),
|
||||
search=(850, 617, 923, 683),
|
||||
color=(253, 217, 235),
|
||||
button=(870, 637, 903, 663),
|
||||
),
|
||||
)
|
||||
CAFE_INVITED = ButtonWrapper(
|
||||
name='CAFE_INVITED',
|
||||
jp=Button(
|
||||
file='./assets/jp/cafe/CAFE_INVITED.png',
|
||||
area=(815, 633, 847, 657),
|
||||
search=(795, 613, 867, 677),
|
||||
color=(144, 144, 146),
|
||||
button=(815, 633, 847, 657),
|
||||
area=(870, 637, 903, 663),
|
||||
search=(850, 617, 923, 683),
|
||||
color=(111, 109, 109),
|
||||
button=(870, 637, 903, 663),
|
||||
),
|
||||
en=Button(
|
||||
file='./assets/en/cafe/CAFE_INVITED.png',
|
||||
area=(815, 633, 847, 657),
|
||||
search=(795, 613, 867, 677),
|
||||
color=(144, 144, 146),
|
||||
button=(815, 633, 847, 657),
|
||||
area=(870, 637, 903, 663),
|
||||
search=(850, 617, 923, 683),
|
||||
color=(111, 109, 109),
|
||||
button=(870, 637, 903, 663),
|
||||
),
|
||||
zht=Button(
|
||||
file='./assets/zht/cafe/CAFE_INVITED.png',
|
||||
area=(815, 633, 847, 657),
|
||||
search=(795, 613, 867, 677),
|
||||
color=(144, 144, 146),
|
||||
button=(815, 633, 847, 657),
|
||||
area=(870, 637, 903, 663),
|
||||
search=(850, 617, 923, 683),
|
||||
color=(111, 109, 109),
|
||||
button=(870, 637, 903, 663),
|
||||
),
|
||||
)
|
||||
CAFE_SECOND = ButtonWrapper(
|
||||
name='CAFE_SECOND',
|
||||
jp=Button(
|
||||
file='./assets/jp/cafe/CAFE_SECOND.png',
|
||||
area=(219, 152, 279, 175),
|
||||
search=(199, 132, 299, 195),
|
||||
color=(110, 126, 146),
|
||||
button=(219, 152, 279, 175),
|
||||
area=(99, 92, 108, 110),
|
||||
search=(79, 72, 128, 130),
|
||||
color=(193, 200, 209),
|
||||
button=(99, 92, 108, 110),
|
||||
),
|
||||
en=Button(
|
||||
file='./assets/en/cafe/CAFE_SECOND.png',
|
||||
area=(219, 152, 279, 175),
|
||||
search=(199, 132, 299, 195),
|
||||
color=(110, 126, 146),
|
||||
button=(219, 152, 279, 175),
|
||||
area=(207, 96, 214, 107),
|
||||
search=(187, 76, 234, 127),
|
||||
color=(174, 182, 192),
|
||||
button=(207, 96, 214, 107),
|
||||
),
|
||||
zht=Button(
|
||||
file='./assets/zht/cafe/CAFE_SECOND.png',
|
||||
area=(219, 152, 279, 175),
|
||||
search=(199, 132, 299, 195),
|
||||
color=(110, 126, 146),
|
||||
button=(219, 152, 279, 175),
|
||||
),
|
||||
)
|
||||
CHANGE_CAFE_NOT_SELECTED = ButtonWrapper(
|
||||
name='CHANGE_CAFE_NOT_SELECTED',
|
||||
jp=Button(
|
||||
file='./assets/jp/cafe/CHANGE_CAFE_NOT_SELECTED.png',
|
||||
area=(84, 89, 178, 109),
|
||||
search=(64, 69, 198, 129),
|
||||
color=(185, 193, 203),
|
||||
button=(84, 89, 178, 109),
|
||||
),
|
||||
en=Button(
|
||||
file='./assets/en/cafe/CHANGE_CAFE_NOT_SELECTED.png',
|
||||
area=(84, 89, 178, 109),
|
||||
search=(64, 69, 198, 129),
|
||||
color=(185, 193, 203),
|
||||
button=(84, 89, 178, 109),
|
||||
),
|
||||
zht=Button(
|
||||
file='./assets/zht/cafe/CHANGE_CAFE_NOT_SELECTED.png',
|
||||
area=(84, 89, 178, 109),
|
||||
search=(64, 69, 198, 129),
|
||||
color=(185, 193, 203),
|
||||
button=(84, 89, 178, 109),
|
||||
),
|
||||
)
|
||||
CHANGE_CAFE_SELECTED = ButtonWrapper(
|
||||
name='CHANGE_CAFE_SELECTED',
|
||||
jp=Button(
|
||||
file='./assets/jp/cafe/CHANGE_CAFE_SELECTED.png',
|
||||
area=(40, 87, 191, 112),
|
||||
search=(20, 67, 211, 132),
|
||||
color=(82, 105, 130),
|
||||
button=(40, 87, 191, 112),
|
||||
),
|
||||
en=Button(
|
||||
file='./assets/en/cafe/CHANGE_CAFE_SELECTED.png',
|
||||
area=(40, 87, 191, 112),
|
||||
search=(20, 67, 211, 132),
|
||||
color=(82, 105, 130),
|
||||
button=(40, 87, 191, 112),
|
||||
),
|
||||
zht=Button(
|
||||
file='./assets/zht/cafe/CHANGE_CAFE_SELECTED.png',
|
||||
area=(40, 87, 191, 112),
|
||||
search=(20, 67, 211, 132),
|
||||
color=(82, 105, 130),
|
||||
button=(40, 87, 191, 112),
|
||||
area=(153, 93, 162, 110),
|
||||
search=(133, 73, 182, 130),
|
||||
color=(169, 178, 189),
|
||||
button=(153, 93, 162, 110),
|
||||
),
|
||||
)
|
||||
CHECK_MOMOTALK = ButtonWrapper(
|
||||
@@ -195,24 +147,24 @@ CHECK_REWARD = ButtonWrapper(
|
||||
name='CHECK_REWARD',
|
||||
jp=Button(
|
||||
file='./assets/jp/cafe/CHECK_REWARD.png',
|
||||
area=(1095, 621, 1146, 637),
|
||||
search=(1075, 601, 1166, 657),
|
||||
color=(82, 105, 129),
|
||||
button=(1086, 607, 1225, 685),
|
||||
area=(1120, 635, 1166, 651),
|
||||
search=(1100, 615, 1186, 671),
|
||||
color=(79, 102, 127),
|
||||
button=(1109, 627, 1239, 691),
|
||||
),
|
||||
en=Button(
|
||||
file='./assets/en/cafe/CHECK_REWARD.png',
|
||||
area=(1090, 613, 1229, 644),
|
||||
search=(1070, 593, 1249, 664),
|
||||
color=(64, 88, 115),
|
||||
button=(1086, 611, 1229, 685),
|
||||
area=(1116, 636, 1218, 654),
|
||||
search=(1096, 616, 1238, 674),
|
||||
color=(77, 100, 125),
|
||||
button=(1113, 625, 1239, 692),
|
||||
),
|
||||
zht=Button(
|
||||
file='./assets/zht/cafe/CHECK_REWARD.png',
|
||||
area=(1087, 609, 1222, 644),
|
||||
search=(1067, 589, 1242, 664),
|
||||
color=(70, 94, 120),
|
||||
button=(1086, 613, 1229, 682),
|
||||
area=(1125, 634, 1209, 651),
|
||||
search=(1105, 614, 1229, 671),
|
||||
color=(107, 128, 149),
|
||||
button=(1113, 626, 1237, 692),
|
||||
),
|
||||
)
|
||||
CLICKABLE_TEMPLATE = ButtonWrapper(
|
||||
@@ -363,10 +315,10 @@ INVITE_IN_SECOND = ButtonWrapper(
|
||||
),
|
||||
zht=Button(
|
||||
file='./assets/zht/cafe/INVITE_IN_SECOND.png',
|
||||
area=(482, 147, 799, 177),
|
||||
search=(462, 127, 819, 197),
|
||||
color=(166, 177, 188),
|
||||
button=(482, 147, 799, 177),
|
||||
area=(487, 146, 793, 178),
|
||||
search=(467, 126, 813, 198),
|
||||
color=(153, 165, 178),
|
||||
button=(487, 146, 793, 178),
|
||||
),
|
||||
)
|
||||
INVITE_IN_SECOND_CLOSE = ButtonWrapper(
|
||||
@@ -411,10 +363,10 @@ INVITE_SUBSTITUTE = ButtonWrapper(
|
||||
),
|
||||
zht=Button(
|
||||
file='./assets/zht/cafe/INVITE_SUBSTITUTE.png',
|
||||
area=(506, 157, 775, 186),
|
||||
search=(486, 137, 795, 206),
|
||||
color=(176, 186, 196),
|
||||
button=(673, 477, 857, 542),
|
||||
area=(580, 154, 701, 183),
|
||||
search=(560, 134, 721, 203),
|
||||
color=(147, 160, 174),
|
||||
button=(672, 475, 857, 544),
|
||||
),
|
||||
)
|
||||
INVITE_SUBSTITUTE_CLOSE = ButtonWrapper(
|
||||
@@ -517,24 +469,24 @@ OCR_CAFE = ButtonWrapper(
|
||||
name='OCR_CAFE',
|
||||
jp=Button(
|
||||
file='./assets/jp/cafe/OCR_CAFE.png',
|
||||
area=(1103, 642, 1202, 672),
|
||||
search=(1083, 622, 1222, 692),
|
||||
color=(87, 107, 129),
|
||||
button=(1103, 642, 1202, 672),
|
||||
area=(1127, 657, 1219, 682),
|
||||
search=(1107, 637, 1239, 702),
|
||||
color=(93, 112, 134),
|
||||
button=(1127, 657, 1219, 682),
|
||||
),
|
||||
en=Button(
|
||||
file='./assets/en/cafe/OCR_CAFE.png',
|
||||
area=(1105, 639, 1195, 674),
|
||||
search=(1085, 619, 1215, 694),
|
||||
color=(84, 104, 127),
|
||||
button=(1105, 639, 1195, 674),
|
||||
area=(1127, 657, 1219, 682),
|
||||
search=(1107, 637, 1239, 702),
|
||||
color=(93, 112, 134),
|
||||
button=(1127, 657, 1219, 682),
|
||||
),
|
||||
zht=Button(
|
||||
file='./assets/zht/cafe/OCR_CAFE.png',
|
||||
area=(1072, 639, 1232, 679),
|
||||
search=(1052, 619, 1252, 699),
|
||||
color=(71, 93, 118),
|
||||
button=(1072, 639, 1232, 679),
|
||||
area=(1127, 657, 1219, 682),
|
||||
search=(1107, 637, 1239, 702),
|
||||
color=(93, 112, 134),
|
||||
button=(1127, 657, 1219, 682),
|
||||
),
|
||||
)
|
||||
OCR_NAME = ButtonWrapper(
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
from enum import Enum
|
||||
|
||||
from module.base.decorator import Config
|
||||
from module.base.timer import Timer
|
||||
from module.logger import logger
|
||||
from module.ui.switch import Switch
|
||||
@@ -9,10 +8,6 @@ from tasks.cafe.assets.assets_cafe import *
|
||||
from tasks.cafe.invitation import handle_invitation
|
||||
from tasks.cafe.ui import CafeUI
|
||||
|
||||
SWITCH_CAFE = Switch('Cafe_switch')
|
||||
SWITCH_CAFE.add_state('off', CHANGE_CAFE_NOT_SELECTED)
|
||||
SWITCH_CAFE.add_state('on', CHANGE_CAFE_SELECTED)
|
||||
|
||||
SWITCH_CAFE_SELECT = Switch('Cafe_switch_select')
|
||||
SWITCH_CAFE_SELECT.add_state('1', CAFE_FIRST)
|
||||
SWITCH_CAFE_SELECT.add_state('2', CAFE_SECOND)
|
||||
@@ -30,16 +25,10 @@ class CafeStatus(Enum):
|
||||
|
||||
|
||||
class Cafe(CafeUI):
|
||||
@Config.when(Emulator_GameLanguage='jp')
|
||||
def _is_second_cafe_on(self):
|
||||
@property
|
||||
def is_second_cafe_on(self):
|
||||
return self.config.Cafe_SecondCafe
|
||||
|
||||
@Config.when(Emulator_GameLanguage=None)
|
||||
def _is_second_cafe_on(self):
|
||||
return False
|
||||
|
||||
is_second_cafe_on = property(_is_second_cafe_on)
|
||||
|
||||
def _handle_cafe(self, status):
|
||||
match status:
|
||||
case CafeStatus.STUDENT_LIST:
|
||||
@@ -71,7 +60,7 @@ class Cafe(CafeUI):
|
||||
if handle_invitation(self):
|
||||
return CafeStatus.CLICK
|
||||
case CafeStatus.CLICK:
|
||||
buttons = self.get_clickable_buttons(offset=(45, 10))
|
||||
buttons = self.get_clickable_buttons()
|
||||
self.click = len(buttons)
|
||||
logger.attr('Clickable', self.click)
|
||||
if not buttons:
|
||||
@@ -119,7 +108,6 @@ class Cafe(CafeUI):
|
||||
status = CafeStatus.STUDENT_LIST
|
||||
loading_timer = Timer(2).start()
|
||||
action_timer = Timer(1, count=1)
|
||||
is_list = False
|
||||
is_reset = False
|
||||
is_second = False
|
||||
is_enable = is_reward_on or is_touch_on
|
||||
@@ -136,11 +124,6 @@ class Cafe(CafeUI):
|
||||
if not loading_timer.reached():
|
||||
continue
|
||||
|
||||
if not is_list and status == CafeStatus.STUDENT_LIST and self.appear(STUDENT_LIST):
|
||||
is_list = True
|
||||
loading_timer = Timer(3).start()
|
||||
continue
|
||||
|
||||
if not is_reward_on and status == CafeStatus.OCR:
|
||||
logger.info('Skip reward')
|
||||
status = CafeStatus.CLICK
|
||||
@@ -157,26 +140,19 @@ class Cafe(CafeUI):
|
||||
continue
|
||||
|
||||
if self.is_second_cafe_on and not is_second and status == CafeStatus.FINISHED:
|
||||
if not SWITCH_CAFE.appear(main=self):
|
||||
logger.warning('Cafe switch not found')
|
||||
continue
|
||||
if SWITCH_CAFE.get(main=self) == 'off':
|
||||
SWITCH_CAFE.set('on', main=self)
|
||||
logger.info('Switching to second cafe')
|
||||
if not SWITCH_CAFE_SELECT.appear(main=self):
|
||||
logger.info('Cafe switch select not found')
|
||||
logger.info('Cafe switch not found')
|
||||
continue
|
||||
match (SWITCH_CAFE_SELECT.get(main=self)):
|
||||
match SWITCH_CAFE_SELECT.get(main=self):
|
||||
case '1':
|
||||
if self.click_with_interval(CAFE_SECOND):
|
||||
if self.click_with_interval(CAFE_FIRST):
|
||||
continue
|
||||
case '2':
|
||||
logger.info('Cafe second arrived')
|
||||
SWITCH_CAFE.set('off', main=self)
|
||||
status = CafeStatus.STUDENT_LIST
|
||||
is_list = False
|
||||
is_second = True
|
||||
self.check = 0
|
||||
loading_timer.reset().start()
|
||||
|
||||
if action_timer.reached_and_reset():
|
||||
logger.attr('Status', status)
|
||||
|
||||
@@ -6,7 +6,7 @@ import numpy as np
|
||||
|
||||
from module.base.base import ModuleBase
|
||||
from module.base.timer import Timer
|
||||
from module.base.utils import area_size, area_offset
|
||||
from module.base.utils import area_offset, area_size
|
||||
from module.config.utils import get_server_next_update
|
||||
from module.logger import logger
|
||||
from module.ocr.ocr import Ocr
|
||||
@@ -223,7 +223,7 @@ def handle_invitation_status(status: InvitationStatus, main: ModuleBase) -> Invi
|
||||
if not invitation.is_invitation:
|
||||
logger.info('Invitation waiting until next refresh')
|
||||
return InvitationStatus.FINISHED
|
||||
if main.appear(CAFE_INVITED):
|
||||
if main.match_color(CAFE_INVITED):
|
||||
logger.info('Invitation in cooldown')
|
||||
return InvitationStatus.FINISHED
|
||||
if invitation.choice != 'list_top' and invitation.target_name is None:
|
||||
@@ -243,7 +243,7 @@ def handle_invitation_status(status: InvitationStatus, main: ModuleBase) -> Invi
|
||||
case InvitationStatus.SELECT:
|
||||
if main.appear(INVITE_CONFIRM):
|
||||
return InvitationStatus.CONFIRM
|
||||
if main.config.LANG == 'jp' and main.appear(INVITE_IN_SECOND):
|
||||
if main.appear(INVITE_IN_SECOND):
|
||||
return InvitationStatus.IN_SECOND
|
||||
if main.appear(INVITE_SUBSTITUTE):
|
||||
return InvitationStatus.SUBSTITUTE
|
||||
|
||||
@@ -31,7 +31,7 @@ class CafeUI(UI):
|
||||
# generate result
|
||||
return cv2.bitwise_and(image, image, mask=mask)
|
||||
|
||||
def get_clickable_buttons(self, similarity=0.8, offset=(45, 10)):
|
||||
def get_clickable_buttons(self, similarity=0.8, offset=(40, 10)):
|
||||
image = self.extract_clickable_from_image(self.device.image)
|
||||
self.template.matched_button._button_offset = offset
|
||||
self.template.load_offset(self.template)
|
||||
|
||||
@@ -14,16 +14,16 @@ CIRCLE = ButtonWrapper(
|
||||
),
|
||||
en=Button(
|
||||
file='./assets/en/circle/CIRCLE.png',
|
||||
area=(197, 314, 229, 351),
|
||||
search=(177, 294, 249, 371),
|
||||
color=(173, 219, 236),
|
||||
area=(196, 314, 235, 355),
|
||||
search=(176, 294, 255, 375),
|
||||
color=(183, 221, 238),
|
||||
button=(191, 298, 434, 457),
|
||||
),
|
||||
zht=Button(
|
||||
file='./assets/zht/circle/CIRCLE.png',
|
||||
area=(197, 314, 229, 350),
|
||||
search=(177, 294, 249, 370),
|
||||
color=(171, 218, 236),
|
||||
area=(196, 314, 235, 355),
|
||||
search=(176, 294, 255, 375),
|
||||
color=(183, 221, 238),
|
||||
button=(190, 296, 433, 457),
|
||||
),
|
||||
)
|
||||
|
||||
@@ -28,7 +28,7 @@ class Circle(UI):
|
||||
self.click_with_interval(CIRCLE, 3)
|
||||
continue
|
||||
else:
|
||||
self.device.click(MAIN_GO_TO_CIRCLE)
|
||||
self.appear_then_click(MAIN_GO_TO_CIRCLE, 3)
|
||||
|
||||
def _handle_circle(self, status):
|
||||
match status:
|
||||
|
||||
@@ -5,21 +5,35 @@ from module.base.button import Button, ButtonWrapper
|
||||
|
||||
OCR_AP = ButtonWrapper(
|
||||
name='OCR_AP',
|
||||
jp=Button(
|
||||
file='./assets/jp/item/data/OCR_AP.png',
|
||||
area=(512, 13, 597, 32),
|
||||
search=(492, 0, 617, 52),
|
||||
color=(199, 204, 208),
|
||||
button=(512, 13, 597, 32),
|
||||
),
|
||||
share=Button(
|
||||
file='./assets/share/item/data/OCR_AP.png',
|
||||
area=(560, 11, 667, 37),
|
||||
search=(540, 0, 687, 57),
|
||||
color=(211, 216, 219),
|
||||
button=(560, 11, 667, 37),
|
||||
area=(535, 13, 660, 36),
|
||||
search=(515, 0, 680, 56),
|
||||
color=(207, 215, 220),
|
||||
button=(535, 13, 660, 36),
|
||||
),
|
||||
)
|
||||
OCR_DATA = ButtonWrapper(
|
||||
name='OCR_DATA',
|
||||
jp=Button(
|
||||
file='./assets/jp/item/data/OCR_DATA.png',
|
||||
area=(716, 14, 1058, 33),
|
||||
search=(696, 0, 1078, 53),
|
||||
color=(211, 219, 224),
|
||||
button=(716, 14, 1058, 33),
|
||||
),
|
||||
share=Button(
|
||||
file='./assets/share/item/data/OCR_DATA.png',
|
||||
area=(768, 12, 1072, 37),
|
||||
search=(748, 0, 1092, 57),
|
||||
color=(212, 220, 224),
|
||||
button=(768, 12, 1072, 37),
|
||||
area=(745, 11, 1069, 39),
|
||||
search=(725, 0, 1089, 59),
|
||||
color=(216, 223, 227),
|
||||
button=(745, 11, 1069, 39),
|
||||
),
|
||||
)
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import cv2
|
||||
import numpy as np
|
||||
|
||||
from module.base.base import ModuleBase
|
||||
from module.base.timer import Timer
|
||||
from module.base.utils import point_in_area, area_size
|
||||
from module.base.utils import area_size
|
||||
from module.logger import logger
|
||||
from module.ui.switch import Switch
|
||||
from tasks.base.page import page_main, page_momo_talk
|
||||
@@ -24,23 +22,19 @@ SWITCH_SORT.add_state("descending", SORT_DESCENDING)
|
||||
|
||||
"""Required for template matching as reply and story
|
||||
button can be found in different locations"""
|
||||
REPLY_TEMPLATE = REPLY.matched_button.image
|
||||
STORY_TEMPLATE = STORY.matched_button.image
|
||||
CHATTING_TEMPLATE = CHATTING.matched_button.image
|
||||
REPLY_TEMPLATE = REPLY
|
||||
STORY_TEMPLATE = STORY
|
||||
CHATTING_TEMPLATE = CHATTING
|
||||
|
||||
|
||||
class MomoTalkUI(UI):
|
||||
def __init__(self, config, device):
|
||||
super().__init__(config, device)
|
||||
self.swipe_vector_range = (0.65, 0.85)
|
||||
self.list = CHAT_AREA
|
||||
self.click_coords = self.device.click_methods.get(self.config.Emulator_ControlMethod, self.device.click_adb)
|
||||
swipe_vector_range = (0.65, 0.85)
|
||||
list = CHAT_AREA
|
||||
|
||||
def swipe_page(self, direction: str, main: ModuleBase, vector_range=None, reverse=False):
|
||||
def swipe_page(self, direction: str, vector_range=None, reverse=False):
|
||||
"""
|
||||
Args:
|
||||
direction: up, down
|
||||
main:
|
||||
vector_range (tuple[float, float]):
|
||||
reverse (bool):
|
||||
"""
|
||||
@@ -58,7 +52,7 @@ class MomoTalkUI(UI):
|
||||
|
||||
if reverse:
|
||||
vector = (-vector[0], -vector[1])
|
||||
main.device.swipe_vector(vector, self.list.button)
|
||||
self.device.swipe_vector(vector, self.list.button)
|
||||
|
||||
def select_then_disappear(self, dest_enter: ButtonWrapper, dest_check: ButtonWrapper):
|
||||
timer = Timer(5, 10).start()
|
||||
@@ -83,24 +77,19 @@ class MomoTalkUI(UI):
|
||||
|
||||
return True
|
||||
|
||||
def click_all(self, template, x_add=0, y_add=0):
|
||||
def click_all(self, template: ButtonWrapper, offset: tuple[int, int] = (0, 0)) -> bool:
|
||||
"""
|
||||
Find the all the locations of the template adding an offset if specified and click them.
|
||||
If after filter, no coords then swipe.
|
||||
"""
|
||||
image = self.device.screenshot()
|
||||
result = cv2.matchTemplate(image, template, cv2.TM_CCOEFF_NORMED)
|
||||
threshold = 0.8
|
||||
locations = np.where(result >= threshold)
|
||||
seen = set()
|
||||
for pt in zip(*locations[::-1]):
|
||||
center_pt = (int(pt[0] + template.shape[1] / 2 + x_add), int(pt[1] + template.shape[0] / 2 + y_add))
|
||||
seen.add(center_pt)
|
||||
template.load_search(self.list.area)
|
||||
template.matched_button._button_offset = offset
|
||||
seen = template.match_multi_template(self.device.image, similarity=0.8)
|
||||
if seen:
|
||||
if y_add != 0:
|
||||
seen = filter(lambda x: point_in_area(x, CHAT_AREA.area), seen)
|
||||
[self.click_coords(coords[0], coords[1]) for coords in seen]
|
||||
self.swipe_page("down", self)
|
||||
if any(offset):
|
||||
for button in seen:
|
||||
self.device.click(button)
|
||||
self.swipe_page("down")
|
||||
return True
|
||||
return False
|
||||
|
||||
@@ -157,10 +146,10 @@ class MomoTalkUI(UI):
|
||||
return True
|
||||
elif self.click_all(CHATTING_TEMPLATE):
|
||||
timer.reset()
|
||||
elif self.click_all(REPLY_TEMPLATE, y_add=62):
|
||||
elif self.click_all(REPLY_TEMPLATE, offset=(0, 62)):
|
||||
logger.info("Clicked on reply")
|
||||
timer.reset()
|
||||
elif self.click_all(STORY_TEMPLATE, y_add=62):
|
||||
elif self.click_all(STORY_TEMPLATE, offset=(0, 62)):
|
||||
logger.info("Clicked on story")
|
||||
timer.reset()
|
||||
elif timer.reached():
|
||||
|
||||