Skip to content
This repository has been archived by the owner on Mar 31, 2023. It is now read-only.

Commit

Permalink
gvg added
Browse files Browse the repository at this point in the history
  • Loading branch information
HoloKi committed Feb 23, 2021
1 parent 497a053 commit 47d2b41
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 12 deletions.
67 changes: 63 additions & 4 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,65 @@ def prove(run, tempo):
return 0



def gvg(run,tempo):
conta = 1
print("GVG")
print(f"run = {run},tempo = {tempo}s")
time.sleep(2)
gvgbutton = pyautogui.locateCenterOnScreen("gvg.png",grayscale=False,confidence=0.5)
if gvgbutton is not None:
logging.debug(f"gvgbutton = {gvgbutton}")
pyautogui.click(gvgbutton)
time.sleep(5)
while True:
print(f"giro numero: {conta}")
conta = int(conta) + 1
play = pyautogui.locateCenterOnScreen("play.png",grayscale=False,confidence=0.5)
if play is not None:
logging.debug(f"play = {play}")
pyautogui.click(play)
time.sleep(5)
battle = pyautogui.locateCenterOnScreen("battle1.png", grayscale=False,confidence=0.5)
if battle is not None:
logging.debug(f"battle = {battle}")
pyautogui.click(battle)
#time.sleep(1)
#battle = pyautogui.locateCenterOnScreen("battle2.png", grayscale=False, confidence=0.5)
#pyautogui.click(battle)
time.sleep(5)
accept = pyautogui.locateCenterOnScreen("accept.png",grayscale=False,confidence=0.5)
if accept is not None:
logging.debug(f"accept = {accept}")
pyautogui.click(accept)
time.sleep(int(tempo))
chiudi = pyautogui.locateCenterOnScreen("close.png",grayscale=False,confidence=0.5)
if chiudi is not None:
logging.debug(f"close = {chiudi}")
pyautogui.click(chiudi)
time.sleep(5)
if run == 1:
xbutton = pyautogui.locateCenterOnScreen("xbutton.png",grayscale=False,confidence=0.5)
pyautogui.click(xbutton)
break
else:
run = int(run) - 1
else:
logging.debug(f"close = {chiudi}")
else:
logging.debug(f"accept = {accept}")

else:
print("Report this on github!")
logging.debug(f"battle = {battle}")
else:
print("Report this on github!")
logging.debug(f"play = {play}")
else:
print("Gvg non disponibile o non riconosciuto. Nel caso spostati e ritenta")
logging.debug(f"gvg not found! gvgbutton = {gvgbutton}")


# potrei fare def setconfig(a,b,c)
def setconfig():
f = open("data.json", "w")
Expand Down Expand Up @@ -424,10 +483,10 @@ def main():
# c = input("Inserisci il tempo impiegato per finire una run(in secondi). Attento...meglio dare qualche secondo in piu! \n")
# Raid(a,str(b),c)
print("Start")
while True:
ciclo = menu()
if ciclo == 0:
exit()
#while True:
# ciclo = menu()
# if ciclo == 0:
# exit()



Expand Down
Binary file added gvg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 10 additions & 8 deletions latest.log
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
2021-02-23 09:27:36,292 - main : VERSION : 2.2 - BOT by HoloKi. Info : https://github.com/HoloKi/BitHeroesBot
2021-02-23 09:27:42,146 - menu : Menu input = 6
2021-02-23 09:27:46,796 - prove : run = 1, time = 200
2021-02-23 09:27:47,001 - prove : bottone prove = Point(x=806, y=313)
2021-02-23 09:27:50,392 - prove : play = Point(x=595, y=366)
2021-02-23 09:27:53,740 - prove : accept = Point(x=563, y=550)
2021-02-23 09:31:14,061 - prove : close = Point(x=369, y=450)
2021-02-23 09:32:13,504 - menu : Menu input = 0
2021-02-23 10:36:36,964 - main : VERSION : 2.2 - BOT by HoloKi. Info : https://github.com/HoloKi/BitHeroesBot
2021-02-23 10:36:59,860 - gvg : gvgbutton = Point(x=805, y=240)
2021-02-23 10:37:05,263 - gvg : play = Point(x=595, y=366)
2021-02-23 10:37:10,614 - gvg : battle = Point(x=650, y=283)
2021-02-23 10:37:15,967 - gvg : accept = Point(x=563, y=550)
2021-02-23 10:38:46,282 - gvg : close = Point(x=445, y=537)
2021-02-23 10:38:51,716 - gvg : play = Point(x=595, y=366)
2021-02-23 10:38:57,024 - gvg : battle = Point(x=650, y=283)
2021-02-23 10:39:02,369 - gvg : accept = Point(x=563, y=550)
2021-02-23 10:40:32,676 - gvg : close = Point(x=445, y=537)

0 comments on commit 47d2b41

Please sign in to comment.