mirror of
https://github.com/TheFunny/ArisuAutoSweeper
synced 2026-02-06 08:55:13 +00:00
Compare commits
No commits in common. "eb8048ccd61aafb46a9a6b575949e91ce86c322e" and "0a697e939805782ad6649d0f206a67e18e2bd8f9" have entirely different histories.
eb8048ccd6
...
0a697e9398
@ -15,7 +15,6 @@ The script is still under active development. The following features have been i
|
|||||||
- [x] **Cafe** Claim rewards / Interact / Second floor
|
- [x] **Cafe** Claim rewards / Interact / Second floor
|
||||||
- [x] **Club** Claim AP
|
- [x] **Club** Claim AP
|
||||||
- [x] **Mailbox** Claim rewards
|
- [x] **Mailbox** Claim rewards
|
||||||
- [x] **Bounty** Auto sweep
|
|
||||||
- [x] **Tactical Challenge** Claim rewards / Auto battle
|
- [x] **Tactical Challenge** Claim rewards / Auto battle
|
||||||
|
|
||||||
Supported servers:
|
Supported servers:
|
||||||
|
|||||||
@ -15,7 +15,6 @@
|
|||||||
- [x] **咖啡厅** 领取奖励 / 互动 / 第二咖啡厅
|
- [x] **咖啡厅** 领取奖励 / 互动 / 第二咖啡厅
|
||||||
- [x] **公会** 领取体力
|
- [x] **公会** 领取体力
|
||||||
- [x] **邮箱** 领取奖励
|
- [x] **邮箱** 领取奖励
|
||||||
- [x] **悬赏通缉** 自动扫荡
|
|
||||||
- [x] **战术对抗赛** 领取奖励 / 自动战斗
|
- [x] **战术对抗赛** 领取奖励 / 自动战斗
|
||||||
|
|
||||||
目前支持的服务器:
|
目前支持的服务器:
|
||||||
@ -23,14 +22,6 @@
|
|||||||
- [x] 日服
|
- [x] 日服
|
||||||
- [x] 国际服 - 全球
|
- [x] 国际服 - 全球
|
||||||
|
|
||||||
## 已知问题
|
|
||||||
|
|
||||||
若愿意提供其他服务器支持,请开 PR 或 Issue。
|
|
||||||
|
|
||||||
- **大小月卡**:未实现自动领取~~(因为没买过)~~,可能不影响使用。愿意提供图片的请开 Issue
|
|
||||||
- **月卡的额外悬赏券和学院交流券**:不太清楚月卡领取额外券的机制~~(因为没买过)~~,可能影响相关任务使用券和体力的计算。愿意提供相关信息的请开
|
|
||||||
Issue
|
|
||||||
|
|
||||||
## 相关项目
|
## 相关项目
|
||||||
|
|
||||||
- [AzurLaneAutoScript](https://github.com/LmeSzinc/AzurLaneAutoScript): 碧蓝航线自动化脚本
|
- [AzurLaneAutoScript](https://github.com/LmeSzinc/AzurLaneAutoScript): 碧蓝航线自动化脚本
|
||||||
|
|||||||
4
aas.py
4
aas.py
@ -34,10 +34,6 @@ class ArisuAutoSweeper(AzurLaneAutoScript):
|
|||||||
from tasks.mail.mail import Mail
|
from tasks.mail.mail import Mail
|
||||||
Mail(config=self.config, device=self.device).run()
|
Mail(config=self.config, device=self.device).run()
|
||||||
|
|
||||||
def bounty(self):
|
|
||||||
from tasks.bounty.bounty import Bounty
|
|
||||||
Bounty(config=self.config, device=self.device).run()
|
|
||||||
|
|
||||||
def tactical_challenge(self):
|
def tactical_challenge(self):
|
||||||
from tasks.tactical_challenge.tactical_challenge import TacticalChallenge
|
from tasks.tactical_challenge.tactical_challenge import TacticalChallenge
|
||||||
TacticalChallenge(config=self.config, device=self.device).run()
|
TacticalChallenge(config=self.config, device=self.device).run()
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 14 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 6.0 KiB |
@ -63,26 +63,6 @@
|
|||||||
"ServerUpdate": "04:00"
|
"ServerUpdate": "04:00"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Bounty": {
|
|
||||||
"Scheduler": {
|
|
||||||
"Enable": true,
|
|
||||||
"NextRun": "2020-01-01 00:00:00",
|
|
||||||
"Command": "Bounty",
|
|
||||||
"ServerUpdate": "04:00"
|
|
||||||
},
|
|
||||||
"Highway": {
|
|
||||||
"Stage": 1,
|
|
||||||
"Count": 2
|
|
||||||
},
|
|
||||||
"DesertRailroad": {
|
|
||||||
"Stage": 1,
|
|
||||||
"Count": 2
|
|
||||||
},
|
|
||||||
"Schoolhouse": {
|
|
||||||
"Stage": 1,
|
|
||||||
"Count": 2
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"TacticalChallenge": {
|
"TacticalChallenge": {
|
||||||
"Scheduler": {
|
"Scheduler": {
|
||||||
"Enable": true,
|
"Enable": true,
|
||||||
@ -104,10 +84,7 @@
|
|||||||
"ItemStorage": {
|
"ItemStorage": {
|
||||||
"AP": {},
|
"AP": {},
|
||||||
"Credit": {},
|
"Credit": {},
|
||||||
"Pyroxene": {},
|
"Pyroxene": {}
|
||||||
"BountyTicket": {},
|
|
||||||
"ScrimmageTicket": {},
|
|
||||||
"TacticalChallengeTicket": {}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -257,96 +257,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Bounty": {
|
|
||||||
"Scheduler": {
|
|
||||||
"Enable": {
|
|
||||||
"type": "checkbox",
|
|
||||||
"value": true,
|
|
||||||
"option": [
|
|
||||||
true,
|
|
||||||
false
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"NextRun": {
|
|
||||||
"type": "datetime",
|
|
||||||
"value": "2020-01-01 00:00:00",
|
|
||||||
"validate": "datetime"
|
|
||||||
},
|
|
||||||
"Command": {
|
|
||||||
"type": "input",
|
|
||||||
"value": "Bounty",
|
|
||||||
"display": "hide"
|
|
||||||
},
|
|
||||||
"ServerUpdate": {
|
|
||||||
"type": "input",
|
|
||||||
"value": "04:00",
|
|
||||||
"display": "hide"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Highway": {
|
|
||||||
"Stage": {
|
|
||||||
"type": "select",
|
|
||||||
"value": 1,
|
|
||||||
"option": [
|
|
||||||
1,
|
|
||||||
2,
|
|
||||||
3,
|
|
||||||
4,
|
|
||||||
5,
|
|
||||||
6,
|
|
||||||
7,
|
|
||||||
8,
|
|
||||||
9
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"Count": {
|
|
||||||
"type": "input",
|
|
||||||
"value": 2
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"DesertRailroad": {
|
|
||||||
"Stage": {
|
|
||||||
"type": "select",
|
|
||||||
"value": 1,
|
|
||||||
"option": [
|
|
||||||
1,
|
|
||||||
2,
|
|
||||||
3,
|
|
||||||
4,
|
|
||||||
5,
|
|
||||||
6,
|
|
||||||
7,
|
|
||||||
8,
|
|
||||||
9
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"Count": {
|
|
||||||
"type": "input",
|
|
||||||
"value": 2
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Schoolhouse": {
|
|
||||||
"Stage": {
|
|
||||||
"type": "select",
|
|
||||||
"value": 1,
|
|
||||||
"option": [
|
|
||||||
1,
|
|
||||||
2,
|
|
||||||
3,
|
|
||||||
4,
|
|
||||||
5,
|
|
||||||
6,
|
|
||||||
7,
|
|
||||||
8,
|
|
||||||
9
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"Count": {
|
|
||||||
"type": "input",
|
|
||||||
"value": 2
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"TacticalChallenge": {
|
"TacticalChallenge": {
|
||||||
"Scheduler": {
|
"Scheduler": {
|
||||||
"Enable": {
|
"Enable": {
|
||||||
@ -438,30 +348,6 @@
|
|||||||
"stored": "StoredInt",
|
"stored": "StoredInt",
|
||||||
"order": 3,
|
"order": 3,
|
||||||
"color": "#21befc"
|
"color": "#21befc"
|
||||||
},
|
|
||||||
"BountyTicket": {
|
|
||||||
"type": "stored",
|
|
||||||
"value": {},
|
|
||||||
"display": "hide",
|
|
||||||
"stored": "StoredBountyTicket",
|
|
||||||
"order": 4,
|
|
||||||
"color": "#94cb44"
|
|
||||||
},
|
|
||||||
"ScrimmageTicket": {
|
|
||||||
"type": "stored",
|
|
||||||
"value": {},
|
|
||||||
"display": "hide",
|
|
||||||
"stored": "StoredScrimmageTicket",
|
|
||||||
"order": 5,
|
|
||||||
"color": "#f86c6a"
|
|
||||||
},
|
|
||||||
"TacticalChallengeTicket": {
|
|
||||||
"type": "stored",
|
|
||||||
"value": {},
|
|
||||||
"display": "hide",
|
|
||||||
"stored": "StoredTacticalChallengeTicket",
|
|
||||||
"order": 6,
|
|
||||||
"color": "#7ac8e5"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -81,22 +81,6 @@ Cafe:
|
|||||||
AutoAdjust: true
|
AutoAdjust: true
|
||||||
SecondCafe: true
|
SecondCafe: true
|
||||||
|
|
||||||
Highway:
|
|
||||||
Stage:
|
|
||||||
value: 1
|
|
||||||
option: [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ]
|
|
||||||
Count: 2
|
|
||||||
DesertRailroad:
|
|
||||||
Stage:
|
|
||||||
value: 1
|
|
||||||
option: [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ]
|
|
||||||
Count: 2
|
|
||||||
Schoolhouse:
|
|
||||||
Stage:
|
|
||||||
value: 1
|
|
||||||
option: [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ]
|
|
||||||
Count: 2
|
|
||||||
|
|
||||||
TacticalChallenge:
|
TacticalChallenge:
|
||||||
PlayerSelect:
|
PlayerSelect:
|
||||||
value: 0
|
value: 0
|
||||||
@ -115,15 +99,3 @@ ItemStorage:
|
|||||||
stored: StoredInt
|
stored: StoredInt
|
||||||
order: 3
|
order: 3
|
||||||
color: "#21befc"
|
color: "#21befc"
|
||||||
BountyTicket:
|
|
||||||
stored: StoredBountyTicket
|
|
||||||
order: 4
|
|
||||||
color: "#94cb44"
|
|
||||||
ScrimmageTicket:
|
|
||||||
stored: StoredScrimmageTicket
|
|
||||||
order: 5
|
|
||||||
color: "#f86c6a"
|
|
||||||
TacticalChallengeTicket:
|
|
||||||
stored: StoredTacticalChallengeTicket
|
|
||||||
order: 6
|
|
||||||
color: "#7ac8e5"
|
|
||||||
|
|||||||
@ -13,9 +13,6 @@ Mail:
|
|||||||
Circle:
|
Circle:
|
||||||
Scheduler:
|
Scheduler:
|
||||||
Enable: true
|
Enable: true
|
||||||
Bounty:
|
|
||||||
Scheduler:
|
|
||||||
Enable: true
|
|
||||||
TacticalChallenge:
|
TacticalChallenge:
|
||||||
Scheduler:
|
Scheduler:
|
||||||
Enable: true
|
Enable: true
|
||||||
@ -14,7 +14,6 @@
|
|||||||
"Cafe",
|
"Cafe",
|
||||||
"Mail",
|
"Mail",
|
||||||
"Circle",
|
"Circle",
|
||||||
"Bounty",
|
|
||||||
"TacticalChallenge",
|
"TacticalChallenge",
|
||||||
"DataUpdate"
|
"DataUpdate"
|
||||||
]
|
]
|
||||||
|
|||||||
@ -35,44 +35,5 @@
|
|||||||
},
|
},
|
||||||
"order": 3,
|
"order": 3,
|
||||||
"color": "#21befc"
|
"color": "#21befc"
|
||||||
},
|
|
||||||
"BountyTicket": {
|
|
||||||
"name": "BountyTicket",
|
|
||||||
"path": "DataUpdate.ItemStorage.BountyTicket",
|
|
||||||
"i18n": "ItemStorage.BountyTicket.name",
|
|
||||||
"stored": "StoredBountyTicket",
|
|
||||||
"attrs": {
|
|
||||||
"time": "2020-01-01 00:00:00",
|
|
||||||
"total": 6,
|
|
||||||
"value": 0
|
|
||||||
},
|
|
||||||
"order": 4,
|
|
||||||
"color": "#94cb44"
|
|
||||||
},
|
|
||||||
"ScrimmageTicket": {
|
|
||||||
"name": "ScrimmageTicket",
|
|
||||||
"path": "DataUpdate.ItemStorage.ScrimmageTicket",
|
|
||||||
"i18n": "ItemStorage.ScrimmageTicket.name",
|
|
||||||
"stored": "StoredScrimmageTicket",
|
|
||||||
"attrs": {
|
|
||||||
"time": "2020-01-01 00:00:00",
|
|
||||||
"total": 6,
|
|
||||||
"value": 0
|
|
||||||
},
|
|
||||||
"order": 5,
|
|
||||||
"color": "#f86c6a"
|
|
||||||
},
|
|
||||||
"TacticalChallengeTicket": {
|
|
||||||
"name": "TacticalChallengeTicket",
|
|
||||||
"path": "DataUpdate.ItemStorage.TacticalChallengeTicket",
|
|
||||||
"i18n": "ItemStorage.TacticalChallengeTicket.name",
|
|
||||||
"stored": "StoredTacticalChallengeTicket",
|
|
||||||
"attrs": {
|
|
||||||
"time": "2020-01-01 00:00:00",
|
|
||||||
"total": 5,
|
|
||||||
"value": 0
|
|
||||||
},
|
|
||||||
"order": 6,
|
|
||||||
"color": "#7ac8e5"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -29,11 +29,6 @@ Daily:
|
|||||||
- Scheduler
|
- Scheduler
|
||||||
Circle:
|
Circle:
|
||||||
- Scheduler
|
- Scheduler
|
||||||
Bounty:
|
|
||||||
- Scheduler
|
|
||||||
- Highway
|
|
||||||
- DesertRailroad
|
|
||||||
- Schoolhouse
|
|
||||||
TacticalChallenge:
|
TacticalChallenge:
|
||||||
- Scheduler
|
- Scheduler
|
||||||
- TacticalChallenge
|
- TacticalChallenge
|
||||||
|
|||||||
@ -45,18 +45,6 @@ class GeneratedConfig:
|
|||||||
Cafe_AutoAdjust = True
|
Cafe_AutoAdjust = True
|
||||||
Cafe_SecondCafe = True
|
Cafe_SecondCafe = True
|
||||||
|
|
||||||
# Group `Highway`
|
|
||||||
Highway_Stage = 1 # 1, 2, 3, 4, 5, 6, 7, 8, 9
|
|
||||||
Highway_Count = 2
|
|
||||||
|
|
||||||
# Group `DesertRailroad`
|
|
||||||
DesertRailroad_Stage = 1 # 1, 2, 3, 4, 5, 6, 7, 8, 9
|
|
||||||
DesertRailroad_Count = 2
|
|
||||||
|
|
||||||
# Group `Schoolhouse`
|
|
||||||
Schoolhouse_Stage = 1 # 1, 2, 3, 4, 5, 6, 7, 8, 9
|
|
||||||
Schoolhouse_Count = 2
|
|
||||||
|
|
||||||
# Group `TacticalChallenge`
|
# Group `TacticalChallenge`
|
||||||
TacticalChallenge_PlayerSelect = 0 # 0, 1, 2, 3
|
TacticalChallenge_PlayerSelect = 0 # 0, 1, 2, 3
|
||||||
|
|
||||||
@ -64,6 +52,3 @@ class GeneratedConfig:
|
|||||||
ItemStorage_AP = {}
|
ItemStorage_AP = {}
|
||||||
ItemStorage_Credit = {}
|
ItemStorage_Credit = {}
|
||||||
ItemStorage_Pyroxene = {}
|
ItemStorage_Pyroxene = {}
|
||||||
ItemStorage_BountyTicket = {}
|
|
||||||
ItemStorage_ScrimmageTicket = {}
|
|
||||||
ItemStorage_TacticalChallengeTicket = {}
|
|
||||||
|
|||||||
@ -8,7 +8,7 @@ class ManualConfig:
|
|||||||
|
|
||||||
SCHEDULER_PRIORITY = """
|
SCHEDULER_PRIORITY = """
|
||||||
Restart
|
Restart
|
||||||
> Cafe > Circle > Mail > DataUpdate > Bounty > TacticalChallenge
|
> Cafe > Circle > Mail > DataUpdate > TacticalChallenge
|
||||||
"""
|
"""
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|||||||
@ -30,10 +30,6 @@
|
|||||||
"name": "Club",
|
"name": "Club",
|
||||||
"help": ""
|
"help": ""
|
||||||
},
|
},
|
||||||
"Bounty": {
|
|
||||||
"name": "Bounty",
|
|
||||||
"help": ""
|
|
||||||
},
|
|
||||||
"TacticalChallenge": {
|
"TacticalChallenge": {
|
||||||
"name": "Tactical Challenge",
|
"name": "Tactical Challenge",
|
||||||
"help": ""
|
"help": ""
|
||||||
@ -213,75 +209,6 @@
|
|||||||
"help": "JP server only\nEnable auto switch to second floor and perform interaction"
|
"help": "JP server only\nEnable auto switch to second floor and perform interaction"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Highway": {
|
|
||||||
"_info": {
|
|
||||||
"name": "Overpass",
|
|
||||||
"help": ""
|
|
||||||
},
|
|
||||||
"Stage": {
|
|
||||||
"name": "Select Stage",
|
|
||||||
"help": "",
|
|
||||||
"1": "01 - Overpass A",
|
|
||||||
"2": "02 - Overpass B",
|
|
||||||
"3": "03 - Overpass C",
|
|
||||||
"4": "04 - Overpass D",
|
|
||||||
"5": "05 - Overpass E",
|
|
||||||
"6": "06 - Overpass F",
|
|
||||||
"7": "07 - Overpass G",
|
|
||||||
"8": "08 - Overpass H",
|
|
||||||
"9": "09 - Overpass I"
|
|
||||||
},
|
|
||||||
"Count": {
|
|
||||||
"name": "Sweep X times",
|
|
||||||
"help": "Sweep the selected stage for X times"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"DesertRailroad": {
|
|
||||||
"_info": {
|
|
||||||
"name": "Desert Railroad",
|
|
||||||
"help": ""
|
|
||||||
},
|
|
||||||
"Stage": {
|
|
||||||
"name": "Select Stage",
|
|
||||||
"help": "",
|
|
||||||
"1": "01 - Abandoned Train A",
|
|
||||||
"2": "02 - Abandoned Train B",
|
|
||||||
"3": "03 - Abandoned Train C",
|
|
||||||
"4": "04 - Abandoned Train D",
|
|
||||||
"5": "05 - Abandoned Train E",
|
|
||||||
"6": "06 - Abandoned Train F",
|
|
||||||
"7": "07 - Abandoned Train G",
|
|
||||||
"8": "08 - Abandoned Train H",
|
|
||||||
"9": "09 - Abandoned Train I"
|
|
||||||
},
|
|
||||||
"Count": {
|
|
||||||
"name": "Sweep X times",
|
|
||||||
"help": "Sweep the selected stage for X times"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Schoolhouse": {
|
|
||||||
"_info": {
|
|
||||||
"name": "Classroom",
|
|
||||||
"help": ""
|
|
||||||
},
|
|
||||||
"Stage": {
|
|
||||||
"name": "Select Stage",
|
|
||||||
"help": "",
|
|
||||||
"1": "01 - Besieged Classroom A",
|
|
||||||
"2": "02 - Besieged Classroom B",
|
|
||||||
"3": "03 - Besieged Classroom C",
|
|
||||||
"4": "04 - Besieged Classroom D",
|
|
||||||
"5": "05 - Besieged Classroom E",
|
|
||||||
"6": "06 - Besieged Classroom F",
|
|
||||||
"7": "07 - Besieged Classroom G",
|
|
||||||
"8": "08 - Besieged Classroom H",
|
|
||||||
"9": "09 - Besieged Classroom I"
|
|
||||||
},
|
|
||||||
"Count": {
|
|
||||||
"name": "Sweep X times",
|
|
||||||
"help": "Sweep the selected stage for X times"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"TacticalChallenge": {
|
"TacticalChallenge": {
|
||||||
"_info": {
|
"_info": {
|
||||||
"name": "Tactical Challenge Settings",
|
"name": "Tactical Challenge Settings",
|
||||||
@ -312,18 +239,6 @@
|
|||||||
"Pyroxene": {
|
"Pyroxene": {
|
||||||
"name": "Pyroxene",
|
"name": "Pyroxene",
|
||||||
"help": ""
|
"help": ""
|
||||||
},
|
|
||||||
"BountyTicket": {
|
|
||||||
"name": "Bounty Ticket",
|
|
||||||
"help": ""
|
|
||||||
},
|
|
||||||
"ScrimmageTicket": {
|
|
||||||
"name": "Scrimmage Ticket",
|
|
||||||
"help": ""
|
|
||||||
},
|
|
||||||
"TacticalChallengeTicket": {
|
|
||||||
"name": "Tactical Challenge Ticket",
|
|
||||||
"help": ""
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Gui": {
|
"Gui": {
|
||||||
|
|||||||
@ -30,10 +30,6 @@
|
|||||||
"name": "公会",
|
"name": "公会",
|
||||||
"help": "社团 / 小组"
|
"help": "社团 / 小组"
|
||||||
},
|
},
|
||||||
"Bounty": {
|
|
||||||
"name": "通缉悬赏",
|
|
||||||
"help": ""
|
|
||||||
},
|
|
||||||
"TacticalChallenge": {
|
"TacticalChallenge": {
|
||||||
"name": "战术对抗赛",
|
"name": "战术对抗赛",
|
||||||
"help": "战术大赛 / 竞技场"
|
"help": "战术大赛 / 竞技场"
|
||||||
@ -213,75 +209,6 @@
|
|||||||
"help": "仅支持日服\n自动切换第二咖啡厅进行互动点击"
|
"help": "仅支持日服\n自动切换第二咖啡厅进行互动点击"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Highway": {
|
|
||||||
"_info": {
|
|
||||||
"name": "高架公路",
|
|
||||||
"help": ""
|
|
||||||
},
|
|
||||||
"Stage": {
|
|
||||||
"name": "选择关卡",
|
|
||||||
"help": "",
|
|
||||||
"1": "01 - 高架公路 A",
|
|
||||||
"2": "02 - 高架公路 B",
|
|
||||||
"3": "03 - 高架公路 C",
|
|
||||||
"4": "04 - 高架公路 D",
|
|
||||||
"5": "05 - 高架公路 E",
|
|
||||||
"6": "06 - 高架公路 F",
|
|
||||||
"7": "07 - 高架公路 G",
|
|
||||||
"8": "08 - 高架公路 H",
|
|
||||||
"9": "09 - 高架公路 I"
|
|
||||||
},
|
|
||||||
"Count": {
|
|
||||||
"name": "扫荡次数",
|
|
||||||
"help": "扫荡所选择关卡 X 次"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"DesertRailroad": {
|
|
||||||
"_info": {
|
|
||||||
"name": "沙漠铁路",
|
|
||||||
"help": ""
|
|
||||||
},
|
|
||||||
"Stage": {
|
|
||||||
"name": "选择关卡",
|
|
||||||
"help": "",
|
|
||||||
"1": "01 - 被遗弃的列车 A",
|
|
||||||
"2": "02 - 被遗弃的列车 B",
|
|
||||||
"3": "03 - 被遗弃的列车 C",
|
|
||||||
"4": "04 - 被遗弃的列车 D",
|
|
||||||
"5": "05 - 被遗弃的列车 E",
|
|
||||||
"6": "06 - 被遗弃的列车 F",
|
|
||||||
"7": "07 - 被遗弃的列车 G",
|
|
||||||
"8": "08 - 被遗弃的列车 H",
|
|
||||||
"9": "09 - 被遗弃的列车 I"
|
|
||||||
},
|
|
||||||
"Count": {
|
|
||||||
"name": "扫荡次数",
|
|
||||||
"help": "扫荡所选择关卡 X 次"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Schoolhouse": {
|
|
||||||
"_info": {
|
|
||||||
"name": "教室",
|
|
||||||
"help": ""
|
|
||||||
},
|
|
||||||
"Stage": {
|
|
||||||
"name": "选择关卡",
|
|
||||||
"help": "",
|
|
||||||
"1": "01 - 被袭击的教室 A",
|
|
||||||
"2": "02 - 被袭击的教室 B",
|
|
||||||
"3": "03 - 被袭击的教室 C",
|
|
||||||
"4": "04 - 被袭击的教室 D",
|
|
||||||
"5": "05 - 被袭击的教室 E",
|
|
||||||
"6": "06 - 被袭击的教室 F",
|
|
||||||
"7": "07 - 被袭击的教室 G",
|
|
||||||
"8": "08 - 被袭击的教室 H",
|
|
||||||
"9": "09 - 被袭击的教室 I"
|
|
||||||
},
|
|
||||||
"Count": {
|
|
||||||
"name": "扫荡次数",
|
|
||||||
"help": "扫荡所选择关卡 X 次"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"TacticalChallenge": {
|
"TacticalChallenge": {
|
||||||
"_info": {
|
"_info": {
|
||||||
"name": "战术对抗赛设置",
|
"name": "战术对抗赛设置",
|
||||||
@ -312,18 +239,6 @@
|
|||||||
"Pyroxene": {
|
"Pyroxene": {
|
||||||
"name": "青辉石",
|
"name": "青辉石",
|
||||||
"help": ""
|
"help": ""
|
||||||
},
|
|
||||||
"BountyTicket": {
|
|
||||||
"name": "悬赏通缉票券",
|
|
||||||
"help": ""
|
|
||||||
},
|
|
||||||
"ScrimmageTicket": {
|
|
||||||
"name": "学院交流会票券",
|
|
||||||
"help": ""
|
|
||||||
},
|
|
||||||
"TacticalChallengeTicket": {
|
|
||||||
"name": "战术对抗赛票券",
|
|
||||||
"help": ""
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Gui": {
|
"Gui": {
|
||||||
|
|||||||
@ -3,8 +3,6 @@ from functools import cached_property as functools_cached_property
|
|||||||
|
|
||||||
from module.base.decorator import cached_property
|
from module.base.decorator import cached_property
|
||||||
from module.config.utils import DEFAULT_TIME, deep_get, get_server_last_monday_update, get_server_last_update
|
from module.config.utils import DEFAULT_TIME, deep_get, get_server_last_monday_update, get_server_last_update
|
||||||
|
|
||||||
|
|
||||||
# from module.exception import ScriptError
|
# from module.exception import ScriptError
|
||||||
|
|
||||||
|
|
||||||
@ -175,20 +173,6 @@ class StoredCounter(StoredBase):
|
|||||||
class StoredAP(StoredCounter):
|
class StoredAP(StoredCounter):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class StoredBountyTicket(StoredCounter, StoredExpiredAt0400):
|
|
||||||
FIXED_TOTAL = 6
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
class StoredScrimmageTicket(StoredCounter, StoredExpiredAt0400):
|
|
||||||
FIXED_TOTAL = 6
|
|
||||||
|
|
||||||
|
|
||||||
class StoredTacticalChallengeTicket(StoredCounter, StoredExpiredAt0400):
|
|
||||||
FIXED_TOTAL = 5
|
|
||||||
|
|
||||||
|
|
||||||
# class StoredDailyActivity(StoredCounter, StoredExpiredAt0400):
|
# class StoredDailyActivity(StoredCounter, StoredExpiredAt0400):
|
||||||
# FIXED_TOTAL = 500
|
# FIXED_TOTAL = 500
|
||||||
#
|
#
|
||||||
|
|||||||
@ -1,9 +1,10 @@
|
|||||||
from module.config.stored.classes import (
|
from module.config.stored.classes import (
|
||||||
StoredAP,
|
StoredAP,
|
||||||
StoredBountyTicket,
|
StoredBase,
|
||||||
|
StoredCounter,
|
||||||
|
StoredExpiredAt0400,
|
||||||
|
StoredExpiredAtMonday0400,
|
||||||
StoredInt,
|
StoredInt,
|
||||||
StoredScrimmageTicket,
|
|
||||||
StoredTacticalChallengeTicket,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -14,6 +15,3 @@ class StoredGenerated:
|
|||||||
AP = StoredAP("DataUpdate.ItemStorage.AP")
|
AP = StoredAP("DataUpdate.ItemStorage.AP")
|
||||||
Credit = StoredInt("DataUpdate.ItemStorage.Credit")
|
Credit = StoredInt("DataUpdate.ItemStorage.Credit")
|
||||||
Pyroxene = StoredInt("DataUpdate.ItemStorage.Pyroxene")
|
Pyroxene = StoredInt("DataUpdate.ItemStorage.Pyroxene")
|
||||||
BountyTicket = StoredBountyTicket("DataUpdate.ItemStorage.BountyTicket")
|
|
||||||
ScrimmageTicket = StoredScrimmageTicket("DataUpdate.ItemStorage.ScrimmageTicket")
|
|
||||||
TacticalChallengeTicket = StoredTacticalChallengeTicket("DataUpdate.ItemStorage.TacticalChallengeTicket")
|
|
||||||
|
|||||||
@ -3,17 +3,6 @@ from module.base.button import Button, ButtonWrapper
|
|||||||
# This file was auto-generated, do not modify it manually. To generate:
|
# This file was auto-generated, do not modify it manually. To generate:
|
||||||
# ``` python -m dev_tools.button_extract ```
|
# ``` python -m dev_tools.button_extract ```
|
||||||
|
|
||||||
CHECK_BOUNTY = ButtonWrapper(
|
|
||||||
name='CHECK_BOUNTY',
|
|
||||||
jp=Button(
|
|
||||||
file='./assets/jp/bounty/CHECK_BOUNTY.png',
|
|
||||||
area=(654, 87, 889, 129),
|
|
||||||
search=(634, 67, 909, 149),
|
|
||||||
color=(88, 113, 139),
|
|
||||||
button=(654, 87, 889, 129),
|
|
||||||
),
|
|
||||||
en=None,
|
|
||||||
)
|
|
||||||
CHECK_DESERT_RAILROAD = ButtonWrapper(
|
CHECK_DESERT_RAILROAD = ButtonWrapper(
|
||||||
name='CHECK_DESERT_RAILROAD',
|
name='CHECK_DESERT_RAILROAD',
|
||||||
jp=Button(
|
jp=Button(
|
||||||
@ -47,17 +36,6 @@ CHECK_SCHOOLHOUSE = ButtonWrapper(
|
|||||||
),
|
),
|
||||||
en=None,
|
en=None,
|
||||||
)
|
)
|
||||||
OCR_TICKET = ButtonWrapper(
|
|
||||||
name='OCR_TICKET',
|
|
||||||
jp=Button(
|
|
||||||
file='./assets/jp/bounty/OCR_TICKET.png',
|
|
||||||
area=(195, 85, 237, 113),
|
|
||||||
search=(175, 65, 257, 133),
|
|
||||||
color=(197, 206, 213),
|
|
||||||
button=(195, 85, 237, 113),
|
|
||||||
),
|
|
||||||
en=None,
|
|
||||||
)
|
|
||||||
SELECT_DESERT_RAILROAD = ButtonWrapper(
|
SELECT_DESERT_RAILROAD = ButtonWrapper(
|
||||||
name='SELECT_DESERT_RAILROAD',
|
name='SELECT_DESERT_RAILROAD',
|
||||||
jp=Button(
|
jp=Button(
|
||||||
|
|||||||
@ -1,106 +0,0 @@
|
|||||||
from enum import Flag
|
|
||||||
|
|
||||||
from module.base.timer import Timer
|
|
||||||
from module.exception import RequestHumanTakeover
|
|
||||||
from module.logger import logger
|
|
||||||
from tasks.base.assets.assets_base_page import BACK
|
|
||||||
from tasks.base.page import page_bounty
|
|
||||||
from tasks.bounty.assets.assets_bounty import *
|
|
||||||
from tasks.bounty.ui import BountyUI
|
|
||||||
|
|
||||||
|
|
||||||
class BountyStatus(Flag):
|
|
||||||
OCR = 0
|
|
||||||
SELECT = 1
|
|
||||||
ENTER = 2
|
|
||||||
SWEEP = 3
|
|
||||||
END = 4
|
|
||||||
FINISH = 5
|
|
||||||
|
|
||||||
|
|
||||||
class Bounty(BountyUI):
|
|
||||||
@property
|
|
||||||
def bounty_info(self):
|
|
||||||
bounty = (SELECT_HIGHWAY, SELECT_DESERT_RAILROAD, SELECT_SCHOOLHOUSE)
|
|
||||||
check = (CHECK_HIGHWAY, CHECK_DESERT_RAILROAD, CHECK_SCHOOLHOUSE)
|
|
||||||
stage = (self.config.Highway_Stage, self.config.DesertRailroad_Stage, self.config.Schoolhouse_Stage)
|
|
||||||
count = (self.config.Highway_Count, self.config.DesertRailroad_Count, self.config.Schoolhouse_Count)
|
|
||||||
info = zip(bounty, check, stage, count)
|
|
||||||
return filter(lambda x: x[3] > 0, info)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def valid_task(self) -> list:
|
|
||||||
task = list(self.bounty_info)
|
|
||||||
if not task:
|
|
||||||
logger.warning('Bounty enabled but no task set')
|
|
||||||
self.config.task_delay(server_update=True)
|
|
||||||
self.config.task_stop()
|
|
||||||
return task
|
|
||||||
|
|
||||||
@property
|
|
||||||
def is_ticket_enough(self) -> bool:
|
|
||||||
return self.config.stored.BountyTicket.value >= self.current_count
|
|
||||||
|
|
||||||
@property
|
|
||||||
def current_bounty(self):
|
|
||||||
return self.task[0][:2]
|
|
||||||
|
|
||||||
@property
|
|
||||||
def current_stage(self):
|
|
||||||
return self.task[0][2]
|
|
||||||
|
|
||||||
@property
|
|
||||||
def current_count(self):
|
|
||||||
return self.task[0][3]
|
|
||||||
|
|
||||||
def handle_bounty(self, status):
|
|
||||||
match status:
|
|
||||||
case BountyStatus.OCR:
|
|
||||||
if self.get_ticket():
|
|
||||||
return BountyStatus.SELECT
|
|
||||||
case BountyStatus.SELECT:
|
|
||||||
if not self.is_ticket_enough:
|
|
||||||
logger.warning('Bounty ticket not enough')
|
|
||||||
raise RequestHumanTakeover
|
|
||||||
if self.select_bounty(*self.current_bounty):
|
|
||||||
return BountyStatus.ENTER
|
|
||||||
case BountyStatus.ENTER:
|
|
||||||
if self.enter_stage(self.current_stage):
|
|
||||||
return BountyStatus.SWEEP
|
|
||||||
case BountyStatus.SWEEP:
|
|
||||||
if self.do_sweep(self.current_count):
|
|
||||||
self.task.pop(0)
|
|
||||||
if not self.task:
|
|
||||||
return BountyStatus.FINISH
|
|
||||||
return BountyStatus.END
|
|
||||||
return BountyStatus.ENTER
|
|
||||||
case BountyStatus.END:
|
|
||||||
if self.appear(CHECK_BOUNTY):
|
|
||||||
return BountyStatus.OCR
|
|
||||||
self.click_with_interval(BACK, interval=2)
|
|
||||||
case BountyStatus.FINISH:
|
|
||||||
return status
|
|
||||||
case _:
|
|
||||||
logger.warning(f'Invalid status: {status}')
|
|
||||||
return status
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
self.ui_ensure(page_bounty)
|
|
||||||
self.task = self.valid_task
|
|
||||||
action_timer = Timer(0.5, 1)
|
|
||||||
status = BountyStatus.OCR
|
|
||||||
|
|
||||||
while 1:
|
|
||||||
self.device.screenshot()
|
|
||||||
|
|
||||||
if self.ui_additional():
|
|
||||||
continue
|
|
||||||
|
|
||||||
if action_timer.reached_and_reset():
|
|
||||||
logger.attr('Status', status)
|
|
||||||
status = self.handle_bounty(status)
|
|
||||||
|
|
||||||
if status == BountyStatus.FINISH:
|
|
||||||
break
|
|
||||||
|
|
||||||
self.config.task_delay(server_update=True)
|
|
||||||
@ -1,48 +0,0 @@
|
|||||||
from module.base.timer import Timer
|
|
||||||
from module.logger import logger
|
|
||||||
from module.ocr.ocr import DigitCounter
|
|
||||||
from tasks.base.ui import UI
|
|
||||||
from tasks.bounty.assets.assets_bounty import *
|
|
||||||
from tasks.stage.list import StageList
|
|
||||||
from tasks.stage.sweep import StageSweep
|
|
||||||
|
|
||||||
BOUNTY_LIST = StageList('BountyList')
|
|
||||||
BOUNTY_SWEEP = StageSweep('BountySweep', 6)
|
|
||||||
|
|
||||||
|
|
||||||
class BountyUI(UI):
|
|
||||||
def select_bounty(self, dest_enter: ButtonWrapper, dest_check: ButtonWrapper):
|
|
||||||
timer = Timer(5, 10).start()
|
|
||||||
while 1:
|
|
||||||
self.device.screenshot()
|
|
||||||
self.appear_then_click(dest_enter, interval=1)
|
|
||||||
if self.appear(dest_check):
|
|
||||||
return True
|
|
||||||
if timer.reached():
|
|
||||||
return False
|
|
||||||
|
|
||||||
def enter_stage(self, index: int) -> bool:
|
|
||||||
if BOUNTY_LIST.select_index_enter(index, self):
|
|
||||||
return True
|
|
||||||
return False
|
|
||||||
|
|
||||||
def do_sweep(self, num: int) -> bool:
|
|
||||||
if BOUNTY_SWEEP.do_sweep(self, num=num):
|
|
||||||
return True
|
|
||||||
return False
|
|
||||||
|
|
||||||
def get_ticket(self):
|
|
||||||
"""
|
|
||||||
Page:
|
|
||||||
in: page_bounty
|
|
||||||
"""
|
|
||||||
if not self.appear(CHECK_BOUNTY):
|
|
||||||
logger.warning('OCR failed due to invalid page')
|
|
||||||
return False
|
|
||||||
ticket, _, total = DigitCounter(OCR_TICKET).ocr_single_line(self.device.image)
|
|
||||||
if total == 0:
|
|
||||||
logger.warning('Invalid ticket')
|
|
||||||
return False
|
|
||||||
logger.attr('BountyTicket', ticket)
|
|
||||||
self.config.stored.BountyTicket.set(ticket)
|
|
||||||
return True
|
|
||||||
@ -19,10 +19,11 @@ class StageSweep:
|
|||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
name: str,
|
name: str,
|
||||||
|
sweep_num: int,
|
||||||
max_sweep: int,
|
max_sweep: int,
|
||||||
):
|
):
|
||||||
self.name = name
|
self.name = name
|
||||||
self.sweep_num = None
|
self.sweep_num = sweep_num
|
||||||
|
|
||||||
self.check: ButtonWrapper = None
|
self.check: ButtonWrapper = None
|
||||||
self.num: Digit = None
|
self.num: Digit = None
|
||||||
@ -44,6 +45,7 @@ class StageSweep:
|
|||||||
self.current_sweep = 0
|
self.current_sweep = 0
|
||||||
|
|
||||||
self.sweep_method = None
|
self.sweep_method = None
|
||||||
|
self.set_mode()
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return f'StageSweep({self.name})'
|
return f'StageSweep({self.name})'
|
||||||
@ -86,10 +88,9 @@ class StageSweep:
|
|||||||
self.skip_ok_upper = button_skip_ok_upper if button_skip_ok_upper else SKIP_OK_UPPER
|
self.skip_ok_upper = button_skip_ok_upper if button_skip_ok_upper else SKIP_OK_UPPER
|
||||||
self.skip_ok_lower = button_skip_ok_lower if button_skip_ok_lower else SKIP_OK_LOWER
|
self.skip_ok_lower = button_skip_ok_lower if button_skip_ok_lower else SKIP_OK_LOWER
|
||||||
|
|
||||||
def set_mode(self, mode: str = None, num: int = None) -> bool:
|
def set_mode(self, mode: str = None):
|
||||||
if num is not None:
|
if mode is None:
|
||||||
self.sweep_num = num
|
match self.sweep_num:
|
||||||
match num:
|
|
||||||
case 0:
|
case 0:
|
||||||
self.sweep_method = self.set_sweep_min
|
self.sweep_method = self.set_sweep_min
|
||||||
case -1:
|
case -1:
|
||||||
@ -97,19 +98,15 @@ class StageSweep:
|
|||||||
case x if x > 0:
|
case x if x > 0:
|
||||||
self.sweep_method = self.set_sweep_num
|
self.sweep_method = self.set_sweep_num
|
||||||
case _:
|
case _:
|
||||||
logger.warning(f'Invalid sweep num: {num}')
|
logger.warning(f'Invalid sweep num: {self.sweep_num}')
|
||||||
return True
|
return
|
||||||
if mode is not None:
|
match mode:
|
||||||
match mode:
|
case 'max':
|
||||||
case 'max':
|
self.sweep_method = self.set_sweep_max
|
||||||
self.sweep_method = self.set_sweep_max
|
case 'min':
|
||||||
case 'min':
|
self.sweep_method = self.set_sweep_min
|
||||||
self.sweep_method = self.set_sweep_min
|
case _:
|
||||||
case _:
|
logger.warning(f'Invalid sweep mode: {mode}')
|
||||||
logger.warning(f'Invalid sweep mode: {mode}')
|
|
||||||
return True
|
|
||||||
logger.warning(f'Invalid sweep setting')
|
|
||||||
return False
|
|
||||||
|
|
||||||
def check_sweep(self, main: ModuleBase):
|
def check_sweep(self, main: ModuleBase):
|
||||||
return main.appear(self.check)
|
return main.appear(self.check)
|
||||||
@ -118,11 +115,8 @@ class StageSweep:
|
|||||||
return main.appear(self.skip_skip) or main.appear(self.skip_ok_upper) or main.appear(self.skip_ok_lower)
|
return main.appear(self.skip_skip) or main.appear(self.skip_ok_upper) or main.appear(self.skip_ok_lower)
|
||||||
|
|
||||||
def load_sweep_num(self, main: ModuleBase):
|
def load_sweep_num(self, main: ModuleBase):
|
||||||
timer = Timer(0.5, 2).start()
|
|
||||||
while 1:
|
while 1:
|
||||||
main.device.screenshot()
|
main.device.screenshot()
|
||||||
if not timer.reached_and_reset():
|
|
||||||
continue
|
|
||||||
ocr_result = self.num.detect_and_ocr(main.device.image)
|
ocr_result = self.num.detect_and_ocr(main.device.image)
|
||||||
if not ocr_result:
|
if not ocr_result:
|
||||||
logger.warning(f'No valid num in {self.num.name}')
|
logger.warning(f'No valid num in {self.num.name}')
|
||||||
@ -210,9 +204,7 @@ class StageSweep:
|
|||||||
if retry.reached_and_reset():
|
if retry.reached_and_reset():
|
||||||
main.click_with_interval(self.min, interval=0)
|
main.click_with_interval(self.min, interval=0)
|
||||||
|
|
||||||
def do_sweep(self, main: ModuleBase, mode: str = None, num: int = None, skip_first_screenshot=True) -> bool:
|
def do_sweep(self, main: ModuleBase, skip_first_screenshot=True) -> bool:
|
||||||
if not self.set_mode(mode, num):
|
|
||||||
return False
|
|
||||||
timer = Timer(0.5, 1)
|
timer = Timer(0.5, 1)
|
||||||
timer_stable = Timer(0.5, 1).start()
|
timer_stable = Timer(0.5, 1).start()
|
||||||
status = SweepStatus.SELECT
|
status = SweepStatus.SELECT
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user