Auto leveling - discord.com

Bare bone tool to auto level up on Discord servers, send messages automatically

当前为 2025-06-27 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

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

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name        Auto leveling - discord.com
// @namespace   https://github.com/Thibb1
// @match       https://*.discord.com/*
// @grant       none
// @version     1.0
// @author      Thibb1
// @description Bare bone tool to auto level up on Discord servers, send messages automatically
// @require     https://cdn.jsdelivr.net/npm/[email protected]/dist/lil-gui.umd.min.js
// @require     https://code.jquery.com/jquery-3.7.1.min.js
// @license     GPL
// ==/UserScript==

(function() {
  'use strict';
  const gui = new lil.GUI();

  const enterEvent = new KeyboardEvent('keydown', {
    key: 'Enter',
    code: 'Enter',
    keyCode: 13,
    charCode: 13,
    bubbles: true
  });

  const settings = {
    autoSendText: false,
    randomText: true,
    myString: 'hello',
    autoInterval: 60,
    randomTextLen: 5,
    testSendText: sendText
  };
  gui.add(settings, 'autoSendText');
  gui.add(settings, 'randomText');
  gui.add(settings, 'myString');
  gui.add(settings, 'randomTextLen', 1, 25, 1);

  function autoSend() {
    if (!settings.autoSendText) return;
    sendText();
  }

  function sendText() {
    const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
    let randomString = '';
    for (let i = 0; i < settings.randomTextLen; i++) {
      randomString += characters.charAt(Math.floor(Math.random() * characters.length));
    }
    const text = settings.randomText ? randomString : settings.myString;
    let inputElement = document.querySelector('[data-slate-node="value"]');
    for (let key in inputElement) {
      if (key.startsWith('__reactProps$')) {
        inputElement[key].children.props.node.insertText(text);
        inputElement.dispatchEvent(enterEvent);
        break;
      }
    }
  }

  let autoSendInterval;
  function startAutoSend() {
    if (autoSendInterval) {
      clearInterval(autoSendInterval);
    }
    if (settings.autoInterval > 0) {
      autoSendInterval = setInterval(autoSend, settings.autoInterval * 1000);
    }
  }
  gui.add(settings, 'autoInterval', 0, 120, 5).onChange(startAutoSend);
  gui.add(settings, 'testSendText');
  startAutoSend();
})();