Git Product home page Git Product logo

tft's Introduction

Tft AI (set 5.5)

Helper tool for the auto-chess game called Teamfight Tactics

It collects data from the game using yolov3 image recognition algorithm and calculates the best build/comp

yolov3:
image

interface:
image

Disclaimer!

  • Current version of yolo3 can find champions and parts but not completed items, you have to enter them yourself

Before you run it make sure that the paths to files are correct!
Open path_manager.py and change path to your needs
Also in data/network there is missing one file named yolov3_training_last.weights (its too large for git)
You need to download it from my drive https://drive.google.com/drive/folders/1UBTFQWdB7qEY0upLsa-DLtu_5XoCSP8Y?usp=sharing

Also make sure you have all the needed modules installed:
mss
numpy
cv2
pyautogui
difflib
pytorch(torch)

How to use:

  • find interface.py file and run it, it should take some time to load but thats okay
  • the interface (shown above) should open
  • Champion/Item selector:
    image
    type champion/item name into the white box and press enter/"?" to select the champion/item
  • Queue:
    image
    This shows current champions/items for players
    if you have selected your champion/item then press right click to add it to the queue
    if you want to increment champion/item number then press right click on it and left click do decrease it
    if you want to remove something from the queue then just decrease it until it disappears
    numbers under the champion mean how many copies you have on your screen:
    1 aatrox => one lvl 1 aatrox 3 aatrox => one lvl 2 aatrox
    9 aatrox => one lvl 3 aatrox
  • Buttons
    image
    Get champs - takes a picture of the screen and finds all the champs/items and adds them to the queue
    if you select "inc store" then it also adds champs from your store if you select "only me" then it takes picture of only your champions (need the be watching them), otherwise it goes through the player list one by one and takes pictures of them all (enable if you dont have cuda, takes too long)
    if that champ/items is already in the queue then it doesn add it
    If you have cuda installed and setup correctly then it only takes 0.5 sec to read the image otherwise it takes around 2 sec
    also I have added a small delay(1 sec) so you can switch to tft game window
    if you want to change the delay then you can edit the code in interface.py press_button function
    Its reccomended that you use bordeless mode for tft so you can swithc faster between windows

Calculate - Calcualtes the best comps for you based on what you have entered above
Level - right click to add level and left to decrease

  • Comps
    image
    System shows top 3 comps for you and how to play them
    top 1 comp is the most top one
  • Single comp
    image
    Blue - main comp, this is what you should try to build
    Green - extra champs, use them to fill missing positions if you dont have all main comps champs
    Yellow - Core items, build these first if possible
    Red - Extra items, build these if you have core items built

tft's People

Contributors

blaccerik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tft's Issues

Some red stuff

Traceback (most recent call last):
File "C:\Users\12345\AppData\Local\Programs\Python\Python39\lib\tkinter_init_.py", line 1892, in call
return self.func(*args)
File "C:\Users\12345\PycharmProjects\tft\main\interface.py", line 172, in press_button
self.add_champ_frame(number, def_value=amount)
File "C:\Users\12345\PycharmProjects\tft\main\interface.py", line 229, in add_champ_frame
champ_dict = self.champion_dict[nr]
KeyError: 8
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\12345\AppData\Local\Programs\Python\Python39\lib\tkinter_init_.py", line 1892, in call
return self.func(*args)
File "C:\Users\12345\PycharmProjects\tft\main\interface.py", line 172, in press_button
self.add_champ_frame(number, def_value=amount)
File "C:\Users\12345\PycharmProjects\tft\main\interface.py", line 229, in add_champ_frame
champ_dict = self.champion_dict[nr]
KeyError: 8

Interface is up but when i click on get champs its pressing on opponents some px to the left and cannot get my own champions even when i try "only me" option

Installed all modules get this error.

Traceback (most recent call last):
File "predict.py", line 25, in
from predict.edit_data import EditData
File "C:\Users\Desktop\tft-master\predict.py", line 25, in
from predict.edit_data import EditData
ModuleNotFoundError: No module named 'predict.edit_data'; 'predict' is not a package

How to generate training files for yolo?

Thanks for your nice work.

I tried using trained network to detect and recognize champions and items but not too satisfied with accuracy, so I want to reproduce the process of training model weights and try to train YOLOv5 network but no sure how to generate training data, could you provide training data or some tips for how to generate it?

Update

Are you going to update this?

Run

improted all libs cannot run ;/ any tips? discord or smth

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.