From 5315a917b97b71d83fdcacbf77228e8d1a069eaf Mon Sep 17 00:00:00 2001 From: Khiem Vo <8721247+HoloKi@users.noreply.github.com> Date: Mon, 5 Jul 2021 00:39:57 +0200 Subject: [PATCH] error fix --- .../__pycache__}/PvP.cpython-39.pyc | Bin 2498 -> 2509 bytes PvPClass.py | 13 +++++++++---- RaidClass.py | 9 +++++---- __pycache__/PvPClass.cpython-39.pyc | Bin 0 -> 1896 bytes __pycache__/RaidClass.cpython-39.pyc | Bin 2513 -> 2527 bytes __pycache__/raid.cpython-39.pyc | Bin 3838 -> 0 bytes bot.py | 18 +++++++----------- data.json | 10 +++++++++- latest.log | 18 ++++++------------ 9 files changed, 36 insertions(+), 32 deletions(-) rename {__pycache__ => Deprecated/__pycache__}/PvP.cpython-39.pyc (92%) create mode 100644 __pycache__/PvPClass.cpython-39.pyc delete mode 100644 __pycache__/raid.cpython-39.pyc diff --git a/__pycache__/PvP.cpython-39.pyc b/Deprecated/__pycache__/PvP.cpython-39.pyc similarity index 92% rename from __pycache__/PvP.cpython-39.pyc rename to Deprecated/__pycache__/PvP.cpython-39.pyc index 382509cb46bc738675c47e69145df30aa8c3e490..fc2e885fceda48060aadc035a394dd108979ef80 100644 GIT binary patch delta 66 zcmX>kd{%gaHHY9Ww&aY=(v-}V3`J@T3=F@_Ci`%xa=D}y6s0C7mZYX^F5r-26aYzq Mrd`NhMHHTmnTXIHbX-eiwh9Xr428LhSlYKZ;H`j1TG75nBU_l6>HhC$h1^~HT B4YmLP diff --git a/PvPClass.py b/PvPClass.py index d9fc079..eb03d9d 100644 --- a/PvPClass.py +++ b/PvPClass.py @@ -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 @@ -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) @@ -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 diff --git a/RaidClass.py b/RaidClass.py index a030f0e..b6b9234 100644 --- a/RaidClass.py +++ b/RaidClass.py @@ -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']) """ @@ -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: @@ -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}.") diff --git a/__pycache__/PvPClass.cpython-39.pyc b/__pycache__/PvPClass.cpython-39.pyc new file mode 100644 index 0000000000000000000000000000000000000000..596ad857a107328bdc17ca9ec80e6e9cbdc40647 GIT binary patch literal 1896 zcmZuyPj4JG6d%u@oj=*#Y-rM?v`9mR1dC{?a^Mi9EoyS$K&z;<99E0O?AVzMnVp%~ z-c%V)PRlh??+9sg?2XUR0|&kVJ|U2ha^VB?0`Ga!)wabWKR^Hc^Ru7*o+s*b0t3qL zU;O#~<0ZrR3pTS`{uyXtv#@H>kJ%d&8+nVc~<6*y@5CO z2R>=$1%rSsQJXqvgc!`DE$UJ)A=E#!25lP9r5}w!hqh@4+AbyE82#=AtZh8%6GcAl zo63!gtl*5QR$THlmrr28k0uf@!DO|$m$68&kh8MjGL#3Y2uG9TbH;hW!y*rpR31!5 zA#`Xe;)2saS!m846&Za&loLtGMNDwf%YtXrg1Q4${01X6oWvpFA4x+JYEo-zPQe># z&Ma!5gNFOoV-ETU-g#%1W+2}OFE24kz|zvx1hhRRQwwa^GlzC)_uM=sT3^<>sr8=L zEv>I;-PZbh^a}7Dt*>glMaijKlUeKBIQ41|c5CvN(ye{mh2EW4yHi5f)(zm9Z}9$k z&3jIcenoC=Esj4Yy!Q^nev7gBHbWZpYVH1H{M?+BPuFoLwKEG~hkotTwL=pu%esY@ z;2aFPp-*gS)~46+OlwzqwJ`-xfcJ~+%)0b_#O0i^fEn~U&ek5R!Cm|h`{*S#Ai8cm z;&|27%Hv5MZr{E0Stt(EGTb}f<9Ov&3vhs|Zg30B-nV6md9 zq@u)x%wwi(gp?yP#!BUvCz!0sB*kTz5Pi(QNv<6fOdQIh96m_pSBw`-JSgN4 zE_eq$xm}*{5T-3d6(bOa>5(o8h;6Qtn`WELKhq|j{%ouLS|f-BQ0+y{>=F;GAP&+( zYxrrF84$hR8xIWL#QcGg(80$8gPp?jGPQP%@3!GNFn_RSHnnunH@YpInoP;ML7jDD zjyDP9&fsxH?5L+_Ht4%HT;%9f@S0S(_!r76(y4l!jU$MOJPGjzx5CO2VaU6%zv`yW zg1Oj*Aoy_J(@N0ymBXVvVSEE-C`+6OxLHYy2}H>=j_F|u$(6I8O~e7e4kUg91ibN% zWaF|>B-JyvRQ^D^IqoBeQ{%}iG;({xj%Wiiao$Vti|_j0U^gY8j3r@ z3_CCpL{1rYo*69wCM*%fB&M)y1F-wpXnbofroS~24H)(`xN`RXQ{hX^{8Rat+Bf|x zH!M{}EF23Am6?+ZMz-iF7x(7^C+uu7dL-uc!>DEaGe2~(Adie36y=5C ztxV9o$@eaGm%h!fkC>i$Rko8BaoW|>A72ypo{&{psU%a88+&72pV!6fyGR+#H&gwT z>vyvspdxK+9wz0IB^5qf?~s%C(R{&E4u4ERiMLI$R;%x}VbiaWs$q&)Q6}x|P?20I lKTnEY8zweLFe{hsQe}XsMUW*Z5KI!#=AX>ZV0muOd;sSdg@^zE delta 558 zcmZ9JPfG$(6vf|tqmARAvb4-{YSc1Bl#sw(`&KQ4_Q8#)uylCKi6Ym6@RlKrn|47_ zpP)s%7S&Fu7JYy|LD0Lezcz~>cg{QaoO#Sk;yw}CjK#uCJ-w&r%g8Mp8GU|e3Gg{a zkmj%m`Xd_eMO`}Q35Ecm~0&V`u{0x@oR`mmTKY-8x diff --git a/__pycache__/raid.cpython-39.pyc b/__pycache__/raid.cpython-39.pyc deleted file mode 100644 index 89863a7b51cdd80025cbbdf3264617faacedb5a6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3838 zcma)9&5s;M74Pcr>G{}Q$BFG=lHSDNjI-JGt_=iZ$MFY<2(+=X4nnOx(9=~r+u5G( zadpk&9ks<_5hqr%IB*~&8efp|4{+jwa>)TCPC4`m2?=D00|ySs2f}-=duDf?NMuG+ zRsFtxuj;*5{U&U;Jq+(sAd*0de#GjW-~Bp zwgL-gJ+beioRK&KH*g1ypusfZag$pIjA`5sn%oIm+zr~o=*@o6#cntX3dY6^#LRT-HC`&RacxgvN8K>$lFdE@V0WBA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PSP9+9N diff --git a/bot.py b/bot.py index 477ac50..aa7af3b 100644 --- a/bot.py +++ b/bot.py @@ -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" @@ -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'])) @@ -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']) diff --git a/data.json b/data.json index 0be9662..586e590 100644 --- a/data.json +++ b/data.json @@ -1 +1,9 @@ -{"name": "Utente", "raid": "7", "difficolta": "heroic", "temporaid": "200", "pvp": "3", "cimento": "2", "ctime": "2"} \ No newline at end of file +{ + "name": "Utente", + "raid": "7", + "difficolta": "heroic", + "temporaid": "200", + "pvp": "3", + "cimento": "2", + "ctime": "2" +} \ No newline at end of file diff --git a/latest.log b/latest.log index d6ccd11..cf34f9a 100644 --- a/latest.log +++ b/latest.log @@ -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 = . -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 - : local variable 'error' referenced before assignment