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

Commit

Permalink
beta release
Browse files Browse the repository at this point in the history
  • Loading branch information
HoloKi committed Mar 19, 2021
1 parent dfed7b2 commit 4a49afb
Show file tree
Hide file tree
Showing 7 changed files with 122 additions and 24 deletions.
81 changes: 81 additions & 0 deletions Invasion.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
import pyautogui
import time
import cv2 as cv
import logging
from colorama import *
from termcolor import colored,cprint
init(autoreset=True) #Permette ad ogni print di ritornare al suo colore base


error = colored("Please report this bug/error on github",'red')


def invasione(run, tempo):
print(colored("\n-----INVASIONE-----", 'cyan', attrs=['bold']))
print(colored("run = ", 'green', attrs=['bold']), colored(run, 'white'), colored(" e durata = ", 'green', attrs=['bold']),
colored(tempo, 'white'), colored("secondi\n", 'green', attrs=['bold']))
conta = 1
logging.debug(f"run = {run}, time = {tempo}")
if run < 0:
logging.debug("Run < 0")
pyautogui.alert(text="Run must be > 0", button="OK")
return 0
else:
if run == 0:
print(colored("Skip Prove di Nyxn",'red', attrs=['bold']))
return 0
else:
invasionebutton = pyautogui.locateCenterOnScreen(r"image\invasione.png", grayscale=False, confidence=0.5)
logging.debug(f"bottone invasione = {invasionebutton}")
if invasionebutton is not None:
pyautogui.click(invasionebutton)
while True:
time.sleep(3)
play = pyautogui.locateCenterOnScreen(r"image\play.png", grayscale=False, confidence=0.5)
logging.debug(f"play = {play}")
if play is not None:
pyautogui.click(play)
time.sleep(3)
accept = pyautogui.locateCenterOnScreen(r"image\accept.png", grayscale=False, confidence=0.5)
logging.debug(f"accept = {accept}")
if accept is not None:
pyautogui.click(accept)
print(colored("Giro numero = ", 'green', attrs=['bold']), colored(conta, 'white'))
time.sleep(int(tempo))
close = pyautogui.locateCenterOnScreen(r"image\close.png", grayscale=False, confidence=0.5)
logging.debug(f"close = {close}")
if close is not None:
pyautogui.click(close)
time.sleep(5)
run = int(run) - 1
conta = int(conta) + 1
if int(run) == 0:
time.sleep(3)
xbutton = pyautogui.locateCenterOnScreen(r"image\xbutton.png", grayscale=False,
confidence=0.5)
if xbutton is not None:
pyautogui.click(xbutton)
break
else:
logging.debug(f"xbutton = {xbutton}")
print(error)
break
else:
logging.debug("close is None")
print(error)
break
else:
logging.debug("accept is None")
print(error)
break
else:
logging.debug("play is None")
print(error)
break
#End while -> tutto ok
return 1
else:
logging.debug(f"problem with invasione.png. return = {invasionebutton} ")
cprint("Invasione non disponibile o non lo trovo!", 'red', attrs=['bold'])
print(error)
return 0
2 changes: 1 addition & 1 deletion PvP.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def pvp(run):
if battle is not None:
pyautogui.click(battle)
time.sleep(2)
accept = pyautogui.locateCenterOnScreen(r"image\accept.png", grayscale=False, confidence=0.5)
accept = pyautogui.locateCenterOnScreen(r"image\accept.png", grayscale=False, confidence=0.9)
logging.debug(f"accept = {accept}")
if accept is not None:
pyautogui.click(accept)
Expand Down
Binary file added __pycache__/Invasion.cpython-39.pyc
Binary file not shown.
Binary file modified __pycache__/PvP.cpython-39.pyc
Binary file not shown.
28 changes: 22 additions & 6 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@
import ProveN
import GvG
import Expedition
import Invasion
from colorama import *
from termcolor import colored,cprint

init(autoreset=True); #Permette ad ogni print di ritornare al suo colore base

VERSION = 3.1
VERSION = 4.1

hero = "heroic"
hard = "hard"
Expand Down Expand Up @@ -131,14 +132,24 @@ def menu():
Expedition.spedizione(int(exprun),int(exptime))
return 1
else:
if int(a) == 10:
debug()
if int(a) == 9:
cprint("Quante run dell'invasione vuoi fare?", 'green', attrs=['bold'])
invrun = input()
cprint("Quanto ci impieghi in secondi a finirne uno?", 'green', attrs=['bold'])
cprint("Attento: aggiungi del tempo in piu in caso per non impallare il bot!",
'red', attrs=['bold'])
invento = input()
Invasion.invasione(int(invrun), invento)
return 1;
else:
if int(a) == 0:
return 0
if int(a) == 10:
debug()
return 1;
else:
cprint("Non esiste un'opzione relativo a questo numero!",'red',attrs=['bold'])
if int(a) == 0:
return 0
else:
cprint("Non esiste un'opzione relativo a questo numero!",'red',attrs=['bold'])


def test(name, numero):
Expand Down Expand Up @@ -217,6 +228,11 @@ def debug():
print(colored("Prove presente!",'blue',attrs=['bold']))
else:
print(f"Prove di Nyxn = {prove}")
invasione = pyautogui.locateCenterOnScreen(r"image\invasione.png", grayscale=False, confidence=0.5)
if invasione is not None:
print(colored("Invasione presente!", 'blue', attrs=['bold']))
else:
print(f"Invasione = {invasione}")
print(colored("\nNel caso ci fossero dei None, assicurati che siano disponibili, in tal caso spostati",'red',attrs=['bold']))
time.sleep(5)
return 1;
Expand Down
Binary file modified image/accept.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 18 additions & 17 deletions latest.log
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
2021-03-19 01:23:01,163 - main : VERSION : 3.1 - BOT by HoloKi. Info : https://github.com/HoloKi/BitHeroesBot
2021-03-19 01:23:04,125 - menu : Menu input = 10
2021-03-19 01:24:01,261 - menu : Menu input = 10
2021-03-19 01:24:07,547 - menu : Menu input = 6
2021-03-19 01:24:13,055 - prove : run = 1, time = 200
2021-03-19 01:24:13,304 - prove : bottone prove = Point(x=815, y=263)
2021-03-19 01:24:16,726 - prove : play = Point(x=588, y=348)
2021-03-19 01:24:20,112 - prove : accept = None
2021-03-19 01:24:20,112 - prove : accept is None
2021-03-19 01:28:22,859 - menu : Menu input = 6
2021-03-19 01:28:27,604 - prove : run = 2, time = 200
2021-03-19 01:28:27,859 - prove : bottone prove = Point(x=815, y=263)
2021-03-19 01:28:31,271 - prove : play = Point(x=588, y=348)
2021-03-19 01:28:34,650 - prove : accept = Point(x=561, y=522)
2021-03-19 01:31:55,055 - prove : close = Point(x=391, y=424)
2021-03-19 01:32:03,453 - prove : play = Point(x=588, y=348)
2021-03-19 01:32:06,807 - prove : accept = Point(x=561, y=522)
2021-03-19 17:59:15,647 - main : VERSION : 3.1 - BOT by HoloKi. Info : https://github.com/HoloKi/BitHeroesBot
2021-03-19 18:00:53,463 - menu : Menu input = 10
2021-03-19 18:00:59,935 - menu : Menu input = 2
2021-03-19 18:01:03,180 - pvp : run = 3
2021-03-19 18:01:03,424 - pvp : pvp button = Point(x=76, y=177)
2021-03-19 18:01:05,816 - pvp : play = Point(x=577, y=324)
2021-03-19 18:01:08,195 - pvp : battle = Point(x=630, y=254)
2021-03-19 18:01:10,546 - pvp : accept = Point(x=554, y=504)
2021-03-19 18:01:50,941 - pvp : close = Point(x=441, y=489)
2021-03-19 18:01:55,343 - pvp : play = Point(x=577, y=324)
2021-03-19 18:01:57,695 - pvp : battle = Point(x=630, y=254)
2021-03-19 18:02:00,061 - pvp : accept = Point(x=554, y=504)
2021-03-19 18:02:40,463 - pvp : close = Point(x=441, y=489)
2021-03-19 18:02:44,852 - pvp : play = Point(x=577, y=324)
2021-03-19 18:02:47,211 - pvp : battle = Point(x=630, y=254)
2021-03-19 18:02:49,564 - pvp : accept = Point(x=554, y=504)
2021-03-19 18:03:29,937 - pvp : close = Point(x=441, y=489)
2021-03-19 18:03:32,293 - pvp : xbutton = Point(x=673, y=172)

0 comments on commit 4a49afb

Please sign in to comment.