Skip to content
This repository has been archived by the owner on Nov 16, 2019. It is now read-only.
/ loco-hack Public archive

Script for finding answer in loco app(Trivia Game), Only for Educational purpose

License

Notifications You must be signed in to change notification settings

SubhamTyagi/loco-hack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TRIVIA-HACK

License: MIT

A bot to help answer questions on trivia APP. This bot takes screenshot of the game from phone and uses googles tesseract OCR to read the questions and options. It automates the process of googling of the answers and gives the most likely answer! It is 85%+ accurate!

Since it is against the policy of trivia apps i do not encourage anyone to use this during a live game and this is purely for educational purposes.

Packages Used

Use python 2.7 or you can use python37(some compatibility issues )particular the packages/libraries used are...

  • JSON - Data Storage
  • Pillow - Image manipulation
  • Google-Search-API - Google searching
  • pytesseract - Google's free/open source OCR (requires separate installation)
  • beautifulsoup4 - Parse google searches/html
  • lxml - Beautifulsoup parser
  • opencv2 - Image manipulation
  • pyscreenshot - Take screenshot of the game

To easily install these

  1. Install python 2.7

  2. Install above packages

    • $ pip install -r requirements.txt
  3. For tesseract

    • $ sudo apt-get install tesseract-ocr in linux distribution
  4. For opencv

    • $ brew install opencv
  5. Android adb

    • Either you have android sdk or minimal ADB

Usage

Make sure all packages above are installed. For android phones use, To use this script :

Connect you Android phone via usb cable start loco app when you see questions press l and enter

$ git clone https://github.com/SubhamTyagi/loco-hack
$ cd loco-hack
$ pip install -r requirements.txt
$ python bot.py

Press l for live game, s to run against sample questions or q to quit:
s
...Question...

bot2.py usage

$ python bot2.py

This bot will run in demo mode by default , for run live game set demo= False at line 129

STEP TO SET CO-ORDINATES

  • Take a screenshot of question with option
  • Go to your phone Settings >Developer option>Pointer location
  • Switch on Pointer location
  • Get both(i.e. top and bottom) co-ordinates of question and all option
  • set these values in bot2.py file from line number 91 ,95 , 98 ,101

Contributing

All contributions welcome.

ANDROID APP

TODO: Improving speed

Credits

Useful links

License

The MIT License (MIT)