GC Questing Keyboard Controls

Adds keyboard controls for questing on GC.

17.02.2024 itibariyledir. En son verisyonu görün.

    // ==UserScript==
    // @name         GC Questing Keyboard Controls
    // @namespace    http://tampermonkey.net/
    // @version      1.5
    // @description  Adds keyboard controls for questing on GC.
    // @author       Z
    // @match        https://www.grundos.cafe/halloween/esophagor/*
    // @match        https://www.grundos.cafe/island/kitchen/*
    // @match        https://www.grundos.cafe/winter/snowfaerie/*
    // @match        https://www.grundos.cafe/halloween/witchtower/*
    // @match        https://www.grundos.cafe/halloween/braintree/*
    // @match        https://www.grundos.cafe/safetydeposit/?page=1&query=*
    // @match        https://www.grundos.cafe/market/wizard/*
    // @match        https://www.grundos.cafe/market/browseshop/?owner=*
    // @license      MIT
    // @icon         https://www.google.com/s2/favicons?sz=64&domain=grundos.cafe
    // ==/UserScript==

    // lol sorry if u can read JS, it'll eventually be less .... like this

    var rmOne = document.querySelector("a.sdb-remove-one-text");
    var search = document.querySelector("div.sw_search_submit input.form-control");
    var shop = document.querySelector(".market_grid.sw_results .data a:nth-child(1)");
    var buy = document.querySelector("#searchedItem.shop-item input[type='image']");
    var itemOne = document.querySelector(".itemList .shop-item:nth-child(1) img.search-helper-sdb-exists");
    var wizOne = document.querySelector(".itemList .shop-item:nth-child(1) img.search-helper-sw");
    var itemTwo = document.querySelector(".itemList .shop-item:nth-child(2) img.search-helper-sdb-exists");
    var wizTwo = document.querySelector(".itemList .shop-item:nth-child(2) img.search-helper-sw");
    var itemThree = document.querySelector(".itemList .shop-item:nth-child(3) img.search-helper-sdb-exists");
    var wizThree = document.querySelector(".itemList .shop-item:nth-child(3) img.search-helper-sw");
    var itemFour = document.querySelector(".itemList .shop-item:nth-child(4) img.search-helper-sdb-exists");
    var wizFour = document.querySelector(".itemList .shop-item:nth-child(4) img.search-helper-sw");
    var esoStart = document.querySelector("input[value='Sure, I Will Find You Food']");
    var chefStart = document.querySelector("input[value='Sure, I will help!']");
    var snowStart = document.querySelector("input[value='I will help you!']");
    var ednaStart = document.querySelector("input[value='Erm... OK then']");
    var brainStart = document.querySelector("input[value='Accept the Quest']");
    var esoDone = document.querySelector("input[value='I have your food!']");
    var chefDone = document.querySelector("input[value='I have the ingredients!']");
    var snowDone = document.querySelector("input[value='I have the ingredients!']");
    var ednaDone = document.querySelector("input[value='I have the ingredients!']");
    var brainDone = document.querySelector("input[value='Submit Answer']");
    var esoRestart = document.querySelector("input[value='Approach the Esophagor again...']");
    var chefRestart = document.querySelector("input[value='Approach the Chef Again']");
    var snowRestart = document.querySelector( "input[value='Approach Taelia again...']");
    var ednaRestart = document.querySelector("input[value='Approach the witch again...']");
    var brain = document.querySelector("img[title='Brain Tree Quest']");
    var eso = document.querySelector("img[title='Esophagor Quest']");
    var chef = document.querySelector("img[title='Kitchen Quest']");
    var taelia = document.querySelector("img[title='Taelia Quest']");
    var edna = document.querySelector("img[title='Edna Quest']");

    document.addEventListener("keydown", (event) => {
          if (event.keyCode == 13) { // enter
            if (esoStart != null) {
                esoStart.click();
            } else if (brainStart != null) {
              brainStart.click();
            } else if (chefStart != null) {
              chefStart.click();
            } else if (snowStart != null) {
              snowStart.click();
            } else if (ednaStart != null) {
              ednaStart.click();
            } else if (rmOne != null) {
                rmOne.click();
            } else if (search != null) {
              search.click();
            } else if (shop != null) {
                shop.click();
            } else if (buy != null) {
                buy.click();
            } else if (esoDone != null) {
                esoDone.click();
            } else if (brainDone != null) {
              brainDone.click();
            } else if (chefDone != null) {
              chefDone.click();
            } else if (snowDone != null) {
              snowDone.click();
            } else if (ednaDone != null) {
              ednaDone.click();
            } else if (esoRestart != null) {
              esoRestart.click();
            } else if (chefRestart != null) {
              chefRestart.click();
            } else if (snowRestart != null) {
              snowRestart.click();
            } else if (ednaRestart != null) {
              ednaRestart.click();
            }
          }
        });

 document.addEventListener("keydown", (event) => {
          if (event.keyCode == 37) { // left arrow
            if (itemOne != null) {
                itemOne.click();
            } else wizOne.click();
          }
        });
document.addEventListener("keydown", (event) => {
          if (event.keyCode == 38) { // up arrow
            if (itemTwo != null) {
                itemTwo.click();
            } else wizTwo.click();
          }
        });
document.addEventListener("keydown", (event) => {
          if (event.keyCode == 39) { // right arrow
            if (itemThree != null) {
                itemThree.click();
            } else wizThree.click();
          }
        });
document.addEventListener("keydown", (event) => {
          if (event.keyCode == 40) { // down arrow
            if (itemFour != null) {
                itemFour.click();
            } else wizFour.click();
          }
        });

 document.addEventListener("keydown", (event) => {
          if (event.keyCode == 49) { // 1
                edna.click();
          }
        });
 document.addEventListener("keydown", (event) => {
          if (event.keyCode == 50) { // 2
                eso.click();
          }
        });
 document.addEventListener("keydown", (event) => {
          if (event.keyCode == 51) { // 3
                taelia.click();
          }
        });
 document.addEventListener("keydown", (event) => {
          if (event.keyCode == 52) { // 4
                chef.click();
          }
        });
 document.addEventListener("keydown", (event) => {
          if (event.keyCode == 53) { // 5
                brain.click();
          }
        });