@@ -322,9 +322,9 @@ def useBagConsumables():
322322 click ('buttons/back' , region = boundaries ['backMenu' ])
323323 click ('buttons/back' , region = boundaries ['backMenu' ])
324324 return
325- clickXY (550 , 1800 )
326- clickXY (950 , 1750 )
327- click ('buttons/back' , region = boundaries ['backMenu' ])
325+ clickXY (550 , 1800 ) # Use
326+ clickXY (950 , 1700 ) # 'All' Bag button to clear loot
327+ click ('buttons/back' , region = boundaries ['backMenu' ], suppress = True )
328328 printGreen (' Bag consumables used!' )
329329 else :
330330 printError (' Bag not found, attempting to recover' )
@@ -463,6 +463,8 @@ def pushCampaign(formation=3, duration=1):
463463 recover ()
464464
465465def configureBattleFormation (formation ):
466+ artifacts = None
467+ counter = 0
466468 if config .getboolean ('ADVANCED' , 'ignoreformations' ) is True :
467469 printWarning ('ignoreformations enabled, skipping formation selection' )
468470 click ('buttons/autobattle' , suppress = True , retry = 3 , region = boundaries ['autobattle' ]) # So we don't hit it in the background while autobattle is active
@@ -473,9 +475,20 @@ def configureBattleFormation(formation):
473475 clickXY (800 , 1650 , seconds = 2 ) # Change to 'Popular' tab
474476 clickXY (850 , 425 + (formation * 175 ), seconds = 2 )
475477 click ('buttons/use' , retry = 3 , region = boundaries ['useAB' ], seconds = 2 )
476- artifacts = isVisible ('buttons/checkbox_checked' , region = (230 , 1100 , 80 , 80 ), confidence = 0.85 ) # Check checkbox status
477- if artifacts != config .getboolean ('PUSH' , 'useartifacts' ):
478+
479+ # Configure Artifacts
480+ while artifacts is None and counter <= 5 : # loop because sometimes isVisible returns None here
481+ artifacts = isVisible ('buttons/checkbox_checked' , region = (230 , 1100 , 80 , 80 )) # Check checkbox status
482+ counter += 1
483+ if counter >= 5 : # If still None after 5 tries give error and contiue without configuring
484+ printError ('Couldn\' t read artifact status' )
485+ if artifacts is not config .getboolean ('PUSH' , 'useartifacts' ) and artifacts is not None :
486+ if config .getboolean ('PUSH' , 'useartifacts' ):
487+ printBlue ('Enabling Artifact copying' )
488+ else :
489+ printBlue ('Disabling Artifact copying' )
478490 clickXY (275 , 1150 ) # clickXY not ideal here but my brain is fried so it'll do for now
491+
479492 click ('buttons/confirm_small' , retry = 3 , region = boundaries ['confirmAB' ])
480493 click ('buttons/autobattle' , retry = 3 , region = boundaries ['autobattle' ]) # So we don't hit it in the background while autobattle is active
481494 clickSecure ('buttons/activate' , 'labels/autobattle' , region = boundaries ['activateAB' ], secureregion = boundaries ['autobattleLabel' ])
@@ -781,6 +794,7 @@ def handleTwistedRealm():
781794 printError (' Challenge button not found, attempting to recover' )
782795 else :
783796 printError (' Error opening Twisted Realm, attempting to recover' )
797+ # TODO Add 'Calculating' confirmation to exit safely
784798 recover ()
785799
786800# Opens a Fight of Fates battle and then cycles between dragging heroes and dragging skills until we see the battle end screen
@@ -1385,3 +1399,6 @@ def returnBattleResults(type, firstOfMulti=False):
13851399 return False
13861400 else :
13871401 return 'Unknown'
1402+
1403+ def handleHeroesofEsperia ():
1404+ print ('soon' )
0 commit comments