I created a script that is supposed to go to each individual link, check how much it is selling for, and if it is selling for equal to or under the price I typed in, it will say it on the title string. For whatever reason, when executing it on Chrome, the following error pops up 95% of the time: Uncaught TypeError: Cannot read property '1' of null
JShint doesn't help either, because no matter what I change, it always says the same error. If it helps, I think the error is around the regex line.
The script:
var IDs = [136758649, 116770724, 136171998, 113325603, 111903483, 116786719, 136172656, 139152118, 121926643, 120759721] //Shortened down to a few IDs
var PriceWanting = Number(prompt("How much is the max you would do?"))
document.write('<p id = "title">Total number bought: 0 items for a total of 0</p>')
var buys = 0
var totalrobuxspent = 0
console.log("Bot started")
var loop = setInterval(function () {
for (var i = 0; i < IDs.length; i++) {
$.get(" http://m.roblox.com/items/" + IDs[i] + "/privatesales", function (data) {
var Regex = /\<span class="currency-robux">([\d,]+)\<\/span\>/
var PriceSelling = data.match(Regex)[1]
PriceSelling = Number(PriceSelling.replace(",", ""))
PriceSelling = PriceSelling * 1
totalrobuxspent = totalrobuxspent + PriceSelling
var remaining = PriceWanting - PriceSelling
if (remaining >= -0.1) {
buys = buys + 1
document.getElementById("title").innerHTML = "Total number of items bought: " + buys + " for a total of " + totalrobuxspent
}
})
}
}, 3636) //Long intervals so it doesn't lag too badly; mainly for me testing