[GC] Kiss The Mortog Keyboard Controls

Play Kiss the Mortog with the keyboard.

// ==UserScript==
// @name        [GC] Kiss The Mortog Keyboard Controls
// @namespace   https://greasyfork.org/en/users/1225524-kaitlin
// @match       https://www.grundos.cafe/medieval/kissthemortog/*
// @grant       none
// @license     MIT
// @version     1.1
// @author      Cupkait
// @icon        https://i.imgur.com/4Hm2e6z.png
// @description Play Kiss the Mortog with the keyboard.
// ==/UserScript==


		const ThouShallNotPass = "250000";
								// Set this number to the amount of winnings you want to stop
								// at without collecting or moving to the next level. Do not
								// include spaces, commas or NP - just enter the number value.
								// 100, 300, 1150, 5900, 35000, 250000, 2000000, 18000000
								// 5900 is where you should set this if you want the avatar.


const mortogs = $('#mortogs > div > form');
const menu = $('#mortogs > .center > img.mortog-big-image').attr('src');
const prize = $('p.center').find('strong').eq(1).text().replace(/\D/g, '');


if (mortogs.length > 1) {
    console.log("Keep going... pick a mortog.");
    $(document).keypress(function(e) {
        if (e.which === 13) {
            const randomIndex = Math.floor(Math.random() * mortogs.length);
            mortogs.eq(randomIndex).submit();
        }
    });
} else if (menu.includes('boom')) {
    console.log("Yikes, get a mop then start over.");
    $(document).keypress(function(e) {
        if (e.which === 13) {
            $('input[value="Try again..."]').click();
        }
    })
} else if (menu.includes('mortog_prince')) {
    console.log("You got lucky... this time... keep going!");
    if (prize === ThouShallNotPass) { console.log("prize")
        alert("Whoa, hold your horses!\n\nBetter let this one simmer before you go kissing it...");
        $('body').css('background-color', 'lightred');
    }
    else {
        $(document).keypress(function(e) {
            if (e.which === 13) {
                $('input[value="Continue"]').click();
            }
        });
		}}