Skip to content

Commit 3b74aa5

Browse files
committed
Ajust Check Working
1 parent 5bd018e commit 3b74aa5

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@
134134
# [pt_BR]
135135
# Tempo que o Bot pode ficar sem executar nenhuma ação. Após esse tempo o bot reinicia o Jogo
136136
# Valor padrão: 10
137-
Check_Bot_Work: 2
137+
Check_Bot_Work: 5
138138

139139
# [en_US]
140140
# Type Refresh page

index.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,9 @@ def refreshSpaceships(qtd):
411411
count_nexList = 1
412412

413413
def goToFight():
414+
logger("Go fight")
415+
CheckBotWork(SetWorking=True)
416+
414417
clickBtn(images['spg-go-to-boss'])
415418
time.sleep(1)
416419
clickBtn(images['spg-confirm'])
@@ -422,13 +425,12 @@ def surrenderFight():
422425
clickBtn(images['spg-confirm-surrender'])
423426
global count_victory
424427
count_victory = 0
428+
CheckBotWork(SetWorking=True)
425429

426430
def endFight():
427431
logger("End fight")
428-
429-
global bot_working
430-
bot_working = True
431-
432+
CheckBotWork(SetWorking=True)
433+
432434
time.sleep(3)
433435
returnBase()
434436
time.sleep(15)
@@ -538,10 +540,13 @@ def checkProcessing():
538540
if len(positions(images['spg-processing'], threshold=ct['commom_position'])) > 0:
539541
return True
540542

541-
def CheckBotWork():
543+
def CheckBotWork(SetWorking = False):
542544
global bot_working
543545
global last
544546
now = time.time()
547+
548+
if SetWorking == True:
549+
bot_working = True
545550

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

0 commit comments

Comments
 (0)