Greasy Fork

Greasy Fork is available in English.

カスタムくん[EXT]

入力欄に文字列を改行で区切って入力して「投稿」ボタンを押すと文字列の中からランダムで一つ投稿してくれます。

当前为 2021-01-10 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         カスタムくん[EXT]
// @namespace    http://tampermonkey.net/
// @version      1.0.0
// @license      MIT
// @description  入力欄に文字列を改行で区切って入力して「投稿」ボタンを押すと文字列の中からランダムで一つ投稿してくれます。
// @author       You
// @match        *.x-feeder.info/*/
// @match        *.x-feeder.info/*/sp/
// @exclude      *.x-feeder.info/*/settings/*
// @match        http://drrrkari.com/room/
// @match        http://www.3751chat.com/ChatRoom*
// @match        https://pictsense.com/*
// @match        http://www.himachat.com/
// @match        https://discord.com/*
// @match        https://*.open2ch.net/*
// @require      http://code.jquery.com/jquery-3.5.1.min.js
// @require      http://greasyfork.icu/scripts/419945-global-managedextensions/code/Global_ManagedExtensions.js?version=889360
// @require      http://greasyfork.icu/scripts/419888-antimatterx/code/antimatterx.js?version=889299
// @grant        GM.setValue
// @grant        GM.getValue
// ==/UserScript==

(function(unsafeWindow) {
    'use strict';
    var $ = window.$,
        amx = window.antimatterx,
        sendMessage = window.sendMessage;
    unsafeWindow.Global_ManagedExtensions["カスタムくん"] = {
        config: function(say) {
            var h = $("<div>"),
                isDiscord = (amx.parseURL().domainname === "discord.com");
            if (isDiscord) {
                var inputDiscordToken = $(amx.addInputText(h[0], {
                    title: "authorization",
                    placeholder: "発言に必要なキー",
                    width: "50%",
                    save: "authorization"
                })).after("<br><br>");
            };
            var inputMessages = $(amx.addInputText(h[0], {
                    textarea: true,
                    placeholder: "改行で区切って入力",
                    save: "messages"
                })),
                postBtn = amx.addButton(h[0], {
                    title: "投稿",
                    click: function() {
                        var messages = inputMessages.val().split("\n").filter(function(v) {
                            return v.length > 0;
                        });
                        if (messages.length === 0 || isDiscord && inputDiscordToken.val().length === 0) return;
                        say(amx.randArray(messages), inputDiscordToken === undefined ? undefined : inputDiscordToken.val());
                    }
                });
            return h;
        }
    };
})(this.unsafeWindow || window);