GithubHelp home page GithubHelp logo

bonk's Introduction

Bonk

This is a program that can predict and control the trajectory of the ball in thr online game bonk.io The program captures the screen of the game and makes a preview window with the ball trajectory and target appears on the side Default settings are the WASD keys Its best to put your browser window on one half your screen so there is room for the preview window next to it

To tell the program where it should capture the game and what color to track to detect the ball you can launch the bonk_setup.py script after you launch this script you will have to put your mouse on the top corner of the game window then press P then put your mouse on the bottom opposite corner then press P then put your mouse over the color of the ball and press P, coordinates of the game window and the color of the ball will be automatically saved as a json file After that if you launch the bonk.py script it will use what is in that json file.

On the preview you can see the current ball future trajectory in magenta, the future trajectory if the up and left/right key is pressed in red, the trajectory is down right/left is pressed in blue. The target is a yellow dot if it is attainable and red if not. You can also see the velocity vector of the ball in green and yellow arrows if the script is controlling the ball

There is 2 modes of automatic control of the ball: if self.tracking_mode = 'mouse' in the bonk.py script, it will try to follow the mouse (on the game window not the preview) while you press the left mouse click if self.tracking_mode = 'numpad', you can register 10 positions by pressing : left mouse + a number key (numbers above the letters on the keyboard) and it will register that this number corresponds to your mouse position. Then you just have to press the number key you want to make the ball go toward the correspnding number target.

If you install a recent version of python with anaconda, you should only need to install opencv with the command: pip install opencv-python

video demonstration : https://www.reddit.com/r/bonkio/comments/v547ai/i_made_a_python_script_that_can_predict_and/

bonk's People

Contributors

bluemax666 avatar

Watchers

 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.