/LeaguePyBot

A Python computer vision bot for League Of Legends

Primary LanguagePythonMIT LicenseMIT

LeaguePyBot [BETA, macos only, windows broken]

Working on v2

Documentation: https://github.com/DorskFR/LeaguePyBot/wiki

Alpha footage: https://youtu.be/cwilX5sMFpA

Beta footage:

Features:

  • Client API to deal with the League Client using LCU API

    • Create lobby (custom, coop, normal, ranked)
    • Start Matchmaking and accept Ready Check
    • Champ select show intent
    • Champ select list of ban targets according to role
    • Champ select list of pick targets according to role
    • Command random player
    • Command all players (probably does not really work)
    • Report all players
    • Dismiss all notifications (level up, missions, honor, etc.)
    • Auto accept rewards
    • Chain games
    • Retrieve basic account information such as level
    • Login and rotation over multiple accounts
    • Load hotkeys and patch quickbinds
    • Patch game settings (backup yours before)
  • Game API to use the in-game API to retrieve live game info

    • PlayerInfo: level, HP, gold, etc.
    • PlayerStats: AttackDamage, AttackSpeed, etc.
    • PlayerScore: CS, etc. (although not used for anything yet)
    • Members of the current game
    • Items, consumables and their slots
    • Game events, game timer
  • Vision

    • Mapping of the main zones (towers, shop, nexus) for both sides
    • Mapping of neutral units
    • Mapping of neutral locations (middle of lanes, rivers, etc.)
    • Computer Vision on the minimap to localize all 10 players on the map and remember close to which zone they were last seen
    • Computer Vision on 80% of the screen to identify units (minions, champions, buildings) and their team.
    • Load champion minimap icon from assets API or data dragon dynamically and resize to correct dimension
  • Bot Logic

    • Different conditions required to attack minions, champions or buildings
    • Watches health and can use healing items and spells
    • Watches health and can recall if low life
    • Watches gold and can recall if rich enough
  • Build

    • Retrieve data dragon item info per region/locale
    • Load builds from online resources depending on champion
    • Change recursive buy function to allow breaking out when no money (instead of buying all cheap items and filling inventory)
  • Actions

    • Added basic movements: fall_back, go_to_lane, follow_allies, recall
    • Added basic combat: attack [safest, average, riskiest] position of [minion, champion, building]
    • Use of abilities based on target and mana / resource level
    • Use of consumable items, summoner spells
    • Buy from shop a recommended build
  • Controller

    • Cross platform control of keyboard and mouse
    • Global killswitch to stop the program
  • NetInterface

    • Allow remote control
    • Allow deferring the template matching on the screenshots to a server

Other ideas :

  • headless client
  • helper tools for loot
  • retrieve data dragon info per champ and load spell cooldowns

Notes

Personal project that I use to learn developing in Python. Initially using only Computer Vision with OpenCV, I am now trying to use the existing APIs to communicate with the client and the game.

Some potential use cases:

  • Level up an account to a certain level with coop games.
  • Track where the enemy jungler is and remember last position.
  • Never miss a ready check no matter how many times people dodge.
  • Report everyone in a game without clicking 45 times.
  • Get perma banned for using an unauthorized 3rd party tool.
  • Ideally one day, play against the bot to practice specific scenarii.

Disclaimer

LeaguePyBot isn’t endorsed by Riot Games and doesn’t reflect the views or opinions of Riot Games or anyone officially involved in producing or managing League of Legends. League of Legends and Riot Games are trademarks or registered trademarks of Riot Games, Inc. League of Legends © Riot Games, Inc.