Detergent13 / tft-bot

Automate Teamfight Tactics (TFT) for token/mission farming. Updated for Set 11!
GNU Affero General Public License v3.0
81 stars 45 forks source link

new code not working #83

Closed RomeoAlphaEkko closed 2 years ago

RomeoAlphaEkko commented 2 years ago

Hi, I saw that an update was made and found this as an addition, but running it doesnt "print" anything aka not working

`def won_match(): #neu global gamecount global endtimer endtimer = time.time() gamecount += 1 sec = (endtimer - starttimer) hours = sec // 3600 sec = sec - hours3600 mu = sec // 60 ss = sec - mu60 gamecount2 = str(gamecount)

result_list = str(datetime.timedelta(seconds=sec)).split(".")

print("-------------------------------------")
print("Game End")
print("Play Time : ", int(float(hours)), "Hour", int(float(mu)), "Min", int(float(ss)), "Sec")
print("Gamecount : ", gamecount2)
print("-------------------------------------")
time.sleep(3)

end_match()

time.sleep(5)
queue()

`

IntensiveKeyboardStrokes commented 2 years ago

It is only logical that this part of the code doesn't execute. At the moment of writing, one has to win a match to have this message get printed, but the bot tries to surrender as soon as stage 3-1 hits in, which is not in accordance to the code in main(). I can only assume that testing the image detection library's latest version against the game's stage indicators would suffice in fixing the surrender logic and allowing for games to be actually won. As for text you opened the issue about, it getting moved to a different function which is independent from whether a match was won or not (end_match() most likely) would be an appropriate fix.

Detergent13 commented 2 years ago

86 should close this!