https://github.com/hlissner/trex-runner-bot-js
A bot for Trex Runner on the Chrome offline page.
https://github.com/hlissner/trex-runner-bot-js
Last synced: 3 months ago
JSON representation
A bot for Trex Runner on the Chrome offline page.
- Host: GitHub
- URL: https://github.com/hlissner/trex-runner-bot-js
- Owner: hlissner
- License: mit
- Created: 2016-07-17T03:39:59.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-07-17T03:45:17.000Z (almost 9 years ago)
- Last Synced: 2025-01-13T21:44:29.802Z (5 months ago)
- Language: JavaScript
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# T-Rex runner bot
My internet was down for half an hour, so...
## Usage
1. Lose your internet.
2. Open Chrome, go to foxnews.com.
3. Desperately smash refresh.
4. Go through the five stages of grief.
5. Open Chrome developer tools.
6. Paste into console:
```
var r=Runner();var JUMP_ARGS={keyCode:38};var DUCK_ARGS={keyCode:40,preventDefault:function(){}};function duck(){r.onKeyDown(DUCK_ARGS);setTimeout(function(){r.onKeyUp(DUCK_ARGS)},400)}function jump(obstacle){r.onKeyDown(JUMP_ARGS);if(shouldQuickJump(obstacle))r.onKeyUp(JUMP_ARGS)}function shouldQuickJump(obstacle){var next=r.horizon.obstacles[1];return next&&next.xPos-obstacle.xPos<=r.currentSpeed*42}setInterval(function(){if(!r||r.horizon.obstacles.length===0)return;var obstacle=r.horizon.obstacles[0];if(obstacle.yPos<75)return;if(obstacle.xPos<=r.currentSpeed*18){if(obstacle.yPos==75){duck()}else{jump(obstacle)}}},2);
```
7. Profit.