Skip to content

Commit

Permalink
Ajust Check Working
Browse files Browse the repository at this point in the history
  • Loading branch information
JacksonLizier committed Feb 28, 2022
1 parent 5bd018e commit 3b74aa5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
# [pt_BR]
# Tempo que o Bot pode ficar sem executar nenhuma ação. Após esse tempo o bot reinicia o Jogo
# Valor padrão: 10
Check_Bot_Work: 2
Check_Bot_Work: 5

# [en_US]
# Type Refresh page
Expand Down
15 changes: 10 additions & 5 deletions index.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,9 @@ def refreshSpaceships(qtd):
count_nexList = 1

def goToFight():
logger("Go fight")
CheckBotWork(SetWorking=True)

clickBtn(images['spg-go-to-boss'])
time.sleep(1)
clickBtn(images['spg-confirm'])
Expand All @@ -422,13 +425,12 @@ def surrenderFight():
clickBtn(images['spg-confirm-surrender'])
global count_victory
count_victory = 0
CheckBotWork(SetWorking=True)

def endFight():
logger("End fight")

global bot_working
bot_working = True

CheckBotWork(SetWorking=True)

time.sleep(3)
returnBase()
time.sleep(15)
Expand Down Expand Up @@ -538,10 +540,13 @@ def checkProcessing():
if len(positions(images['spg-processing'], threshold=ct['commom_position'])) > 0:
return True

def CheckBotWork():
def CheckBotWork(SetWorking = False):
global bot_working
global last
now = time.time()

if SetWorking == True:
bot_working = True

if bot_working == False:
logger('Bot is not performing any action.')
Expand Down

0 comments on commit 3b74aa5

Please sign in to comment.