hoyoverse 序列化序號輸入

自動整理、輪流輸入批量序號

// ==UserScript==
// @name         hoyoverse 序列化序號輸入
// @name:ja      シリアル序列化入力機能
// @name:en      hoyoverse code helper
// @namespace    http://tampermonkey.net/
// @version      2024-02-06
// @description  自動整理、輪流輸入批量序號
// @description:ja  バッチシリアル順番入力
// @description:en  auto run bunch codes for genshin and hsr
// @author       Bee10301
// @match        https://hsr.hoyoverse.com/gift*
// @match        https://genshin.hoyoverse.com/*gift*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=hoyoverse.com
// @grant        none
// @license      GNU GPLv3
// ==/UserScript==

(async function () {
  "use strict";
  while (
    !document.querySelector(".web-cdkey-explain__title") &&
    !document.querySelector(".cdkey-desc__title")
  ) {
    await new Promise((resolve) => setTimeout(resolve, 200));
  }

  /*window.onload = () => {*/
  //get content
  let game = "";
  let explainTitle;
  if (document.querySelector(".web-cdkey-explain__title")) {
    explainTitle = document.querySelector(".web-cdkey-explain__title");
    game = "hsr";
  } else {
    explainTitle = document.querySelector(".cdkey-desc__title");
    game = "gs";
  }

  let explainPS = document.querySelector(".web-cdkey-explain .ps")
    ? document.querySelector(".web-cdkey-explain .ps")
    : document.querySelector(".cdkey-desc");

  let explainContent = document.querySelector(".web-cdkey-explain__content")
    ? document.querySelector(".web-cdkey-explain__content")
    : document.querySelector(".cdkey-desc__content");

  let cdkeyCodeInput = document.getElementById("web_cdkey_code")
    ? document.getElementById("web_cdkey_code")
    : document.getElementById("cdkey__code");

  let myBtn;
  let waiting_add = false;

  //create element
  let inputElement = document.createElement("input");
  //fail base64
  const xPicBase64 =
    "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANwAAADcCAYAAAAbWs+BAAAAAXNSR0IArs4c6QAAIABJREFUeF7tfQt0XFXV/2/fmbTh0QIWeb+hgiCdSQhQMjfBlALadmZawPr44PPFQxEUURDwEwEVERRBEaQonwI+qFA6M22lfyj5k9wJBdJkpqUogi0IFAQq0BaaJjN3f+tMJqGPJHPPfczz3LV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5Tz5LqZqt87+T3c6bvYNnTgPWWOrL8fKMxZI1XBz7LKmticwEOfKkgvgr3slLhG7UhqmK0YPOZ+OxWdvTtLHkRuXOpifqovo3sW7fdnPX+cUk5FU0svIeK0lKVn3ovZJuDlijf6A+pCQZWq/aG30+vxfpCofrMJ+cOrbGdqinzw961KK03b92Rc89T8QWf6lo6KP0w1Qd6Ols/VxYR0xMuHd/sbKTA90OHgIyqnqn9cu8joVcfv80qrKj79prF/r9e4jQ00Etub62vLiEmP4uLOrHT3XHGZDV5Yb4fPPiFxSTH6Vm5eB0MunTvxdvUzJzC0oqqmtra2urK8qJcfHpywsOr4b7bV8w1GC8tLizA9+/4d/yPj/8D9MBDVLNAnPgAAAAASUVORK5CYII=";

  function inputFilter(input_text) {
    const linesArray = input_text.split(/\s+/);
    // 保留包含序號的行
    const codesArray = linesArray.filter((line) => line.trim().length > 0);
    for (let i = 0; i < codesArray.length; i++) {
      const code = codesArray[i];
      if (code.match(/\s*https?:\/\/\S+\/gift\?code\=([^\s^\.]+)/)) {
        addCode(code.match(/\s*https?:\/\/\S+\/gift\?code\=([^\s^\.]+)/)[1]);
      } else {
        addCode(code);
      }
    }
  }

  function runCode() {
    if (document.querySelector(".closeBtn")) {
      document.querySelector(".closeBtn").click();
    } else if (document.querySelector(".cdkey-result__close")) {
      document.querySelector(".cdkey-result__close").click();
    }
    if (document.querySelector(".web-cdkey-form__submit")) {
      document.querySelector(".web-cdkey-form__submit").click();
    } else if (document.querySelector(".cdkey-form__submit")) {
      document.querySelector(".cdkey-form__submit").click();
    }
  }

  function insertCode(code) {
    cdkeyCodeInput.value = code;
    cdkeyCodeInput.dispatchEvent(new Event("input"));
    runCode();
  }

  async function doAll() {
    if (!waiting_add) {
      waiting_add = true;
      myBtn.textContent = "Running...";
      //get all code in p element
      let pElements = explainContent.querySelectorAll("p");
      for (let i = 0; i < pElements.length; i++) {
        const pElement = pElements[i];

        if (pElement.style.color === "black") {
          await (async () => {
            insertCode(pElement.textContent);
            while (
              !document.querySelector(".closeBtn") &&
              !document.querySelector(".cdkey-result__close")
            ) {
              await new Promise((resolve) => setTimeout(resolve, 200));
            }
            while (
              !document.querySelector(".resPic") &&
              !document.querySelector(".cdkey-result__icon")
            ) {
              await new Promise((resolve) => setTimeout(resolve, 200));
            }

            if (
              (document.querySelector(".resPic") &&
                document.querySelector(".resPic").src == xPicBase64) ||
              (document.querySelector(".cdkey-result__icon") &&
                document.querySelector(".cdkey-result__icon").src ==
                  xPicBase64GS)
            ) {
              pElement.style.color = "red";
              pElement.textContent += " ==> Failed !";
            } else if (
              document.querySelector(".resPic") ||
              document.querySelector(".cdkey-result__icon")
            ) {
              pElement.style.color = "green";
              pElement.textContent += " ==> OK !";
            } else {
              pElement.textContent += " ==> Error ?";
            }
            if (game == "hsr" && document.querySelector(".closeBtn")) {
              document.querySelector(".closeBtn").click();
            } else if (
              game == "gs" &&
              document.querySelector(".cdkey-result__close")
            ) {
              document.querySelector(".cdkey-result__close").click();
            }
            //wait 5 second
            for (let i = 5; i > 0; i--) {
              myBtn.textContent = "Waiting " + i + "s";
              await new Promise((resolve) => setTimeout(resolve, 1000));
            }
          })();
        }
      }
      myBtn.textContent = "<<< Run Code";
      waiting_add = false;
    }
  }

  //add code line
  function addCode(code) {
    let pElement = document.createElement("p");
    pElement.style.whiteSpace = "pre-wrap";
    pElement.style.color = "black";
    pElement.textContent = code;
    explainContent.appendChild(pElement);
  }

  function addBtn() {
    let btn = document.createElement("button");
    btn.textContent = "<<< Run Code";
    if (game === "hsr") {
      btn.className = "web-cdkey-form__submit";
    } else if (game === "gs") {
      btn.className = "cdkey-form__submit";
    }
    btn.id = "runBtn";
    btn.style.margin = "0.3rem auto auto 0rem";
    btn.onclick = doAll;
    if (game == "hsr") {
      document.querySelector(".web-cdkey-explain").appendChild(btn);
    } else if (game == "gs") {
      explainPS.appendChild(btn);
    }
    myBtn = document.getElementById("runBtn");
  }

  function startDefine() {
    explainTitle.innerHTML = "Paste Here ↓";
    explainContent.innerHTML = "";
    if (game === "hsr") {
      explainPS.style.height = "200px";
    } else if (game === "gs") {
      explainContent.style.height = "200px";
    }
    inputElement.type = "text";
    inputElement.placeholder = "code / URL";
    if (game === "hsr") {
      inputElement.className = "web-cdkey-form__input";
    } else if (game === "gs") {
      inputElement.className = "cdkey-form__input";
    }
    inputElement.id = "userInput";
    inputElement.name = "userInput";
    inputElement.style.width = "100%";
    inputElement.onchange = () => {
      if (inputElement.value.length > 5) {
        inputFilter(inputElement.value);
        inputElement.value = "";
      }
    };

    if (explainContent.firstChild) {
      explainContent.insertBefore(inputElement, explainContent.firstChild);
    } else {
      explainContent.appendChild(inputElement);
    }
  }

  startDefine();
  addBtn();
  /*};*/
})();