Skip to content

Instantly share code, notes, and snippets.

@brandonhellman
Last active August 4, 2019 00:28
Show Gist options
  • Save brandonhellman/cbafbc2b6b6fc55fb5d7774cc90cd59e to your computer and use it in GitHub Desktop.
Save brandonhellman/cbafbc2b6b6fc55fb5d7774cc90cd59e to your computer and use it in GitHub Desktop.
A Turkernator userscript.
// ==UserScript==
// @name A9 - Are the items exact? - Keybinds
// @version 1.0.1
// @include hit_set_id:3NE6EBGK58WRF4Y79I0YPEOFMAE3EQ
// ==/UserScript==
const settings = {
autoSubmit: false,
};
function submit() {
document.querySelector('#submitButton').click();
}
function yesYes() {
document.querySelector('[value="yesMatch"]').click();
document.querySelector('[value="yesEnough"]').click();
if (settings.autoSubmit) submit();
}
function noYes() {
document.querySelector('[value="noMatch"]').click();
document.querySelector('[value="yesEnough"]').click();
if (settings.autoSubmit) submit();
}
function unsureNo() {
document.querySelector('[value="unsureMatch"]').click();
document.querySelector('[value="notEnough"]').click();
if (settings.autoSubmit) submit();
}
document.addEventListener('keydown', ({ key }) => {
if (key === '1') {
yesYes();
}
if (key === '2') {
noYes();
}
if (key === '3') {
unsureNo();
}
if (key === '4') {
submit();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment