Skip to content
This repository was archived by the owner on Mar 24, 2025. It is now read-only.

Commit 914be14

Browse files
committed
0.9.1
-Added Exception handling for server errors (Need Testing) -Changed Slash Gift Priority to 2 and 3
1 parent 1fbdc56 commit 914be14

File tree

4 files changed

+21
-3
lines changed

4 files changed

+21
-3
lines changed

pictures/general/retry.png

1.84 KB
Loading

pictures/general/server_error.png

19 KB
Loading

src/core.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,17 @@ def post_run_load():
4242
while(not common.element_exist("pictures/general/module.png")):
4343
common.sleep(1)
4444
logger.info("Loaded back to Main Menu")
45+
46+
def reconnect():
47+
while(common.element_exist("pictures/general/server_error.png")):
48+
common.sleep(6)
49+
common.click_matching("pictures/general/retry.png")
50+
common.mouse_move(200,200)
51+
if common.element_exist("pictures/general/no_op.png"):
52+
common.click_matching("pictures/general/close.png")
53+
logger.info("COULD NOT RECONNECT TO THE SERVER. SHUTTING DOWN!")
54+
exit()
55+
logger.info("Reconnected")
4556

4657
def battle():
4758
"""Handles battles by mashing winrate, also handles skill checks and end of battle loading"""
@@ -65,6 +76,9 @@ def battle():
6576
common.mouse_move_click(1624,1007) #handle onscreen prompts example sinking wolf
6677
common.key_press("p") #win rate keyboard key
6778
common.key_press("enter") #Battle Start key
79+
if common.element_exist("pictures/general/server_error.png"):
80+
logger.info("Lost Connection to Server, Reconnecting")
81+
reconnect()
6882

6983

7084
def battle_check(): #pink shoes, woppily, doomsday clock

src/mirror.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from src import common, mirror_utils
2-
from src.core import skill_check, battle, check_loading, transition_loading,post_run_load
2+
from src.core import skill_check,reconnect, battle, check_loading, transition_loading,post_run_load
33
import logging
44

55
class Mirror:
@@ -50,9 +50,10 @@ def start_mirror(self):
5050
self.logger.info("Starting Run")
5151

5252
if common.element_exist("pictures/general/maint.png"):
53-
common.click_matching("pictures/general/confirm_b.png")
53+
common.click_matching("pictures/general/close.png")
54+
common.sleep(0.5)
5455
common.click_matching("pictures/general/no_op.png")
55-
common.click_matching("pictures/general/confirm_b.png")
56+
common.click_matching("pictures/general/close.png")
5657
self.logger.info("SERVER UNDERGOING MAINTAINANCE, BOT WILL STOP NOW!")
5758
exit()
5859

@@ -82,6 +83,9 @@ def start_mirror(self):
8283
run_complete = 1
8384
win_flag = 1
8485
return win_flag,run_complete
86+
87+
if common.element_exist("pictures/general/server_error.png"):
88+
reconnect()
8589

8690
if common.element_exist("pictures/mirror/general/gift_select.png"): #Checks if in gift select
8791
self.gift_selection()

0 commit comments

Comments
 (0)