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

Commit

Permalink
error fix
Browse files Browse the repository at this point in the history
  • Loading branch information
HoloKi committed Jul 4, 2021
1 parent 611a68e commit 5315a91
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 32 deletions.
Binary file not shown.
13 changes: 9 additions & 4 deletions PvPClass.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,24 @@
init(autoreset=True) # Permette ad ogni print di ritornare al suo colore base

#repo = colored("C'è stato un problema con il bot. Segnalalo allo sviluppatore inviando il file ",'red') + "latest.log"
error = colored("Please report this bug/error on github or discord\n",'red',attrs=['bold'])
#error = colored("Please report this bug/error on github or discord\n",'red',attrs=['bold'])

def pvp(run):
error = colored("Please report this bug/error on github or discord\n", 'red', attrs=['bold'])
#Caso in cui run <=0
if run<=0:
print(colored("Run <=0, skip PvP",'red'))
logging.debug("Run<=0")
return 0
else:
print(colored("\n-----PVP-----", 'cyan', attrs=['bold']))
print(colored("run = ", 'green', attrs=['bold']), colored(run, 'white'), colored("\n"))
#load class-------------------------------------
pvp = classe.bit(r"image\pvp.png",0.5)
play = classe.bit(r"image\play.png",0.5)
select = classe.bit(r"image\battle2.png",0.5)
accetta = classe.bit(r"image\accept.png",0.5)
defeat = classe.bit(r"image\defeat.png",0.5)
defeat = classe.bit(r"image\defeat.png",0.7)
chiudi = classe.bit(r"image\close.png",0.5)
#-----------------------------------------------
conta = 0
Expand All @@ -34,7 +37,7 @@ def pvp(run):
return 0
#timer(50)
while(True):
conta +=1
conta =int(conta) + 1
errore = play.bottone()
if errore == 0:
cprint(error)
Expand All @@ -50,7 +53,9 @@ def pvp(run):
cprint(error)
break
return 0
time.sleep(50)
#time.sleep(50)
print(f"Match n: {conta}")
timer(40)
# controllo se è morto---------------
error = defeat.ispresence()
if error == 1: # se è morto clicca
Expand Down
9 changes: 5 additions & 4 deletions RaidClass.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
import classe
init(autoreset=True) #Permette ad ogni print di ritornare al suo colore base

hero = "heroic"
hard = "hard"
norm = "normal"

errore=colored("Please report this bug/error on github or discord\n",'red',attrs=['bold'])
"""
Expand All @@ -22,6 +19,10 @@
@:return 0 se è andato storto
"""
def raid(run, difficult, duration):
hero = "heroic"
hard = "hard"
norm = "normal"
difficulty = None #default
count=0;
# LOAD CLASS FIRST-----------------------------------------------------------------
if difficult == hero:
Expand All @@ -34,7 +35,7 @@ def raid(run, difficult, duration):
evoca = classe.bit(r"image\startraid.png",0.5)
accetta = classe.bit(r"image\accept.png", 0.5)
si = classe.bit(r"image\yes.png", 0.5)
morte = classe.bit(r"image\raid\raiddie.png",0.5)
morte = classe.bit(r"image\raid\raiddie.png",0.7)
chiudi = classe.bit(r"image\raid\close.png",0.5)
#---------------------------------------------------------------------------------
logging.debug(f"difficult = {difficulty}.")
Expand Down
Binary file added __pycache__/PvPClass.cpython-39.pyc
Binary file not shown.
Binary file modified __pycache__/RaidClass.cpython-39.pyc
Binary file not shown.
Binary file removed __pycache__/raid.cpython-39.pyc
Binary file not shown.
18 changes: 7 additions & 11 deletions bot.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
import pyautogui
import time
import json
import cv2 as cv
import logging
import RaidClass
import Cimento
import PvP
import PvPClass
import ProveN
import GvG
import Expedition
import Invasion
from colorama import *
from termcolor import colored,cprint
import asyncio

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

VERSION = "5.0.1"
VERSION = "5.0.2"

hero = "heroic"
hard = "hard"
Expand All @@ -26,8 +21,8 @@ def menu():
print("\n\n")
print(colored("Enter the number to select the desired option:\n",'red',attrs=['bold']))
print(colored("1) ",'white'),colored("Raid",'green',attrs=['bold']))
"""
print(colored("2) ",'white'),colored("Pvp",'green',attrs=['bold']))
"""
print(colored("3) ",'white'),colored("Cimento",'green',attrs=['bold']))
print(colored("4) ",'white'),colored("Change daily settings",'red',attrs=['bold']))
print(colored("5) ",'white'),colored("Daily",'green',attrs=['bold']))
Expand Down Expand Up @@ -69,15 +64,16 @@ def menu():
print(colored("Something went wrong with typing the numbers",'red',attrs=['bold']))
return 1
else:
cprint("There is no option for this number!", 'red', attrs=['bold'])
"""
if int(a) == 2:
print(colored("ATTENTO: il bot selezionerà di default il primo nella lista!\n",'red',attrs=['bold']),
colored("Tempo default: 40 secondi -> se è troppo poco segnalalo allo sviluppatore!",'red',attrs=['bold']))
cprint("Quante run di pvp vuoi fare?\n",'green',attrs=['bold'])
pvprun = input()
PvP.pvp(int(pvprun))
PvPClass.pvp(int(pvprun))
return 1
else:
cprint("There is no option for this number!", 'red', attrs=['bold'])
"""
else:
if int(a) == 3:
cprint("Quante run del cimento vuoi fare?",'green',attrs=['bold'])
Expand Down
10 changes: 9 additions & 1 deletion data.json
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
{"name": "Utente", "raid": "7", "difficolta": "heroic", "temporaid": "200", "pvp": "3", "cimento": "2", "ctime": "2"}
{
"name": "Utente",
"raid": "7",
"difficolta": "heroic",
"temporaid": "200",
"pvp": "3",
"cimento": "2",
"ctime": "2"
}
18 changes: 6 additions & 12 deletions latest.log
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
2021-07-02 11:34:31,048 - main : VERSION : 5.0.1 - BOT by HoloKi. Info : https://github.com/HoloKi/BitHeroesBot
2021-07-02 11:34:31,049 - main : https://discord.gg/h98xsssEpe
2021-07-02 11:34:36,395 - menu : Menu input = 1
2021-07-02 11:34:41,741 - raid : difficult = <classe.bit object at 0x0000028C710A9E20>.
2021-07-02 11:34:41,756 - raid : run = 1, difficolt� = heroic, durata = 60
2021-07-02 11:34:45,021 - bottone : bottone = Point(x=597, y=360)
2021-07-02 11:34:49,434 - bottone : bottone = Point(x=1096, y=398)
2021-07-02 11:34:53,855 - bottone : bottone = Point(x=1143, y=266)
2021-07-02 11:34:58,211 - bottone : bottone = Point(x=1074, y=484)
2021-07-02 11:36:03,015 - ispresence : presence = Point(x=963, y=282)
2021-07-02 11:36:03,237 - bottone : bottone = Point(x=962, y=383)
2021-07-02 11:36:10,482 - menu : ritorno del raid = None
2021-07-05 00:31:56,277 - main : VERSION : 5.0.2 - BOT by HoloKi. Info : https://github.com/HoloKi/BitHeroesBot
2021-07-05 00:31:56,278 - main : https://discord.gg/h98xsssEpe
2021-07-05 00:32:02,137 - menu : Menu input = 2
2021-07-05 00:32:03,484 - bottone : bottone = None
2021-07-05 00:32:03,486 - bottone : image\pvp.png not found!
2021-07-05 00:32:03,487 - <module> : local variable 'error' referenced before assignment

1 comment on commit 5315a91

@HoloKi
Copy link
Owner Author

@HoloKi HoloKi commented on 5315a91 Jul 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok for 5.0.2

Please sign in to comment.