GC Questing Keyboard Controls

Adds keyboard controls for questing on GC.

当前为 2024-02-06 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

    // ==UserScript==
    // @name         GC Questing Keyboard Controls
    // @namespace    http://tampermonkey.net/
    // @version      1.3
    // @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/*
    // @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...']");

    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();
          }
        });