-
-
Notifications
You must be signed in to change notification settings - Fork 49
/
Copy pathdino_hack.js
70 lines (64 loc) · 2.79 KB
/
dino_hack.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
export default {
icon: "https://chromedino.com/favicon.ico",
name: {
en: "Enable/Disable Hack T-Rex Dino Game",
vi: "Bật/Tắt Hack game T-Rex Dino",
},
description: {
en: "A bot that plays the Google Chrome T-Rex game for you",
vi: "Tự động chơi game Google Chrome T-Rex",
},
changeLogs: {
"2024-07-31": "hotfix",
},
pageScript: {
onClick: function () {
// https://github.com/danpush/t-rex-game-bot
function hack() {
//prettier-ignore
function keyDown(e){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)}
//prettier-ignore
function keyUp(e){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)}
let timeoutId = 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);
return () => {
clearInterval(timeoutId);
};
}
if (window.Runner) {
if (window.ufsDisableHackDino) {
window.ufsDisableHackDino?.();
alert("Đã TẮT hack game dino.");
} else {
window.ufsDisableHackDino = hack();
alert("Đã bật HACK game dino.");
}
} else {
let urls = [
"https://chromedino.com/",
"https://elgoog.im/t-rex/?bot",
"https://offline-dino-game.firebaseapp.com/",
"https://fivesjs.skipser.com/trex-game/",
];
let selected = prompt(
"Không tìm thấy game. Hãy chạy game rồi bật lại hack." +
"\n\nHoặc chọn 1 trong các trang web sau để chơi:\n" +
urls.map((_, i) => ` ${i}: ${_}`).join("\n")
);
if (selected == null) return;
window.open(urls[selected]);
}
},
},
};