All Projects → danielapushkinsky → t-rex-game-bot

danielapushkinsky / t-rex-game-bot

Licence: MIT license
A bot that plays the Google Chrome T-Rex game for you

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to t-rex-game-bot

douban.fm
简洁的豆瓣电台命令行版。
Stars: ✭ 13 (-78.33%)
Mutual labels:  console, player
executor
A powerful "short-cutter" to your console to you and your team!
Stars: ✭ 21 (-65%)
Mutual labels:  console, runner
Yii2 Console Runner Extension
An extension for running console commands on background in Yii framework.
Stars: ✭ 83 (+38.33%)
Mutual labels:  console, runner
EasyJob
🔨 EasyJob - keep and execute your PowerShell and BAT scripts from one interface
Stars: ✭ 228 (+280%)
Mutual labels:  runner
MusicalYoutube
A Youtube floating PIP player for Android.
Stars: ✭ 52 (-13.33%)
Mutual labels:  player
Square-Player
🍨 一个简洁到极致的单曲播放器
Stars: ✭ 19 (-68.33%)
Mutual labels:  player
coderun
⏯️ Code runner CLI that can run any languages
Stars: ✭ 23 (-61.67%)
Mutual labels:  runner
jest-runner-go
A Golang runner for Jest
Stars: ✭ 22 (-63.33%)
Mutual labels:  runner
plex-music
Web/Desktop app for streaming music from your Plex Media Server
Stars: ✭ 42 (-30%)
Mutual labels:  player
drop
A LÖVE visualizer and music player
Stars: ✭ 17 (-71.67%)
Mutual labels:  player
capybara-chromedriver-logger
Enables console.log/error/info output from Javascript feature specs running with Chromedriver
Stars: ✭ 54 (-10%)
Mutual labels:  console
uiLogos-sketch-plugin
Sketch plugin to Insert professionally designed dummy logos of companies and 190+ country flag into SketchApp
Stars: ✭ 26 (-56.67%)
Mutual labels:  runner
ATtiny85-TinyDFPlayer
MP3-Player
Stars: ✭ 22 (-63.33%)
Mutual labels:  player
aos-Video
NOVA opeN sOurce Video plAyer: player frontend main UI
Stars: ✭ 35 (-41.67%)
Mutual labels:  player
uos
United Open-libraries of Sound. United procedures for open-source audio libraries. For FPC/Lazarus/fpGUI/MSEgui.
Stars: ✭ 112 (+86.67%)
Mutual labels:  player
api.video-player-sdk
SDK to control and interact with the api.video HTML5 Player
Stars: ✭ 31 (-48.33%)
Mutual labels:  player
mpe-player
Browser Based Audio Oscillators using MPE devices & MPE.js
Stars: ✭ 16 (-73.33%)
Mutual labels:  player
kube-design
Kube Design for KubeSphere Console
Stars: ✭ 88 (+46.67%)
Mutual labels:  console
GetConsoleHistoryAndOutput
An Incident Response tool to extract console command history and screen output buffer
Stars: ✭ 41 (-31.67%)
Mutual labels:  console
pelt-testing
A library testing for python, this package allows us to test algorithms and generate test data.
Stars: ✭ 14 (-76.67%)
Mutual labels:  console

T-Rex Game Bot

A bot that plays the Google Chrome T-Rex game for you. It can consistantly hit around 50,000 points. Highest I've gotten is 100,000, but I'm sure it can go much higher.

When I had started this project I thought this would be at least 200 lines of code, yet here I am hitting 6 figure scores where the bot itself is just 10 lines of code. Obviously I have to simulate the key inputs, and that's what takes up the other 50 lines.

I've been able to make it so short by finding a formula to calculate how far away I need to jump before an obstacle. I found this by just playing the game and logging the exact speed of the T-rex and various other variables that the game uses. Putting this into any graphing software you could see a clear correlation between the speed of the T-Rex and the distance from the next obsticle (at the time of jumping). Distance would always be around 20 * speed. From there all that was left to do was type it up!

HighScore

How To Use

  1. Open chrome and go to: chrome://dino/ (or disconnect your internet)
  2. Press "F12" and go to "Console"
  3. Copy and Pase the following text, then press enter.
function keyDown(e){Podium={};var n=document.createEvent("KeyboardEvent");Object.defineProperty(n,"keyCode",{get:function(){return this.keyCodeVal}}),n.initKeyboardEvent?n.initKeyboardEvent("keydown",!0,!0,document.defaultView,e,e,"","",!1,""):n.initKeyEvent("keydown",!0,!0,document.defaultView,!1,!1,!1,!1,e,0),n.keyCodeVal=e,document.body.dispatchEvent(n)}function keyUp(e){Podium={};var n=document.createEvent("KeyboardEvent");Object.defineProperty(n,"keyCode",{get:function(){return this.keyCodeVal}}),n.initKeyboardEvent?n.initKeyboardEvent("keyup",!0,!0,document.defaultView,e,e,"","",!1,""):n.initKeyEvent("keyup",!0,!0,document.defaultView,!1,!1,!1,!1,e,0),n.keyCodeVal=e,document.body.dispatchEvent(n)}setInterval(function(){Runner.instance_.horizon.obstacles.length>0&&(Runner.instance_.horizon.obstacles[0].xPos<20*Runner.instance_.currentSpeed-Runner.instance_.horizon.obstacles[0].width/2&&Runner.instance_.horizon.obstacles[0].yPos>75&&(keyUp(40),keyDown(38)),Runner.instance_.horizon.obstacles[0].xPos<20*Runner.instance_.currentSpeed-Runner.instance_.horizon.obstacles[0].width/2&&Runner.instance_.horizon.obstacles[0].yPos<=75&&keyDown(40))},5);
  1. Start the game!

License

This project is licensed under the MIT License. See the LICENSE.md file for details

Created August 2017 by Daniel Apushkinsky (Last Updated October 2020)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].