Greasy Fork

Greasy Fork is available in English.

Popmundo Ticket Price Arranger

Automatically types in the ticket price while sending show invitations.

当前为 2022-09-09 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Popmundo Ticket Price Arranger
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Automatically types in the ticket price while sending show invitations.
// @author       Faun Fangorn
// @match        https://*.popmundo.com/World/Popmundo.aspx/Artist/InviteArtist/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=popmundo.com
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

// You can manually edit your prices from this list.
    const ticketPrices = {
        0: "5",
        1: "6",
        2: "7",
        3: "8",
        4: "9",
        5: "11",
        6: "13",
        7: "15",
        8: "20",
        9: "25",
        10: "30",
        11: "40",
        12: "45",
        13: "50",
        14: "55",
        15: "60",
        16: "65",
        17: "70",
        18: "75",
        19: "80",
        20: "90",
        21: "100",
        22: "105",
        23: "110",
        24: "115",
        25: "120",
        26: "125"
    };

//Automatically type in the price according to the ticketPrices.
    const ticketBox = document.querySelector("#ctl00_cphLeftColumn_ctl01_txtTicketPrice");
    try {
    const fame = Array.from(document.querySelectorAll("#ppm-content a")).filter((el) => el.href.includes("/World/Popmundo.aspx/Help/Scoring/"))[0].title.split("/")[0];
        ticketBox.value = ticketPrices[fame];
    } catch { ticketBox.value = 5 }

    //Buttons to increase and decrease the prices.
    const buttonPlus = document.createElement("button");
    const buttonMinus = document.createElement("button");
    buttonMinus.style = "background: none;border: none; cursor: pointer;"
    buttonPlus.style = "background: none;border: none; cursor: pointer;"
    buttonPlus.innerText ="➕";
    buttonMinus.innerText ="➖";
    buttonPlus.type = "button";
    buttonMinus.type = "button";
    ticketBox.after(buttonPlus);
    ticketBox.before(buttonMinus);

    buttonPlus.addEventListener("click", function (e) {
ticketBox.value = parseInt(ticketBox.value) + 5;
e.stopPropagation();
});
    buttonMinus.addEventListener("click", function (e) {
ticketBox.value = parseInt(ticketBox.value) - 5;
e.stopPropagation();
});

})();