mirror of
https://github.com/TheFunny/ArisuAutoSweeper
synced 2026-01-07 14:05:12 +00:00
Compare commits
2 Commits
5f3ff140dd
...
11d2a6ef7e
| Author | SHA1 | Date | |
|---|---|---|---|
| 11d2a6ef7e | |||
| 1f5b68d095 |
@ -48,9 +48,10 @@
|
|||||||
},
|
},
|
||||||
"Invitation": {
|
"Invitation": {
|
||||||
"Enable": true,
|
"Enable": true,
|
||||||
|
"WaitingHour": 0,
|
||||||
"Choice": "list_top",
|
"Choice": "list_top",
|
||||||
"Name": null,
|
"Name": null,
|
||||||
"Substitute": true
|
"Substitute": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Circle": {
|
"Circle": {
|
||||||
|
|||||||
@ -211,6 +211,16 @@
|
|||||||
"type": "checkbox",
|
"type": "checkbox",
|
||||||
"value": true
|
"value": true
|
||||||
},
|
},
|
||||||
|
"WaitingHour": {
|
||||||
|
"type": "select",
|
||||||
|
"value": 0,
|
||||||
|
"option": [
|
||||||
|
0,
|
||||||
|
3,
|
||||||
|
6,
|
||||||
|
9
|
||||||
|
]
|
||||||
|
},
|
||||||
"Choice": {
|
"Choice": {
|
||||||
"type": "select",
|
"type": "select",
|
||||||
"value": "list_top",
|
"value": "list_top",
|
||||||
@ -225,7 +235,7 @@
|
|||||||
},
|
},
|
||||||
"Substitute": {
|
"Substitute": {
|
||||||
"type": "checkbox",
|
"type": "checkbox",
|
||||||
"value": true
|
"value": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -82,13 +82,16 @@ Cafe:
|
|||||||
SecondCafe: true
|
SecondCafe: true
|
||||||
Invitation:
|
Invitation:
|
||||||
Enable: true
|
Enable: true
|
||||||
|
WaitingHour:
|
||||||
|
value: 0
|
||||||
|
option: [ 0, 3, 6, 9 ]
|
||||||
Choice:
|
Choice:
|
||||||
value: list_top
|
value: list_top
|
||||||
option: [ list_top, by_name ]
|
option: [ list_top, by_name ]
|
||||||
Name:
|
Name:
|
||||||
value: null
|
value: null
|
||||||
type: textarea
|
type: textarea
|
||||||
Substitute: true
|
Substitute: false
|
||||||
|
|
||||||
Bounty:
|
Bounty:
|
||||||
OnError:
|
OnError:
|
||||||
|
|||||||
@ -47,9 +47,10 @@ class GeneratedConfig:
|
|||||||
|
|
||||||
# Group `Invitation`
|
# Group `Invitation`
|
||||||
Invitation_Enable = True
|
Invitation_Enable = True
|
||||||
|
Invitation_WaitingHour = 0 # 0, 3, 6, 9
|
||||||
Invitation_Choice = 'list_top' # list_top, by_name
|
Invitation_Choice = 'list_top' # list_top, by_name
|
||||||
Invitation_Name = None
|
Invitation_Name = None
|
||||||
Invitation_Substitute = True
|
Invitation_Substitute = False
|
||||||
|
|
||||||
# Group `Bounty`
|
# Group `Bounty`
|
||||||
Bounty_OnError = 'skip' # stop, skip
|
Bounty_OnError = 'skip' # stop, skip
|
||||||
|
|||||||
@ -228,16 +228,24 @@
|
|||||||
},
|
},
|
||||||
"Enable": {
|
"Enable": {
|
||||||
"name": "Enable",
|
"name": "Enable",
|
||||||
"help": ""
|
"help": "Enable cafe invitation"
|
||||||
|
},
|
||||||
|
"WaitingHour": {
|
||||||
|
"name": "Invitation Condition",
|
||||||
|
"help": "Choose whether to invite students based on the remaining time before next cafe refresh\nThis is for obtaining maximum student interation and maximum affection when AFK. Recommended option:\n24*7 AFK:\t\t Choose \"If 9 more hours remaining\"\nNormal usage:\t Choose \"Invite immediately\"",
|
||||||
|
"0": "Invite immediately",
|
||||||
|
"3": "If 3 more hours remaining",
|
||||||
|
"6": "If 6 more hours remaining",
|
||||||
|
"9": "If 9 more hours remaining"
|
||||||
},
|
},
|
||||||
"Choice": {
|
"Choice": {
|
||||||
"name": "Choose Inviting Student",
|
"name": "Choose Inviting Student",
|
||||||
"help": "",
|
"help": "Top first student of list: Invite the student at the top first of the list\nBy name: Invite the student with the name you set below",
|
||||||
"list_top": "Top first student of list",
|
"list_top": "Top first student of list",
|
||||||
"by_name": "By name"
|
"by_name": "By name"
|
||||||
},
|
},
|
||||||
"Name": {
|
"Name": {
|
||||||
"name": "Invited Student Name",
|
"name": "Inviting Student Name",
|
||||||
"help": "Fill in the name of the student to be invited. Use in-game text language. Use > to connect multiple students. Example:\nJP: ホシノ(水着) > 御坂美琴 > ユズ\nOVERSEA: Hoshino(Swimsuit) > Yuuka > Kayoko(New Year)"
|
"help": "Fill in the name of the student to be invited. Use in-game text language. Use > to connect multiple students. Example:\nJP: ホシノ(水着) > 御坂美琴 > ユズ\nOVERSEA: Hoshino(Swimsuit) > Yuuka > Kayoko(New Year)"
|
||||||
},
|
},
|
||||||
"Substitute": {
|
"Substitute": {
|
||||||
|
|||||||
@ -228,17 +228,25 @@
|
|||||||
},
|
},
|
||||||
"Enable": {
|
"Enable": {
|
||||||
"name": "启用",
|
"name": "启用",
|
||||||
"help": ""
|
"help": "是否启用咖啡厅邀请功能"
|
||||||
|
},
|
||||||
|
"WaitingHour": {
|
||||||
|
"name": "邀请条件",
|
||||||
|
"help": "根据距离下一次咖啡厅刷新的时长,选择是否邀请学生\n此项设立是为了后台挂机最大化收益,使得邀请券能被最大化利用。推荐选项:\n常驻挂机:\t选择“离下次刷新 9 小时以上”\n非常驻挂机:\t选择“不等待刷新,立即邀请”,或根据自己挂机时长选择",
|
||||||
|
"0": "不等待刷新,立即邀请",
|
||||||
|
"3": "离下次刷新 3 小时以上",
|
||||||
|
"6": "离下次刷新 6 小时以上",
|
||||||
|
"9": "离下次刷新 9 小时以上"
|
||||||
},
|
},
|
||||||
"Choice": {
|
"Choice": {
|
||||||
"name": "选择被邀请学生",
|
"name": "选择邀请学生",
|
||||||
"help": "",
|
"help": "按列表第一个:优先邀请列表中第一个学生,若失败则则尝试下一个\n按名字:优先邀请下方填写学生名的第一个,若失败则尝试下一个",
|
||||||
"list_top": "按列表第一个",
|
"list_top": "按列表第一个",
|
||||||
"by_name": "按名字"
|
"by_name": "按名字"
|
||||||
},
|
},
|
||||||
"Name": {
|
"Name": {
|
||||||
"name": "邀请学生名",
|
"name": "邀请学生名",
|
||||||
"help": "填写要邀请的学生的名字,使用游戏内语言填写,多个学生使用 > 连接。例:\n日服:ホシノ(水着) > 御坂美琴 > ユズ\n国际服:Hoshino(Swimsuit) > Yuuka > Kayoko(New Year)"
|
"help": "填写要邀请的学生的名字,使用游戏内语言填写,多个学生使用 > 连接。例:\n日服:\tホシノ(水着) > 御坂美琴 > ユズ\n国际服:\tHoshino(Swimsuit) > Yuuka > Kayoko(New Year)"
|
||||||
},
|
},
|
||||||
"Substitute": {
|
"Substitute": {
|
||||||
"name": "是否替换已存在学生",
|
"name": "是否替换已存在学生",
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
import re
|
import re
|
||||||
|
from datetime import datetime, timedelta
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
@ -6,6 +7,7 @@ import numpy as np
|
|||||||
from module.base.base import ModuleBase
|
from module.base.base import ModuleBase
|
||||||
from module.base.timer import Timer
|
from module.base.timer import Timer
|
||||||
from module.base.utils import area_size, area_offset
|
from module.base.utils import area_size, area_offset
|
||||||
|
from module.config.utils import get_server_next_update
|
||||||
from module.logger import logger
|
from module.logger import logger
|
||||||
from module.ocr.ocr import Ocr
|
from module.ocr.ocr import Ocr
|
||||||
from tasks.cafe.assets.assets_cafe import *
|
from tasks.cafe.assets.assets_cafe import *
|
||||||
@ -32,6 +34,7 @@ class InvitationStatus(Enum):
|
|||||||
|
|
||||||
class Invitation:
|
class Invitation:
|
||||||
swipe_vector_range = (0.65, 0.85)
|
swipe_vector_range = (0.65, 0.85)
|
||||||
|
cafe_update = ["04:00", "16:00"]
|
||||||
|
|
||||||
def __init__(self, name: str):
|
def __init__(self, name: str):
|
||||||
self.name = name
|
self.name = name
|
||||||
@ -41,6 +44,7 @@ class Invitation:
|
|||||||
self.invite = MOMOTALK_INVITE
|
self.invite = MOMOTALK_INVITE
|
||||||
|
|
||||||
self.target_names = []
|
self.target_names = []
|
||||||
|
self.waiting_hour = None
|
||||||
self.substitute = None
|
self.substitute = None
|
||||||
self.choice = None
|
self.choice = None
|
||||||
|
|
||||||
@ -95,6 +99,10 @@ class Invitation:
|
|||||||
continue
|
continue
|
||||||
self.current_names.append((name, name_.box))
|
self.current_names.append((name, name_.box))
|
||||||
|
|
||||||
|
@property
|
||||||
|
def is_invitation(self) -> bool:
|
||||||
|
return get_server_next_update(self.cafe_update) - datetime.now() > timedelta(hours=self.waiting_hour)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def names(self):
|
def names(self):
|
||||||
return list(map(lambda x: x[0], self.current_names))
|
return list(map(lambda x: x[0], self.current_names))
|
||||||
@ -212,6 +220,9 @@ invitation = Invitation('test')
|
|||||||
def handle_invitation_status(status: InvitationStatus, main: ModuleBase) -> InvitationStatus:
|
def handle_invitation_status(status: InvitationStatus, main: ModuleBase) -> InvitationStatus:
|
||||||
match status:
|
match status:
|
||||||
case InvitationStatus.MOMOTALK:
|
case InvitationStatus.MOMOTALK:
|
||||||
|
if not invitation.is_invitation:
|
||||||
|
logger.info('Invitation waiting until next refresh')
|
||||||
|
return InvitationStatus.FINISHED
|
||||||
if main.appear(CAFE_INVITED):
|
if main.appear(CAFE_INVITED):
|
||||||
logger.info('Invitation in cooldown')
|
logger.info('Invitation in cooldown')
|
||||||
return InvitationStatus.FINISHED
|
return InvitationStatus.FINISHED
|
||||||
@ -272,6 +283,7 @@ def handle_invitation(main: ModuleBase):
|
|||||||
if not main.config.Invitation_Enable:
|
if not main.config.Invitation_Enable:
|
||||||
logger.info('Invitation disabled')
|
logger.info('Invitation disabled')
|
||||||
return True
|
return True
|
||||||
|
invitation.waiting_hour = main.config.Invitation_WaitingHour
|
||||||
invitation.choice = main.config.Invitation_Choice
|
invitation.choice = main.config.Invitation_Choice
|
||||||
invitation.substitute = main.config.Invitation_Substitute
|
invitation.substitute = main.config.Invitation_Substitute
|
||||||
if invitation.choice == 'by_name' and not invitation.target_names:
|
if invitation.choice == 'by_name' and not invitation.target_names:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user