
Learn to build bots for Cookie Clicker, Piano Tiles, and Google Dinosaur Run in Python in one hour, with no machine learning or advanced skills; apply techniques to other games.
Here we will create the bot from start to finish. Afterwards, you should be able to use Python to control your mouse to click on-screen at specific coordinates, and loop through actions to play the game at a superhuman level.
Automate the piano tiles game by processing the screen to locate tiles and click them as they descend, in rhythm with the music.
Learn to take screenshots with the mss library in Python, creating a take_screenshot function that saves full-screen images and can crop to a game region for tile detection.
Learn to define a region of interest by specifying top, left, width, and height for a game screen, then speed up detection with a tiny row of pixels.
Define the screen region as a dictionary with top, left, width, and height, grab it, convert to a numpy array, and convert to grayscale for tile detection.
Create a detect tiles function that scans a frame for black pixels, returning the coordinates of a tile. Prepare to click the detected tiles in Python game automation.
Learn how to automate a game in Python by looping frames, detecting tiles, and clicking exact pixels, with fps monitoring and a Q-key break to stop.
Learn Python game automation by building a bot for Google's dinosaur run, using color detection and jump tactics as the game speeds up and colors invert after 700 points.
Use mss to grab a specific screen region for the dinosaur game, locate cacti and birds by pixel coordinates, and jump when an obstacle appears.
Implement a collision detection function in Python that inspects a frame's pixel rows, uses a set to detect new colors, and returns true when obstacles appear.
Tune the bot's region by adjusting width, height, and rows while painting lines to verify alignment. Increase width to detect obstacles earlier, or reduce it to avoid premature jumps.
Learn to factor in acceleration in a Python game by tracking elapsed time and increasing the lookahead width every two seconds to adapt to faster game pace.
Congratulations, you have completed the course! You can now apply what you've learned to other games of your choosing. Please rate the course and let us know what you think!
Have you ever wanted to create a Python program to play games online, or automate time-consuming, click-intensive work in your browser? In this course, we explore what it takes to program your own bot and create different bots for three popular online games: Cookie Clicker, Google Dinosaur Run, and Piano Tiles, in just one hour! Each game is slightly more difficult to play than the previous, but can each be accomplished with fewer than 50 lines of code! You don't need any programming knowledge to get started with the course, but a basic understand beforehand will help you improve your bot later on.
In the course we use Python 3.8 and make use of the numpy, pyautogui, cv2, and mss libraries to create bots that can outperform a number of other bots you will find online. Afterwards, you will be able to take the approaches learned in the course and apply it to other games of your choosing, as well as to business automation applications. We will also look into what it takes to beat the scores achieved within this course.
Challenge your friends to see if they can beat your bot. Better yet, challenge your friends to make their own bots and see how far you can push the limits of your code.