您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
让你现在就能用上拼图游戏里的键盘控件,不必再等待慵懒的微软员工,使用键盘控件玩拼图小游戏实在是泰裤辣!
// ==UserScript== // @name 必应拼图小游戏键盘控件 // @namespace http://tampermonkey.net/ // @version 0.1 // @description 让你现在就能用上拼图游戏里的键盘控件,不必再等待慵懒的微软员工,使用键盘控件玩拼图小游戏实在是泰裤辣! // @author Haze // @match https://cn.bing.com/spotlight/* // @icon https://www.google.com/s2/favicons?sz=64&domain=bing.com // @grant none // ==/UserScript== (function () { 'use strict'; let tiles; const entry = () => { loadElements(); window.onkeyup = function (e) { if (e.key == 'ArrowUp') { inputArrowUp(); } if (e.key == 'ArrowDown') { inputArrowDown(); } if (e.key == 'ArrowLeft') { inputArrowLeft(); } if (e.key == 'ArrowRight') { inputArrowRight(); } } }; const loadElements = () => { tiles = document.getElementById("tiles").children; }; const inputArrowUp = () => { for (let i = 0; i < tiles.length; i++) { const next = i - 3; if (checkTileByIndex(next)) { tiles[i].click(); break; } } }; const inputArrowDown = () => { for (let i = 0; i < tiles.length; i++) { const next = i + 3; if (checkTileByIndex(next)) { tiles[i].click(); break; } } }; const inputArrowLeft = () => { for (let i = 0; i < tiles.length; i++) { const next = i - 1; if (checkTileByIndex(next)) { tiles[i].click(); break; } } }; const inputArrowRight = () => { for (let i = 0; i < tiles.length; i++) { const next = i + 1; if (checkTileByIndex(next)) { tiles[i].click(); break; } } }; const checkTileByIndex = (index) => { if (index < 0 || index >= tiles.length) { return false; } const targetChildren = tiles[index].children; if (targetChildren.length == 0) { return true; } }; setTimeout(entry, 500); })();