jfd02 / TFT-OCR-BOT

A bot that plays Teamfight Tactics using OCR. Keeps track of bench, board, items, and plays the user defined team comp.
GNU General Public License v3.0
323 stars 91 forks source link

couple of questions and maybe suggestions.... #239

Closed freudenschrei closed 1 year ago

freudenschrei commented 1 year ago

when starting in round 1-1 the bot is moving in a straight line too choose augment which is not all the time in that place so its failing to choose one. maybe it is better too choose at the first round on the left side one of the augments and let the bot auto move there by hiting the button. choosing should hapen random from the three options...

can you maybe let the bot movement be a bit random when choosing carousel - maybe bit left or right first before going to the point choosen - it looks more human like.

the orb picking happens after the last pve round. from time to time the bot only lets one champion on the board which is a loss against pve minions (happen when the champion on the board is upgraded like configured) maybe its better to let the bot pickup the orbs after each pve round and sell the champions from the bench which are not configured.

at the end of some rounds the bot is selling all champions from bench from time to time also the ones who has been bought from the bot one round before although there is enough gold. i do not know why this is hapening

Zynnlol454 commented 1 year ago

when starting in round 1-1 the bot is moving in a straight line too choose augment which is not all the time in that place so its failing to choose one. maybe it is better too choose at the first round on the left side one of the augments and let the bot auto move there by hiting the button. choosing should hapen random from the three options...

can you maybe let the bot movement be a bit random when choosing carousel - maybe bit left or right first before going to the point choosen - it looks more human like.

the orb picking happens after the last pve round. from time to time the bot only lets one champion on the board which is a loss against pve minions (happen when the champion on the board is upgraded like configured) maybe its better to let the bot pickup the orbs after each pve round and sell the champions from the bench which are not configured.

at the end of some rounds the bot is selling all champions from bench from time to time also the ones who has been bought from the bot one round before although there is enough gold. i do not know why this is happening

I agreed with this, and sometime the bot bought the champion and in cmd it say moving that champ on the board but it doesn't do it and a few second later it sold the champ and say selling unknow champ

also i think we should have more comp to pick from, i tried edited the comp myself but it doesn't go so well

freudenschrei commented 1 year ago

I agreed with this, and sometime the bot bought the champion and in cmd it say moving that champ on the board but it doesn't do it and a few second later it sold the champ and say selling unknow champ

also i think we should have more comp to pick from, i tried edited the comp myself but it doesn't go so well

for comp creation try this, final is only for the champs you want to stay on board till the end. then copy and paste to the comps but be aware of intendations or an error will raise when starting

[(https://github.com/jfd02/TFT-OCR-BOT/issues/167)]

anthony5301 commented 1 year ago

In the 1-1 stage, the choice is not so important. Even if the bot selects what you want, the system just randomly picks one, and it's expected to remove this system when set 10 is come. So, I won't be adding this feature for now.

Every click of the bot includes a random offset. If you only want the bot to go to different positions at carousel round, you can modify CAROUSEL_LOC in screen_coords.py.

As you mentioned, the bot will only pick up the orb after all PVE rounds, so there won't be a situation where a champion suddenly levels up and loses control of the board. Additionally, 2-star champions should be sufficient to defeat 4 minions. My bot has never lost to minions in the early rounds. If you have more detailed information, please provide it.

freudenschrei commented 1 year ago

As you mentioned, the bot will only pick up the orb after all PVE rounds, so there won't be a situation where a champion suddenly levels up and loses control of the board. Additionally, 2-star champions should be sufficient to defeat 4 minions. My bot has never lost to minions in the early rounds. If you have more detailed information, please provide it.

The last fight was this - happens to me in 3 from 5 fights in the 1-2 round i have got malza - was selled befor 1-3 - one samira got picked from the shop and put on the board - round 1-3 is a loss cause of lack of strength and health

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

[PvE Round] 1-3
  Shop: [(0, 'Samira'), (4, 'Illaoi'), (1, 'ChoGath'), (2, 'ChoGath'), (3, 'Renekton')]
  Moving Samira to board
  Need to sell entire bench to keep track of board
  Health: 100

[PvE Round] 1-4
  Shop: [(0, 'Milio'), (1, 'Irelia'), (4, 'Graves'), (3, 'Cassiopeia'), (2, 'Samira')]
    Purchased Milio
    Purchased Irelia
  Moving Milio to board
  Moving Irelia to board
  Health: 98

Every click of the bot includes a random offset. If you only want the bot to go to different positions at carousel round, you can modify CAROUSEL_LOC in screen_coords.py.

if only the coords are changed in the CAROUSEL_LOC the bot will continue movement to the same coords. I have updated the carousel round champ pickup to a bit more randomness.

screen coords to this:

CAROUSEL_LOC_1: Vec2 = Vec2(964, 644)

CAROUSEL_LOC_2: Vec2 = Vec2(775, 505)

CAROUSEL_LOC_3: Vec2 = Vec2(1150, 505)

and game function to this :

import random

def get_champ_carousel(tft_round: str) -> None:
    """Gets a champion from the carousel"""
    crdstochoose = random.randint(1, 3)
    if crdstochoose == 1:
        while tft_round == get_round():
            mk_functions.right_click(screen_coords.CAROUSEL_LOC_1.get_coords())
            sleep(0.7)
    elif crdstochoose == 2:
        while tft_round == get_round():
            mk_functions.right_click(screen_coords.CAROUSEL_LOC_2.get_coords())
            sleep(0.7)
    elif crdstochoose == 3:
        while tft_round == get_round():
            mk_functions.right_click(screen_coords.CAROUSEL_LOC_3.get_coords())
            sleep(0.7) 

this is just an idea - maybe there is a better way to do this what i have done

anthony5301 commented 1 year ago

You can make it as a list:

CAROUSEL_LOC: list[Vec2] = [
    Vec2(964, 644),
    Vec2(775, 505),
    Vec2(1150, 505)
]

from random import randint
def get_champ_carousel(tft_round: str) -> None:
    """Gets a champion from the carousel"""
    crds_to_choose = random.randint(0, 2)
    while tft_round == get_round():
        mk_functions.right_click(screen_coords.CAROUSEL_LOC[crds_to_choose].get_coords())
        time.sleep(0.7)