GithubHelp home page GithubHelp logo

tetrisbot's Introduction

TBot

a bot for tetris games on tetrisfriends.com and Tetris Battle on Facebook.

This bot uses java.awt.Robot class to "visualize" the board by identifying piece colors and detect the current piece through color-nearness . It selects the between the current piece and the piece on hold and which position and orientation will generate the best outcome of the tetris board. Additionally, the bot will go through buildup and breakdown phases which greatly increases the chances to score.

The algorithm used is mainly based on El-Tetris but implemented in java.

Bot in action...

TBot

Instructions

  1. Download and install java if you haven't it yet.
  2. Download the zip file from here. Then, unzip it anywhere.
  3. Double click on TBot.jar to start the application.
  4. Restore the browser window of Tetris Battle. It is important that the browser and the application don't share the same screen space.
  5. Just press the "Find Board" button and adjust the transparent window that will popout to the edges of the tetris board. Closing the transparent window will store the board location so do not move the tetris board after.
  6. Press the "Start" button on the game and just maintain window focus on the browser and that's it. It will automatically detect the start of the game.

Marathon Mode: Reduce the number of buildup limit and breakdown limit ex: 5/0

Options

Key Delay - This is the time delay before the key/move is sent to the focused window. This number should be balanced. If the number is very low, the bot will go crazy. If the number is very high, the bot is slow.

Tower Gap - The width of the gap on the right that the bot reserves on the Buildup phase.

Buildup Limit - The height of the board that will trigger the bot to go into the Breakdown phase and decrease its height.

Breakdown Limit - The height of the board that will trigger the bot to go into the Buildup phase and increase its height while maintaining the tower gap.

TODO

  • 1-piece lookahead
  • better board awareness

Disclaimer

This will not make you rank 100 in Tetris Battle. Skilled humans can beat this bot.

tetrisbot's People

Contributors

natzcam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tetrisbot's Issues

Missdrops

Please improve the bot since it just keeps missdropping when i use it on jstris, thx! (the bot is either missdropping or just randomly placing. any suggestions would be great)

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.