Giter Club home page Giter Club logo

hqbot-2's Introduction

hqbot-2

Just a script to automate HQTrivia answers, but FAST

This script is just an extension to my previous HQBot script. The reason why I created a new repo is that this one has a different approach than the previous one.

The main mechanism of the script is same. However, there is one big difference in this one. Instead of using local machine's interpreter, the script takes help of online Jupyter Notebook Binder to execute some part of the code. This saves a lot of time and makes the script more efficient.

The script OCRs the live game broadcast and passes the generate strings to Jupyter Notebook. The rest of the code is executed on that environment. This saves us approximately 7-8 seconds of processing time.

How To Use This Script

I have provided some steps to inform you how to use this script. 1. First of all, open this link on your browser. 2. Shift the browser windows on Right Side of your screen since it's gonna be a little messy. 3. Watch the video "How To Use The Script.mp4" to get an idea of the setup. 4. Shift your HQ trivia game broadcast to the Left Side of your screen. 5. When Jupyter Notebook is opened, close all the unnecessary tabs as shown in the video, and open a Python3 Interpreter. 6. Start a new Console to install necessary modules on the notebook. 7. Enter pip install google requests in the console and press Shift+Enter to execute it. 8. Open your terminal and shift it to lower right part of the screen. Minimize it as much as possible. 9. Execute the script on your terminal and BAAM! you would see the answer on Jupyter Notebook in a couple of seconds.

Note : THE PREDEFINED COORDINATES WORK FOR ME AND SHOULD WORK FOR YOU AS WELL. HOWEVER IF NOT, FIX THEM ACCORDING TO YOUR SCREEN.
This version of the script is compatible for Linux Machines. However, if Windows users want to use it, install Pytesseract as a standalone executable and add an extra line to the top of the code. pytesseract.tesseract_cmd = r"C:\Program Files\Tesseract-OCR\tesseract.exe"

For those who do not know about my previous script, here's a little intro to it.

What Is HQ Trivia

HQ Trivia is an online game that resembles the concept of "Who wants to be a Millionaire" and its various derivatives.

The game airs on the official HQ Trivia smartphone application at specific timings.

How It Works

This script OCRs the game real time for question and answers. Parses the generated strings for better processing. And, then uses web scraping to predict the most probable answer. It also uses the concept of Multithreading to improve the time efficiency of the script.

The script is still in making and takes more time to process than needed. This bot is approximately 50-60% efficient in answering the questions.

What it basically does is that it counts the number of times each answer appears in the top Five results in Google SERP. The script returns the possible answer for each result.

REQUIREMENTS

  1. pyautogui
  2. Pillow / PIL
  3. Pytesseract
  4. googlesearch

Note - The script is developed to run on a Windows Machine. However, the script is still compatible with Unix. Just change the directory of the Pytesseract OCR.

Add all the modules by entering "pip install -r Requirements.txt" in the terminal.

Windows users need to install PyTesseract as a standalone executable. (Add the module + Install as exe too) Linux users need to download "tesseract-ocr" package using their system's package manager.
sudo apt-get install tesseract-ocr
Linux users must also comment out the "Pytesseract Path Line from the code" otherwise it would raise an error.

hqbot-2's People

Contributors

sharmadeepesh avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

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.