GithubHelp home page GithubHelp logo

mathsnightmareautomation's Introduction

Math's Nightmare Automation

Automation of Neopet's Math's Nightmare Flash game using PyAutoGui for clicking/keyboard input and Tesseract for optical character recognigition

Dependencies

Installable via pip:

  • pyautogui
  • pytesseract
  • pyscreenshot

Usage

This script is configured to start at the start screen, and will perform division problems. No parameters are required. Simply run python math.py. To debug, the images passed to Tesseract are saved in the debugImg directory. The Res directory contains image resources for pyautogui.

Note: This script can be configured to perform "random" problems by changing mode string to "random", however, Tesseract does not recognize the division sign, and often confuses it with plus "+". I have not found a viable solution to solve this.

About

Coordinates are based off of using i3 window manager with game in a vertically split halved window (See "Demo" gif below). This script can easily be modified for other screen setups. The coordinates are the only thing that needs changed. Function analyzeBubble is used to evaluate each math problem. Function cleanImage is used to remove background "noise" (i.e. anything that isn't the number). Below is a sample cleaned image that is passed to Tesseract:

demo gif

Demo

demo gif

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.