Auto-Maxes the items in Bits 'n' Bobs
目前為
// ==UserScript==
// @name Max Buy
// @namespace https://greasyfork.org/en/scripts/398355-max-bits-n-bobs-filter
// @version 0.2.2
// @description Auto-Maxes the items in Bits 'n' Bobs
// @author Cryosis7 [926640]
// @match *www.torn.com/shops.php?*
// @match *www.torn.com/bazaar.php*
// ==/UserScript==
$(function () {
$(".buy-act-wrap").find('input, [value="1"]').val('100'); // Torn Shops
})
const bazaarWrapper = $('#bazaar-page-wrap')[0];
var observer = new MutationObserver(function (mutations) {
for (let mutation of mutations) {
if ($(mutation.addedNodes).find('ul.items-list'))
$('ul.items-list').children().each((i, listing) =>
$(listing).find('.act > input').val($(listing).find('span.instock').text()));
}
});
observer.observe(bazaarWrapper, { childList: true });