The variables that control the script's time delays are maxTO and minTO, @(you need an account to see links). Here's an adjusted version of the script. I've modified the delay variables to 2-4 seconds, the maximum price to 75,000 NP and the target items to all of the nerkmids.
Code:
// ==UserScript==
// @(you need an account to see links) Charity Corner - Auto Buy
// @(you need an account to see links)space (you need an account to see links)
// @version 0.3
// @(you need an account to see links)cription Auto Buy items that is below certain amount for Charity Corner '18
// @author richardscoot
// @(you need an account to see links)ch (you need an account to see links)
// @(you need an account to see links)ch (you need an account to see links)
// @grant none
// ==/UserScript==
// NOTE:
// 1. SET 'xPrice' to any value that you would love to buy below
// 2. You may face some error, but that's normal, just click back to check,
// if there's anything else there to buy
// 3. If you want to set to buy things faster, you can change the minTO and maxTO
// to your desired value
// 4. If you want to buy things that is in within the list (Good to buy from a
// list of R102-179), you can change "searchWithin" to "true", and change the
// "items" list to your own list.
var xPrice = 75000;
var minTO = 2000;
var maxTO = 4000;
var searchWithin = true;
var showAlert = false;
var items = ["Aluminium Nerkmid", "Average Nerkmid", "Basic Golden Nerkmid", "Basic Platinum Nerkmid", "Copper Nerkmid", "Golden Nerkmid X", "Golden Nerkmid XX", "Good Nerkmid", "Lesser Nerkmid", "Magical Golden Nerkmid", "Magical Platinum Nerkmid", "Normal Golden Nerkmid", "Normal Platinum Nerkmid", "Platinum Nerkmid X", "Platinum Nerkmid XX", "Super Nerkmid", "Ultimate Nerkmid", "Ultra Golden Nerkmid", "Ultra Nerkmid", "Ultra Platinum Nerkmid"];
var arr = [];
var arrStr = [];
var totalItems = 0;
var totalNP = 0;
$('a[href*="buy_item.phtml"]').each(function() {
var str = $(this).attr("href");
var rex = /old_price=(.*?)\&feat/;
var matches = str.match(rex);
if (matches[1] <= xPrice) {
if (arrStr.indexOf(str) == -1) {
var stock = {};
stock.el = $(this);
stock.el.attr("onclick", "location.href=this.href;return false;");
stock.np = parseInt(matches[1]);
arrStr.push(str);
str = $(this).parent("td").html();
rex = /<\/b><br>(.*?)\ in stock/;
matches = str.match(rex);
stock.total = parseInt(matches[1]);
rex = /<\/a> <br> <b>(.*?)<\/b><br>/;
matches = str.match(rex);
var itemName = matches[1];
if ((searchWithin && items.indexOf(itemName) != -1) || !searchWithin) {
totalItems = totalItems + stock.total;
totalNP = totalNP + (stock.total * stock.np);
arr.push(stock);
}
}
}
});
function buy(idx) {
var timeout = Math.floor(Math.random() * (maxTO - minTO + 1) + minTO);
arr[idx].el.click();
if (arr[idx].total > 1) {
arr[idx].total--;
} else {
idx--;
}
if (idx >= 0) {
setTimeout(function() {
buy(idx);
}, timeout);
} else {
if (showAlert) {
alert("You have bought " + totalItems + " items with " + totalNP + " NP.");
}
}
}
if (arr.length > 0) {
buy(arr.length - 1);
}