-
-
Save Sitethief/265c6f0b2365015c61c497b5d3d8de85 to your computer and use it in GitHub Desktop.
NSEndorse
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name NSEndorse | |
// @namespace sitethiefs-ns-scripts | |
// @version 0.1.1 | |
// @description Adss keybind to endorse button | |
// @author Sitehief of Vylixan | |
// @copyright GPLv3 https://www.gnu.org/licenses/gpl-3.0.html | |
// @match *www.nationstates.net/* | |
// @grant none | |
// @require https://craig.global.ssl.fastly.net/js/mousetrap/mousetrap.min.js?a4098 | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
function noinput_mousetrap(event) { | |
if (event.target.classList.contains("mousetrap")) { | |
event.preventDefault(); | |
event.stopPropagation(); | |
} | |
} | |
if (window.location.href.includes('nation=')) { | |
Mousetrap.bind(['e'], function(ev) { | |
noinput_mousetrap(ev); | |
let button = document.querySelector('button.endorse:not(.danger)'); | |
if (button) { | |
button.click(); | |
} | |
}, 'keyup'); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment