Skip to content

Commit

Permalink
fix: fix the attempts login
Browse files Browse the repository at this point in the history
  • Loading branch information
newerton committed Jan 24, 2022
1 parent 2c3ce63 commit 102e0fc
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions config/version.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version:
app: "1.5.18"
config_file: "1.5.18"
app: "1.5.19"
config_file: "1.5.19"
emergency: "false"

1 change: 1 addition & 0 deletions src/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ def clickNewMap(self):
self.bcoins.getBcoins()

def refreshPage(self):
self.importLibs()
self.log.console('Refreshing page', services=True,
emoji='🔃', color='green')
pyautogui.hotkey('ctrl', 'shift', 'r')
Expand Down
7 changes: 5 additions & 2 deletions src/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ def login(self):
metamaskData = self.config['metamask']

connect_wallet_button = self.images.image('connect_wallet_button')
metamask_cancel_button = self.images.image('metamask_cancel_button')
metamask_sign_button = self.images.image('metamask_sign_button')
metamask_unlock_button = self.images.image('metamask_unlock_button')
treasure_hunt_banner = self.images.image('treasure_hunt_banner')
Expand Down Expand Up @@ -83,7 +82,11 @@ def login(self):
self.log.console('+3 login attempts, retrying',
services=True, emoji='🔃', color='red')
login_attempts = 0
self.errors.verify()
self.actions.refreshPage()
self.actions.sleep(1, 1, forceTime=True, randomMouseMovement=False)
self.login()

self.errors.verify()

def checkLogout(self):
Expand All @@ -100,13 +103,13 @@ def checkLogout(self):
self.log.console('Logout detected',
services=True, emoji='😿', color='red')
self.actions.refreshPage()
self.login()
elif self.recognition.positions(metamask_sign_button):
self.log.console('Sing button detected',
services=True, emoji='✔️', color='green')
if self.actions.clickButton(metamask_cancel_button):
self.log.console('Metamask is glitched, fixing',
services=True, emoji='🙀', color='yellow')
self.actions.refreshPage()
else:
return False

Expand Down
2 changes: 1 addition & 1 deletion src/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def console(self, message, services=False, emoji=False, color='default'):
def mapClicked(self):
self.importLibs()
if self.actions.clickButton(new_map_btn_img):
self.console('🗺️ New Map button clicked!')
self.console('New Map button clicked!', emoji='🗺️')
file = open("./logs/new-map.log", "a", encoding='utf-8')
file.write(self.date.dateFormatted() + '\n')
file.close()

0 comments on commit 102e0fc

Please sign in to comment.