0

目前我的脚本没有错误,并且在 JSHint 中只有 2 个问题(但没有一个是关键的(我认为))。这是我应该工作的脚本,但不是。

    var hats = [31151864, 16412796, 95245701, 61847146]; 
var names = ["a", "b", "c", "d"];
var request = 65;

var Loop = setInterval(function () {
    for (var Id in hats) {
        var origLink = "http://www.roblox.com/"+names[Id]+"-item?id=" + hats[Id];
        $.get(origLink, function(data) {
            var Regex = /item\Dprivatesale\Dprice\D\D([\d,]+)\D\Dspan\D/;
        console.log(data.match(Regex)[1]);
            var PriceSelling = data.match(Regex)[1];
            if (PriceSelling <= request) {
                var hatBuying = "http://m.roblox.com/items/" + hats[Id] + "/privatesales";
console.log(hatBuying);
    $.get(hatBuying, function(data){console.log("Success!");
                    var Regex2 = /Catalog\DVerifyTransfer\DuserAssetOptionId\D([\d,]+)\Damp\DexpectedPrice\D/+PriceSelling+/\D\D/;
                    var buyId = data.match(Regex2)[1];
                                        console.log(buyId);
                    var buyLink = "http://m.roblox.com/Catalog/VerifyTransfer?userAssetOptionId=" + buyId + "&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 = buyLink;
                    document.body.innerHTML = "";
                    document.body.appendChild(Explorer);
                    clearInterval(Loop);
                });
            }
        });
    }
console.log("!");
}, 500);

目前,帽子 4 (d) 的售价为 65 'robux' 货币,所以我得到的输出是这样的:

65 http://m.roblox.com/items/61847146/privatesales

怎么了?它甚至不启动第二个 AJAX 调用,即使它应该启动。请帮忙?谢谢!

4

0 回答 0