1500字范文,内容丰富有趣,写作好帮手!
1500字范文 > 自动玩Chrome小恐龙游戏

自动玩Chrome小恐龙游戏

时间:2021-01-07 07:06:30

相关推荐

自动玩Chrome小恐龙游戏

前提

1.下载Chrome浏览器

2.断网 或者 使用Chrome浏览器访问chrome://dino/打开游戏

自动跳教程

打开Chrome浏览器访问chrome://dino/

按F12调出控制台 或者 右键=>检查=>Console

输入脚本代码

function TrexRunnerBot() {const makeKeyArgs = (keyCode) => {const preventDefault = () => void 0;return {keyCode, preventDefault};};const upKeyArgs = makeKeyArgs(38);const downKeyArgs = makeKeyArgs(40);const startArgs = makeKeyArgs(32);if (!Runner().playing) {Runner().onKeyDown(startArgs);setTimeout(() => {Runner().onKeyUp(startArgs);}, 500);}function conquerTheGame() {if (!Runner || !Runner().horizon.obstacles[0]) return;const obstacle = Runner().horizon.obstacles[0];if (obstacle.typeConfig && obstacle.typeConfig.type === 'SNACK') return;if (needsToTackle(obstacle) && closeEnoughToTackle(obstacle)) tackle(obstacle);}function needsToTackle(obstacle) {return obstacle.yPos !== 50;}function closeEnoughToTackle(obstacle) {return obstacle.xPos <= Runner().currentSpeed * 18;}function tackle(obstacle) {if (isDuckable(obstacle)) {duck();} else {jumpOver(obstacle);}}function isDuckable(obstacle) {return obstacle.yPos === 50;}function duck() {Runner().onKeyDown(downKeyArgs);setTimeout(() => {Runner().onKeyUp(downKeyArgs);}, 500);}function jumpOver(obstacle) {if (isNextObstacleCloseTo(obstacle))jumpFast();elseRunner().onKeyDown(upKeyArgs);}function isNextObstacleCloseTo(currentObstacle) {const nextObstacle = Runner().horizon.obstacles[1];return nextObstacle && nextObstacle.xPos - currentObstacle.xPos <= Runner().currentSpeed * 42;}function jumpFast() {Runner().onKeyDown(upKeyArgs);Runner().onKeyUp(upKeyArgs);}return {conquerTheGame: conquerTheGame};}let bot = TrexRunnerBot();let botInterval = setInterval(bot.conquerTheGame, 2);

最后回车即可自动玩Chrome小恐龙游戏

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。