Code Monkey home page Code Monkey logo

opencvgamebot's Introduction

OpenCV Bot

Simple bot that solves equations in Telegram game named '1+2' in @gamee Telegram bot. https://t.me/gamee

Installation

Bot tested on Python 3.9.10

Inastalling requirements:

  cd OpenCVGameBot/
  pip install -r requirements.txt

Usage

Open game in browser in fullscreen mode (configs for FullHD monitors) and run:

python main.py

in console.

If your monitor is not Full HD or not with an aspect ratio of 16:9, expand the browser to full screen and write down in main.py the coordinates of the answer buttons, the start button and the coordinates of the rectangle in which the equations appear:

# Config constants #
START_BUTTON_COORDS = (965, 1025)               # Coords of start game button (center)
CROP = (685, 525, 1225, 605)                    # Rect coordinates to crop screenshot for matching equation (top left, bottom right)
DELAY_AFTER_START = 0.5                         # Delay to start game after clicking start button (seconds)
TIME_BETWEEN_ROUNDS = 2                         # Time for solving equation (seconds)

ANSWER_COORDS = {                               # Coords of answer buttons (center)
    1: (960, 650),
    2: (960, 730),
    3: (960, 810)
}

If the bot gives errors/incorrectly finds the equation line, change threshold parameter in 77 line of bot.py

Demo

Example

opencvgamebot's People

Contributors

roqvie avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

rajgamer5689

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.