Greasy Fork is available in English.
自动输入"上上下下左右左右BABA"
当前为
// ==UserScript==
// @name 魂斗罗30命
// @namespace
// @license MIT
// @version 1.0
// @description 自动输入"上上下下左右左右BABA"
// @author CHATPGT
// @match *://*/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
const konamiCode = 'ArrowUpArrowUpArrowDownArrowDownArrowLeftArrowRightArrowLeftArrowRightba';
function triggerKonamiCode() {
let event;
let i = 0;
const triggerKey = function(key) {
event = new KeyboardEvent('keydown', {'key': key});
document.dispatchEvent(event);
};
const triggerCode = function() {
if (i < konamiCode.length) {
triggerKey(konamiCode[i]);
i++;
setTimeout(triggerCode, 100);
}
};
triggerCode();
}
const button = document.createElement('button');
button.innerText = 'Konami Code';
button.onclick = triggerKonamiCode;
document.body.appendChild(button);
})();