您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Adds a button to the tagpro-test map test page to test a map from a U-M ID.
// ==UserScript== // @name TP Maptest U-M button // @namespace http://tampermonkey.net/ // @version 0.1 // @description Adds a button to the tagpro-test map test page to test a map from a U-M ID. // @author E. Lek-Tro // @match http://tagpro-maptest.koalabeast.com/testmap // @match http://tagpro-maptest.koalabeast.com/ // @grant none // ==/UserScript== (function() { 'use strict'; $(".form").parent().append("<button id='umIDBtn' class='btn btn-primary'>U-M ID</button>") $("#umIDBtn").click(e => { changeMapFromID(prompt("Map ID:")).then(() => { $(".form .form-group:last-child button[type='submit']").click(); }); }); $("#play-now").attr("href", "http://tagpro-maptest.koalabeast.com/testmap"); function changeMapFromID(id){ return new Promise(async (resolve, reject) => { console.log("id:", id); if(isNaN(Number(id)) || id === "") id = Math.floor(Math.random() * 60000); let pngBlob = await fetch(`https://parretlabs.xyz:8006/proxy?isBlob=1&type=image/png&link=http://unfortunate-maps.jukejuice.com/static/maps/${id}.png`) .then(res => res.blob()); let jsonBlob = await fetch(`https://parretlabs.xyz:8006/proxy?type=application/json&link=http://unfortunate-maps.jukejuice.com/static/maps/${id}.json`) .then(res => res.blob()); const pngTransfer = new ClipboardEvent('').clipboardData || new DataTransfer(); const jsonTransfer = new ClipboardEvent('').clipboardData || new DataTransfer(); pngTransfer.items.add(new File([pngBlob], 'map.png', {type: "image/png"})); jsonTransfer.items.add(new File([jsonBlob], 'map.json', {type: "application/json"})); document.querySelector("input[name='layout']").files = pngTransfer.files; document.querySelector("input[name='logic']").files = jsonTransfer.files; console.log(pngBlob, jsonBlob) setTimeout(function(){ resolve(); }, 100); }); } // Your code here... })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址