Skip to content

Instantly share code, notes, and snippets.

@AliAlmasi
Created July 8, 2023 02:01
Show Gist options
  • Save AliAlmasi/b4ddddac67db0f3d278d22fd686b36e6 to your computer and use it in GitHub Desktop.
Save AliAlmasi/b4ddddac67db0f3d278d22fd686b36e6 to your computer and use it in GitHub Desktop.
Cheat for dino game on Google Chrome
First, go to the address [chrome://dino] on your Google Chrome browser,
then open up the console (F12 or something like this 🤷‍♂️), and then paste the code in the console.
(Of course you need to hit enter after that so the code can run 🤦‍♂️)
If you liked this, give it an star. ⭐🦕🙇‍♂️
javascript: 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 <
25 * 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 <
30 * Runner.instance_.currentSpeed -
Runner.instance_.horizon.obstacles[0].width / 2 &&
Runner.instance_.horizon.obstacles[0].yPos <= 75 &&
keyDown(40));
}, 5);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment