Sizzzles / TFT-OCR-BOT

TFT OCR Bot with auto comps loading from lolchess
GNU General Public License v3.0
18 stars 2 forks source link

Bot stops after a random amount of matches, cannot pinpoint why. #16

Closed beepinboop closed 1 year ago

beepinboop commented 1 year ago

Hey, thank you very much for this project! Not having to manually set up the teams is really nice :) I've been having a weird issue: after a random amount of games (around 8 to 11 according to my match history) the bot simply stops, as in the match ends and the bot still thinks I'm in a random round. My explanation is vague but I don't have another computer to leave it running so I can spot it when it breaks (I just run it overnight while sleeping). Here's all the steps I've done.

  1. Installed the requirements through 'pip install -r requirements.txt'
  2. Changed the values on arena.py's line 292 to 'min_gold = 8 if self.spam_roll else 12' (just lowered the numbers, I've done the same thing in the original TFT-OCR-BOT with no issues)
  3. Ran with 'python.exe main.py'
  4. Did NOT update (this time, since i've already updated the list a day before), chose the sets 0 1 15 (lasercorps ww, 7infiniteam samira, aegis samira) then just left my computer on.

I did not save a screenshot of the issue, I'll try and attach one tomorrow once I run the bot again but as I described previously, it just seem to be stuck on a random round. I don't think you can review a TFT match like you can do in league but considering the placement (really low) and the champion selection (not many), it seems to really stop working at that random round. I'm creating the issue in your fork because it did not happen in the jfd02's one, I also cannot find any logs produced by the bot so I can't provide them.

Specs:

beepinboop commented 1 year ago

stuck It seems that it always gets stuck on 5-1, I cannot tell for sure because I don't remember the previous times (usually just close the window and go on with my day) but I'm sure I've seen 5-1 before, just cant confirm that it's ALWAYS at that step.

Sizzzles commented 1 year ago

It's getting stuck because it's trying to level up... This is a known issue but I am having trouble trying to find a solution. The level up action needs to time out after a certain amount of time but I am having trouble finding a way to do that. But basically it's trying to level and can't check it's level so it's just spamming the level up keybind

Sizzzles commented 1 year ago

Pushed a possible fix for this issue. I have not tested it so I'm hoping it works

beepinboop commented 1 year ago

Tested it for around 24 hours (3x8 straight hours) without any issues regarding the level up bug but it seems that it doesn't place the bench items into the characters anymore. It does recognize them (items are correctly mentioned) but whenever I check the game I always have a full bench and nobody is using any item. That issue wasn't happening before the fix. Should I create a new issue?

--

accidentally marked as closed, sorry.

Sizzzles commented 1 year ago

Pushing a update now. It should fix the item issue. This is my fault forgot I switched the order of item placement to test Tacticians Crown on round 4-3 from the portal with last push. Let me know if you have any issues still

beepinboop commented 1 year ago

I apologize for the late reply but it doesn't seem to be fixed. Does it work on your machine? Still with the same issue of not placing the (recognized) items from the bench. The only modification I've been doing was the already mentioned "arena.py's line 292 (now 299) to 'min_gold = 8 if self.spam_roll else 12'"

Sizzzles commented 1 year ago

Okay just want to be clear it's reading the items on your bench but not actually placing the items on units at all. Like there is not a single time it has placed something on a unit?

It is working for me. Places and combines items. There are some cases where there are multiple of the same components for example Tear of the Goddess and BF Sword but none of the items the units need use those components so they end up filling the bench 23 05 2023 Administrator_Command_Prompt_-_main py_nqubwimH0O Comp being used in screenshot is 4A.D.M.I.N Hacker Leblanc which you can see it put components on Shen and completed 2 items

Sizzzles commented 1 year ago

Okay so I'm going to suggest zipping your files and sending them to me so I can test if something is different with your files as a just incase... If you would like because it's very odd that items aren't being used for you.

I did some testing and I made the changes you have with min gold and spam roll. Using the comps you used in the original issue (lasercorps ww, 7infiniteam samira, aegis samira). I have no issues. It's putting items from the bench on units.

I was running different versions of Python and Pip

No issues showing for me and here is a log of the first game basically up until I see items being placed on someone

C:\Users\sizzl\Documents\GitHub\TFT-OCR-BOT>main.py
TFT OCR | https://github.com/jfd02/TFT-OCR-BOT
Champions and comps already exist. Last modified: Tue May 23 18:40:37 2023
Do you want to update comps? (y/n) y
Old comp files sucessfully deleted!
Close this window to terminate the overlay window & program
Loading champions and comps...
Loading from web... (It can take up to ~1 min)
Set: 8.5, loaded champions: 59, comps: 23
0 - 7Infiniteam Samira [Garen,Shen,Pantheon,Fiddlesticks,Urgot,Samira,Twisted Fate,Sivir,Ultimate Ezreal]
1 - Ox Force Twisted fate [Alistar,Viego,Annie,Ekko,Fiora,Neeko,Sona,Twisted Fate]
2 - LaserCorps Warwick [Riven,Renekton,Garen,Mordekaiser,Blitzcrank,Warwick,Yasuo,Urgot,Ashe]
3 - Threat Renegades Jhin [Pyke,Alistar,Aatrox,Ekko,Zac,Viego,Vex,Morgana,Jhin]
4 - Mecha: PRIME Samira [Alistar,Leona,Ekko,Fiddlesticks,Garen,Wukong,Ultimate Ezreal,Samira]
5 - Mecha: PRIME Threat [Garen,Aatrox,Fiddlesticks,Wukong,Bel'Veth,Jax,Morgana,Aurelion Sol]
6 - Duelist Vayne [Annie,Yasuo,Nilah,Gangplank,Fiora,Twisted Fate,Kayle,Vayne]
7 - 4A.D.M.I.N Camille reroll [Camille,Zac,Vex,Pyke,Warwick,Shen,LeBlanc,Blitzcrank,Jhin]
8 - 5Renegades Camille Jhin [Pyke,Alistar,Leona,Viego,Shen,Zac,Camille,Vex,LeBlanc,Jhin]
9 - Anima Squad Miss Fortune [Garen,Ekko,Riven,Alistar,Miss Fortune,Jinx,Syndra,Vayne]
10 - Aegis Samira [Alistar,Ekko,Leona,Vi,Fiddlesticks,Urgot,Ultimate Ezreal,Janna,Samira]
11 - Star guardian Miss Fortune [Rell,Alistar,Nilah,Garen,Ekko,Miss Fortune,Syndra,Kai'Sa]
12 - 5Gadgeteen Gnar reroll [Ekko,Annie,Gnar,Alistar,Nunu & Willump,Lulu,Morgana,Sona]
13 - Threats Heart BelVeth [Rammus,Viego,Aatrox,Fiddlesticks,Aurelion Sol,Sona,Morgana,Syndra]
14 - Quickdraw Ezreal reroll [Alistar,Malphite,Lee Sin,Vi,Gangplank,Miss Fortune,Kai'Sa,Ezreal]
15 - Supers Lulu reroll [Alistar,Viego,Malphite,Lee Sin,Pantheon,Gangplank,Lulu]
16 - 4A.D.M.I.N Hacker Leblanc [Zac,Shen,Vex,Camille,Warwick,LeBlanc,Pyke,Aurelion Sol,Jhin]
17 - Threat Mascot Vex [Pyke,Ekko,Aatrox,Alistar,Zac,Nunu & Willump,Aurelion Sol,Jhin,Vex]
18 - Hacker Draven reroll [Jax,Draven,Garen,Pyke,Leona,Shen,Wukong,LeBlanc]
19 - LaserCorps Ashe reroll [Yasuo,Mordekaiser,Blitzcrank,Renekton,Vi,Warwick,Sivir,Ashe]
20 - Mecha: PRIME 4Ace [Alistar,Garen,Mordekaiser,Ekko,Wukong,Draven,Samira,Kai'Sa,Miss Fortune]
21 - Winds of the Wanderer Yasuo [Malphite,Fiora,Yasuo,Nilah,Gangplank,Lee Sin,Alistar,Vayne,Twisted Fate]
22 - Built Different 4cost Value [Garen,Ekko,Urgot,Jhin,Miss Fortune,Samira,Twisted Fate]
Select mode:
-Press Enter to play random comps without sequence
-Type "all" and press Enter to play all comps in sequence
-Type "all_except 2 3 4"(for example) and press Enter to play all comps in sequence except selected
-Type "1 2 3"(for example) and press Enter to play only selected comps in sequence (it will loop)
0 2 10

[Auto Queue]
  Client found
  Creating lobby
  Changed arena skin to default
  Creating lobby
  Starting queue
  Starting queue
[!] 7Infiniteam Samira [Garen,Shen,Pantheon,Fiddlesticks,Urgot,Samira,Twisted Fate,Sivir,Ultimate Ezreal] comp is selected

[!] Searching for game window
  Did not find window, trying again...
  Did not find window, trying again...
  Window League of Legends (TM) Client found
    Location: (320, 180)
    Size:     (1920, 1080)

[Comps] Stick to [Garen,Shen,Pantheon,Fiddlesticks,Urgot,Samira,Twisted Fate,Sivir,Ultimate Ezreal]

[Carousel Round] 1-1
  Health: 100
  Getting a champ from the carousel

[Comps] Stick to [Garen,Shen,Pantheon,Fiddlesticks,Urgot,Samira,Twisted Fate,Sivir,Ultimate Ezreal]

[Second Round] 1-2
  Moving ? to board
  Health: 100

[Comps] Stick to [Garen,Shen,Pantheon,Fiddlesticks,Urgot,Samira,Twisted Fate,Sivir,Ultimate Ezreal]

[PvE Round] 1-3
SparringGloves is not TacticiansCrown
  Shop: [(3, 'Lulu'), (4, 'Blitzcrank'), (0, 'Blitzcrank'), (1, 'Blitzcrank'), (2, 'Renekton')]
  Moving Blitzcrank to board
  Moving Renekton to board
  Health: 100

[Comps] Stick to [Garen,Shen,Pantheon,Fiddlesticks,Urgot,Samira,Twisted Fate,Sivir,Ultimate Ezreal]

[PvE Round] 1-4
  Shop: [(1, 'Vi'), (4, 'Vi'), (2, 'Nasus'), (0, 'Jinx'), (3, 'Wukong')]
  Moving Jinx to board
  Health: 100

[Comps] Stick to [Garen,Shen,Pantheon,Fiddlesticks,Urgot,Samira,Twisted Fate,Sivir,Ultimate Ezreal]

[PvP Round] 2-1
  Rolling for augment
  Choosing augment: Invigorate
  [!] No priority or backup augment found, undefined behavior may occur for the rest of the round

[LEVEL UP] Lvl. 4
  Picking up items
  Selling unknown champion
  Selling unknown champion
  Selling unknown champion
  Shop: [(4, 'Yasuo'), (1, 'Renekton'), (0, 'Pantheon'), (3, 'Draven'), (2, '')]
    Purchased Pantheon
  Moving Pantheon to board
  Items: ['SparringGloves', 'RecurveBow', 'GiantsBelt']
  Selling unknown champion
  Health: 100

[Comps] Stick to [Garen,Shen,Pantheon,Fiddlesticks,Urgot,Samira,Twisted Fate,Sivir,Ultimate Ezreal]

[PvP Round] 2-2
  Shop: [(0, 'Sivir'), (3, 'Ashe'), (2, 'Pantheon'), (1, 'Kayle'), (4, 'Wukong')]
    Purchased Sivir
    Purchased Pantheon
  Moving Sivir to board
  Health: 100

[Comps] Stick to [Garen,Shen,Pantheon,Fiddlesticks,Urgot,Samira,Twisted Fate,Sivir,Ultimate Ezreal]

[PvP Round] 2-3
  Shop: [(0, 'Shen'), (3, 'Lulu'), (1, 'Fiora'), (2, 'Lucian'), (4, 'Draven')]
    Purchased Shen
  Purchasing XP
  Rerolling shop
  Shop: [(4, 'Rell'), (3, 'Kayle'), (2, 'Fiora'), (1, 'Wukong'), (0, 'Gangplank')]
  Moving Shen to board
  Health: 100

[Comps] Stick to [Garen,Shen,Pantheon,Fiddlesticks,Urgot,Samira,Twisted Fate,Sivir,Ultimate Ezreal]

[Carousel Round] 2-4
  Health: 92
  Getting a champ from the carousel

[Comps] Stick to [Garen,Shen,Pantheon,Fiddlesticks,Urgot,Samira,Twisted Fate,Sivir,Ultimate Ezreal]

[PvP Round] 2-5

[LEVEL UP] Lvl. 5
  Selling unknown champion
  Shop: [(3, 'Rell'), (0, 'Pantheon'), (4, 'Riven'), (1, 'Vi'), (2, '')]
    Purchased Pantheon
  Purchasing XP
  Rerolling shop
  Shop: [(0, 'Ezreal'), (3, 'Jinx'), (4, 'Nasus'), (2, 'Lee Sin'), (1, 'Blitzcrank')]
  Moving ? to board
  Items: ['SparringGloves', 'RecurveBow', 'GiantsBelt', 'RecurveBow', 'SparringGloves']
  Placed GiantsBelt on Shen
  Health: 92

[Comps] Stick to [Garen,Shen,Pantheon,Fiddlesticks,Urgot,Samira,Twisted Fate,Sivir,Ultimate Ezreal]

[PvP Round] 2-6
  Shop: [(0, 'Gangplank'), (4, 'Sylas'), (2, 'Sona'), (3, 'Jax'), (1, 'Gnar')]
  Purchasing XP
  Rerolling shop
  Shop: [(2, 'Lucian'), (1, 'Rammus'), (0, 'Riven'), (4, 'Yasuo'), (3, 'Lee Sin')]
  Health: 92

[Comps] Stick to [Garen,Shen,Pantheon,Fiddlesticks,Urgot,Samira,Twisted Fate,Sivir,Ultimate Ezreal]

[PvE Round] 2-7
  Shop: [(2, 'Lulu'), (4, 'Vayne'), (0, 'Vayne'), (1, 'Ezreal'), (3, 'Vayne')]
  Purchasing XP
  Rerolling shop
  Shop: [(2, 'Lulu'), (0, 'Vayne'), (3, 'Vayne'), (1, 'Ezreal'), (4, 'Vayne')]
  Purchasing XP
  Rerolling shop
  Shop: [(1, 'Riven'), (3, "Kai'Sa"), (0, 'Vex'), (2, 'Kayle'), (4, 'Kayle')]
  Moving Ezreal to board
  Health: 92

[Comps] Stick to [Garen,Shen,Pantheon,Fiddlesticks,Urgot,Samira,Twisted Fate,Sivir,Ultimate Ezreal]

[PvP Round] 3-1
  Picking up items
  Selling unknown champion
  Shop: [(3, 'Riven'), (4, 'Lux'), (1, 'Ashe'), (0, 'Riven'), (2, '')]
  Purchasing XP
  Rerolling shop
  Shop: [(1, 'Lux'), (4, 'Morgana'), (3, 'Draven'), (0, 'Pyke'), (2, 'Sivir')]
    Purchased Sivir
  Selling unknown champion
  Health: 92

[Comps] Stick to [Garen,Shen,Pantheon,Fiddlesticks,Urgot,Samira,Twisted Fate,Sivir,Ultimate Ezreal]

[PvP Round] 3-2
  Choosing augment: Preparation II

[LEVEL UP] Lvl. 6
  Shop: [(0, 'Vi'), (1, 'Garen'), (2, 'Morgana'), (3, 'Rell'), (4, 'Pyke')]
    Purchased Garen
  Moving Garen to board
  Items: ['SparringGloves', 'RecurveBow', 'ThiefsGloves', 'RecurveBow', 'SparringGloves', 'NegatronCloak']
  Placed NegatronCloak on Garen
  Health: 92

[Comps] Stick to [Garen,Shen,Pantheon,Fiddlesticks,Urgot,Samira,Twisted Fate,Sivir,Ultimate Ezreal]

[PvP Round] 3-3
  Shop: [(4, 'Rell'), (2, 'Annie'), (3, 'Riven'), (0, 'Renekton'), (1, 'Yasuo')]
  Purchasing XP
  Rerolling shop
  Shop: [(4, 'Rell'), (3, 'Riven'), (1, 'Yasuo'), (2, 'Annie'), (0, 'Renekton')]
  Purchasing XP
  Rerolling shop
  Shop: [(4, 'Nasus'), (3, 'Pyke'), (2, 'Sivir'), (0, 'Alistar'), (1, 'Renekton')]
    Purchased Sivir
  Health: 92
beepinboop commented 1 year ago

Okay just want to be clear it's reading the items on your bench but not actually placing the items on units at all. Like there is not a single time it has placed something on a unit? not a single time

I've downloaded everything once again, still the same issue. Curiously enough it now placed a single negatron cloak on shen this time, the bench was obviously full as you can check the logs. Before this occurrence I did not see any items being placed, maybe it did happen but not at the times I actually checked my pc. Even so, there's probably something wrong considering it had a full bench and only chose to place a mere negatron cloak once. I'm assuming that the actual team build was this one: https://lolchess.gg/builder?deck=76ca98dc15194e3e58c285d360f8a5bec2c5b657, which had multiple component items available.

I've attached a screenshot of the game. ss

Here's the logs: https://pastebin.com/raw/QdWqQsXq

One thing I've thought about was the graphical settings, things like gamma and such, I've adjusted them back to default but nothing changed.

Sizzzles commented 1 year ago

It seems to be working as intended from the information you have gave. The only unit that needs items that's on your board both in the screenshot and logs is Shen. It put the cloak on Shen to start building dragon's claw so until it puts another cloak on Shen to complete the item it won't put anything else on him. If you had a Samira I assure you it would make last whisper and giant slayer on her

Currently the bot doesn't make use of any temp units to hold items but I'm looking to do this when I get the time and brain power

beepinboop commented 1 year ago

I.... did not notice that the other champions in said build weren't using any items.... I even opened the lolchess build specifically to double check that... Yeah.... I apologize for wasting your time with that issue. I should've paid more attention.

Sizzzles commented 1 year ago

You are all good. Closing this since it's been resolved 😄