|
@@ -39,7 +39,6 @@ class RoomType(str, Enum):
|
|
|
class GeneralInvite(BaseTask, BondlingFairylandAssets, GeneralInviteAssets):
|
|
class GeneralInvite(BaseTask, BondlingFairylandAssets, GeneralInviteAssets):
|
|
|
timer_invite = None
|
|
timer_invite = None
|
|
|
timer_wait = None
|
|
timer_wait = None
|
|
|
- timer_emoji = None # 等待期间如果没有操作的话,可能会导致长时间无响应报错
|
|
|
|
|
|
|
|
|
|
"""
|
|
"""
|
|
|
|
|
|
|
@@ -67,8 +66,6 @@ class GeneralInvite(BaseTask, BondlingFairylandAssets, GeneralInviteAssets):
|
|
|
else:
|
|
else:
|
|
|
self.timer_invite = Timer(30)
|
|
self.timer_invite = Timer(30)
|
|
|
self.timer_invite.start()
|
|
self.timer_invite.start()
|
|
|
- self.timer_emoji = Timer(20)
|
|
|
|
|
- self.timer_emoji.start()
|
|
|
|
|
wait_second = config.wait_time.second + config.wait_time.minute * 60
|
|
wait_second = config.wait_time.second + config.wait_time.minute * 60
|
|
|
self.timer_wait = Timer(wait_second)
|
|
self.timer_wait = Timer(wait_second)
|
|
|
self.timer_wait.start()
|
|
self.timer_wait.start()
|
|
@@ -84,11 +81,6 @@ class GeneralInvite(BaseTask, BondlingFairylandAssets, GeneralInviteAssets):
|
|
|
if not self.is_in_room():
|
|
if not self.is_in_room():
|
|
|
continue
|
|
continue
|
|
|
|
|
|
|
|
- if self.timer_emoji and self.timer_emoji.reached():
|
|
|
|
|
- self.timer_emoji.reset()
|
|
|
|
|
- self.appear_then_click(self.I_GI_EMOJI_1)
|
|
|
|
|
- self.appear_then_click(self.I_GI_EMOJI_2)
|
|
|
|
|
-
|
|
|
|
|
fire = False # 是否开启挑战
|
|
fire = False # 是否开启挑战
|
|
|
# 如果这个房间最多只容纳两个人(意思是只可以邀请一个人),且已经邀请一个人了,那就开启挑战
|
|
# 如果这个房间最多只容纳两个人(意思是只可以邀请一个人),且已经邀请一个人了,那就开启挑战
|
|
|
if self.room_type == RoomType.NORMAL_2 and not self.appear(self.I_ADD_1):
|
|
if self.room_type == RoomType.NORMAL_2 and not self.appear(self.I_ADD_1):
|
|
@@ -132,7 +124,7 @@ class GeneralInvite(BaseTask, BondlingFairylandAssets, GeneralInviteAssets):
|
|
|
self.timer_invite.reset()
|
|
self.timer_invite.reset()
|
|
|
else:
|
|
else:
|
|
|
logger.info('Wait for 30s and invite again')
|
|
logger.info('Wait for 30s and invite again')
|
|
|
- self.timer_invite = None
|
|
|
|
|
|
|
+ self.timer_invite.reset()
|
|
|
self.invite_friends(config)
|
|
self.invite_friends(config)
|
|
|
|
|
|
|
|
def ensure_enter(self) -> bool:
|
|
def ensure_enter(self) -> bool:
|
|
@@ -566,8 +558,6 @@ class GeneralInvite(BaseTask, BondlingFairylandAssets, GeneralInviteAssets):
|
|
|
:return: 如果成功进入战斗(反正就是不在房间 )返回 True
|
|
:return: 如果成功进入战斗(反正就是不在房间 )返回 True
|
|
|
如果失败了,(退出房间)返回 False
|
|
如果失败了,(退出房间)返回 False
|
|
|
"""
|
|
"""
|
|
|
- self.timer_emoji = Timer(15)
|
|
|
|
|
- self.timer_emoji.start()
|
|
|
|
|
wait_second = wait_time.second + wait_time.minute * 60
|
|
wait_second = wait_time.second + wait_time.minute * 60
|
|
|
self.timer_wait = Timer(wait_second)
|
|
self.timer_wait = Timer(wait_second)
|
|
|
self.timer_wait.start()
|
|
self.timer_wait.start()
|
|
@@ -596,14 +586,10 @@ class GeneralInvite(BaseTask, BondlingFairylandAssets, GeneralInviteAssets):
|
|
|
|
|
|
|
|
# 判断是否进入战斗
|
|
# 判断是否进入战斗
|
|
|
if self.is_in_room(is_screenshot=False):
|
|
if self.is_in_room(is_screenshot=False):
|
|
|
- if self.timer_emoji.reached():
|
|
|
|
|
- self.timer_emoji.reset()
|
|
|
|
|
- self.appear_then_click(self.I_GI_EMOJI_1)
|
|
|
|
|
- self.appear_then_click(self.I_GI_EMOJI_2)
|
|
|
|
|
|
|
+ pass
|
|
|
else:
|
|
else:
|
|
|
break
|
|
break
|
|
|
|
|
|
|
|
-
|
|
|
|
|
# 调出循环只有这些可能性:
|
|
# 调出循环只有这些可能性:
|
|
|
# 1. 进入战斗(ui是战斗)
|
|
# 1. 进入战斗(ui是战斗)
|
|
|
# 2. 队长跑路(自己还是在房间里面)
|
|
# 2. 队长跑路(自己还是在房间里面)
|