您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
buy max based on money on hand
// ==UserScript== // @name buy-max // @namespace buy-max.zero.nao // @version 0.1 // @description buy max based on money on hand // @author nao [2669774] // @match https://www.torn.com/page.php?sid=ItemMarket* // @icon https://www.google.com/s2/favicons?sz=64&domain=torn.com // @grant none // ==/UserScript== $(document).on("click", ".input-money-symbol", function () { let parent = $(this).parents("li[class^='rowWrapper_']"); let current = parent; if (parent.length === 0) { parent = $("li[class*='expanded']"); current = $(this).parents("li[class^='buyDialog_']"); } console.log(parent); const price = $("div[class^='price_']", parent) .text() .trim() .replace("$", "") .replaceAll(",", ""); const money = Math.floor( parseInt(document.getElementById("user-money").getAttribute("data-money")), ); console.log(price, money); const qty = Math.floor(money / parseInt(price)); const qtyInput = $(".input-money", current); $(qtyInput).val(qty); $(qtyInput).trigger("input").trigger("input"); });
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址