您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Convert a spesified amount of SD into SD packs
// ==UserScript== // @name DH3 Quick SD Converter // @namespace http://tampermonkey.net/ // @version 0.1 // @description Convert a spesified amount of SD into SD packs // @author Lasse Brustad // @match https://dh3.diamondhunt.co/ // @grant none // ==/UserScript== /* jshint esversion:6 */ (function() { 'use strict'; // how many packs do you want to convert at once? default is 100, so 100k SD turns into 100 packs // 0 = all // 1+ = stardust / 1000 / packs const packs = 100; /** * #==================================================================# * # # * # I suggest you to keep away from the code below here to keep safe # * # # * #==================================================================# **/ // Format Numbers - 1000 = 1,000 const fnum = window.formatNumber; // Get SD, but returns "null" if it isn't enough to convert function getSD() { const sd = window.getItem('stardust'); return sd >= 1e3 ? sd : null; } // Get the number of convertable SD packs you can convert SD to function getMaxConvertableSD() { const sd = getSD(); if (sd === null) return 0; return Math.floor(sd / 1e3); } function final() { const maxPacks = getMaxConvertableSD(); let total = maxPacks; if (packs !== 0) total -= total % packs; if (total === 0) return; console.log(`Converted ${fnum(total * 1e3)} SD into ${fnum(total)} SD packs`); window.sendBytes(`MAKE_SD_PACKS=${total}`); } window.convertStardustToPack = final; })();