tool.user.js

tool.user

لا ينبغي أن لا يتم تثبيت هذا السكريت مباشرة. هو مكتبة لسكبتات لتشمل مع التوجيه الفوقية // @require https://update.greasyfork.org/scripts/525123/1528092/tooluserjs.js

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

function getRandomNum(min, max) {
  if (min >= max) {
    throw new Error("Min must be less than max");
  }
  min = Math.ceil(min);
  max = Math.floor(max);
  return Math.floor(Math.random() * (max - min + 1)) + min;
}

/**
 * 模拟用户输入填充input元素
 * @param {HTMLInputElement} inputElement - 输入框元素
 * @param {string|number} value - 要填充的值
 */
function fillFormInput(inputElement, value) {
  let index = 0;
  value = value.toString();
  inputElement.value = "";

  // 使用文档片段减少DOM操作
  const docFragment = document.createDocumentFragment();
  const intervalId = setInterval(() => {
    if (index < value.length) {
      docFragment.textContent += value[index];
      inputElement.value = docFragment.textContent;
      const inputEvent = new Event("input", { bubbles: true });
      inputElement.dispatchEvent(inputEvent);
      index++;
    } else {
      clearInterval(intervalId);
    }
  }, 100);
}

function getRandomCharFrom(str) {
  const randomIndex = Math.floor(Math.random() * str.length);
  return str.charAt(randomIndex);
}

const leftKeyboardChars = "1234567890qwertyuiop[]asdfghjkl;'zxcvbnm,./";

function getRandomLeftKeyboardChar() {
  return getRandomCharFrom(leftKeyboardChars);
}