TapTapBot

Automatic trivia bot written in Python.


During the summer before my junior year, my friends introduced me to the daily Internet trivia game TapTap Live. Every day at 5pm PT/8pm ET, the TapTap hosts ask an audience of about 3000 people a series of twelve trivia questions that increase in difficulty. Those who answer all twelve correctly (most days, about 100-300 people) win a portion of the day’s prize pool—usually 300 dollars.

A screenshot of a TapTap question
A screenshot of a TapTap question

A few months later, I got a bit tired of losing and realized that the time limit for each question—about ten seconds—could give someone more than enough time to programatically query answers from somewhere online and use them to breeze through and win some money. So, I wrote a bot that could do just that for me.

how it works

The bot is written in Python, and uses the iPhone Mirroring app introduced in macOS Sequoia. When the user clicks the “Read” button on the included rudimentary tkinter GUI, the bot uses the pywinctl library to take a screenshot of the iPhone screen, executes OCR on the text content through pytesseract, and then pings the OpenAI API for a response. All of this happens within about five seconds, giving the player plenty of time to click the correct answer on the phone screen.

A sped up clip of the bot tearing through the last two (admittely easy) questions of a TapTap game, featuring its image processing capabilities in the first question

As a rough estimate, the bot correctly answers about 90% of the questions, with the other 10% coming from either OCR errors or pop culture questions requiring up-to-date data. In these cases, I still have the power to attempt to answer the questions myself.

As soon as I got the bot working, it struck me that I was desecrating the spirit of trivia by cheating. So, after winning one game to recoup my pennies spent on the OpenAI API, I cashed out, retired the bot, and decided to keep playing as a human. I’m still glad I did this, though, since it was quite a fun project.