您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
煤渣活动的生产者购买建议
当前为
// ==UserScript== // @name gooboo 煤渣购买建议 // @namespace http://tampermonkey.net/ // @version 1.1.0 // @description 煤渣活动的生产者购买建议 // @author baicy // @match *://*/gooboo/ // @match *://gooboo.g8hh.com.cn/ // @match *://gooboo.tkfm.online/ // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== // @license MIT // ==/UserScript== (function () { "use strict" let found = false let inventory = null const store = document.getElementsByClassName("primary")[0].__vue__.$store setInterval(() => { const ci = document.querySelector(".cinders-inventory") if (ci) { if (!found) { found = true inventory = ci console.log("抵达煤渣现场...停止继续寻找") addInfo() } } else { found = false } }, 2000) setInterval(() => { getLight() for (const p in producers) { cinder(p) } getBest() }, 1000) const producers = { firefly: "萤火虫", glowshroom: "发光蘑菇", glowfish: "发光鱼", lantern: "灯", campfire: "营火", coral: "珊瑚", jellyfish: "海蜇", nightbloom: "夜花", neonlight: "霓虹灯", sun: "太阳", } const productions = {} function cinder(key) { const upgrades = store.state.upgrade.item const val = upgrades[`event_${key}`] if (val.requirement()) { if (!productions[key]) { productions[key] = 0 } else { getSingleInfo(key) } } return val } function capitalize(string) { return string.charAt(0).toUpperCase() + string.slice(1) } function formatTime(remain) { const day = Math.floor(remain / (24 * 3600)) remain -= day * 24 * 3600 const hour = Math.floor(remain / 3600) remain -= hour * 3600 const minute = Math.floor(remain / 60) remain -= minute * 60 const second = Math.floor(remain) return `${day > 0 ? `${day}d` : ""}${ day > 0 || hour > 0 ? `${hour}h` : "" }${day > 0 || hour > 0 || minute > 0 ? `${minute}m` : ""}${second}s` } const infoStyles = [ "background: white;", "color: black;", "display: flex;", "flex-direction: column;", "justify-content: space-between;", "padding: 10px 20px;", ] function addInfo() { const infoDiv = document.createElement("div") infoDiv.id = "cinder_info" infoDiv.style = infoStyles.join("") for (const p in producers) { const span = getSingleInfo(p) if (span) { infoDiv.appendChild(span) } } inventory.insertBefore(infoDiv, inventory.childNodes[1]) let lightInfo = getLight() if (lightInfo) { inventory.childNodes[0].appendChild(lightInfo) } } function getLight() { const light = store.state.stat.event_light.value let lightGain = store.getters["cinders/totalProduction"] * Math.pow(1.01, store.getters["meta/globalEventLevel"]) if (store.state.cinders.activeCandle) { lightGain = lightGain * store.getters["mult/get"]( "cindersCandlePower", store.state.cinders.candle[store.state.cinders.activeCandle.name] .lightMult - 1, 1, 1 ) } lightGain = store.getters["mult/get"]("currencyEventLightGain", lightGain) const token = Math.floor( store.getters["mult/get"]( "currencyEventCindersTokenGain", Math.log(light / 10000) / Math.log(1.2) ) ) const needLight = Math.exp(Math.log(1.2) * (token + 1)) * 10000 const needTime = (needLight - light) / lightGain let lightInfo = document.querySelector(`#cinder_info_light`) if (lightInfo) { document.querySelector("#cinder_info_light_gain").innerHTML = lightGain.toExponential(4) document.querySelector("#cinder_info_token").innerHTML = `${formatTime( needTime )}` } else { lightInfo = document.createElement("div") lightInfo.id = "cinder_info_light" lightInfo.style = "background:white;color: black;line-height:30px;display:flex;flex-direction:column;" const lightSpan = document.createElement("span") lightSpan.innerHTML = `光增益 <span id="cinder_info_light_gain">${lightGain}</span>/秒` const tokenSpan = document.createElement("span") tokenSpan.innerHTML = `代币+1需要 <span id="cinder_info_token">${needTime}</span>` lightInfo.appendChild(lightSpan) lightInfo.appendChild(tokenSpan) return lightInfo } } function getSingleInfo(p) { const producer = store.state.upgrade.item[`event_${p}`] let val = 0 if (producer.requirement()) { const price = producer.price(producer.level).event_light const mult = store.state.mult.items[`cindersProduction${capitalize(p)}`] const gain = mult.baseCache * mult.multCache val = gain / price productions[p] = val let producerSpan = document.querySelector(`#cinder_info_${p}`) if (!producerSpan) { producerSpan = document.createElement("span") producerSpan.innerHTML = `${ producers[p] }:<span id="cinder_info_${p}">${val.toExponential(4)}</span>` return producerSpan } else { producerSpan.innerHTML = val.toExponential(4) } } return null } function getBest() { let max = 0 let producer = Object.keys(producers)[0] for (const p in productions) { if (productions[p] > max) { max = productions[p] producer = p } } const infoPanel = document.querySelector("#cinder_info") if (infoPanel) { infoPanel.childNodes.forEach((info) => { info.style = "" }) document.querySelector(`#cinder_info_${producer}`).parentNode.style = "color:green" } } })()