简体   繁体   中英

How to fix this error in this code for chrome's console?

I'm trying to use chrome's console, but I am getting this error.

I barely have experience in using chrome's console, so please try to explain the solutions to me thoroughly.

var hatIds = [362081769, 19027209] //This is the Ids of the hats
var PriceWanting = 1500 //This is the price


var Loop = setInterval(function(){
        for (var Id in hatIds) {
                var hatLink = "https://m.roblox.com/items/" + hatIds[Id] + "/privatesales"
                $.get(hatLink,function(data){
                        var Regex = /\<span class="currency-robux">([\d,]+)\<\/span\>/
                        var PriceSelling = data.match(Regex)[1]
                        PriceSelling = Number(PriceSelling.replace(",",""))
                        if (PriceSelling <= PriceWanting) {
                                var Regex2 = /<a href="\/Catalog\/VerifyTransfer\DuserAssetOptionId=([\d,]+)\Damp;expectedPrice=([\d,]+)">/
                                var HatBuyId = data.match(Regex2)[1]
                                var HatBuyLink = "http://m.roblox.com/Catalog/VerifyTransfer?userAssetOptionId=" + HatBuyId + "&expectedPrice=" + PriceSelling
                                var Explorer = document.createElement('iframe');
                                function Buy(){
                                        Explorer.contentDocument.forms[0].submit();
                                };
                                Explorer.onload = Buy;
                                Explorer.width = "300";
                                Explorer.height = "400";
                                Explorer.src = HatBuyLink;
                                document.body.innerHTML = "";
                                document.body.appendChild(Explorer);
                                clearInterval(Loop)
                        }
                });
        }
        console.log("!")
},0)

Error Message:

Uncaught TypeError: Cannot read property '1' of null
    at Object.success (<anonymous>:10:61)
    at o (jquery-1.7.2.min.js:2)
    at Object.fireWith [as resolveWith] (jquery-1.7.2.min.js:2)
    at w (jquery-1.7.2.min.js:4)
    at XMLHttpRequest.d (jquery-1.7.2.min.js:4)

What does this error message mean?

I'm not very experienced in using chrome's console, and this is someone elses' code from google i'm trying to use.

What this program is supposed to do is to go to the link generated by the ID's I provided an Roblox's standardized link system. That link is an item link. I'm trying to buy those items on Roblox for low prices by repeatedly checking if the price is low enough and buying the item.

通过单击该错误,您将从错误发生的那一行中得到...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM