Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    New Coder
    Join Date
    Oct 2013
    Posts
    26
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Question Console JavaScript code broken, need solution to refresh limit!

    First off I'm just going to post the code I have currently:

    Code:
     var hatIds = [124472052] //This is the Ids of the hats var PriceWanting = 25 //This is the price
    
    var Loop = setInterval(function(){ for (var Id in hatIds) { var hatLink = "http://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].subm it(); }; Explorer.onload = Buy; Explorer.width = "300"; Explorer.height = "400"; Explorer.src = HatBuyLink; document.body.innerHTML = ""; document.body.appendChild(Explorer); clearInterval(Loop) } }); } console.log("!") },0)
    Ok, the issue is when I go to the privatesales page it will load 5 times and then return an error (roblox does this on purpose) so I need a new method of finding the private sales. This is the mobile site because it is easier to get privatesales, but you can look at the homepage of the hat and see private sales that way without limited refreshes. I do not know how to make the javascript work the way I want though, help please?

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    3,771
    Thanks
    23
    Thanked 550 Times in 549 Posts
    Could you separate your lines of code and indent please.
    Evolution - The non-random survival of random variants.

  • #3
    New Coder
    Join Date
    Oct 2013
    Posts
    26
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Sorry

    Code:
    var hatIds = [124472052] //This is the Ids of the hats
    var PriceWanting = 25 //This is the price
     
     
    var Loop = setInterval(function(){
            for (var Id in hatIds) {
                    var hatLink = "http://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)

  • #4
    New Coder
    Join Date
    Oct 2013
    Posts
    26
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Still no solution :

  • #5
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,020
    Thanks
    75
    Thanked 4,323 Times in 4,289 Posts
    Would seem to me you will need to ask roblox.com if there is a way around their limit of 5 hits.

    We could propose solutions all day and if roblox knows how to block all of our ideas we would accomplish nothing.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #6
    New Coder
    Join Date
    Oct 2013
    Posts
    26
    Thanks
    1
    Thanked 0 Times in 0 Posts
    I see...

    Well roblox.com put that limit there to BREAK the code so people couldn't refresh m.roblox.com/hatid/privatesales over 5 times to view private sales on the MOBILE website.

    My proposed solution is: Because you can refresh unlimited time on www.roblox.com on the hat you would use that site, but I just don't know how to find the data I want. Here's an example:

    http://www.roblox.com/Pieface-Jellyf...em?id=19381787

    That is a LIMITED u face. That means people can sell it (As you can see) for however much they like (Whether someone buys it or not is a different matter) and currently player "smokenchicken" is selling it for R$5,000 (This may change after posting). As oppose to this link:

    http://m.roblox.com/items/19381787/privatesales

    Which ONLY shows the private sales. The current code I have it designed for this page, but if you refresh it multiple times you will see it returns an error.

    Back to the point, I think it is possible to use the first link to make a more complex code to do the same function except find different data (I just don't know how to do it (That's why I need help)).

    Thanks!

  • #7
    New Coder
    Join Date
    Oct 2013
    Posts
    26
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Bump! Just need to know how to select a different bit of data (I think)

  • #8
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,020
    Thanks
    75
    Thanked 4,323 Times in 4,289 Posts
    So create your own proxy server on the server side of your website that accesses the
    http://www.roblox.com/Pieface-Jellyf...em?id=19381787
    page and extracts only the info you need for your web page and then serves it up to your web page. Gets rid of all potential cross site scripting problems at the same time.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #9
    New Coder
    Join Date
    Oct 2013
    Posts
    26
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Okay.. o.O

    That may seem simple to a javascript pro like you, but I understood 0 of that :S

    Make a proxy? No idea how :S and everything else following that doesn't make sense either!

    The solution has been found before, the guy won't tell anyone though.. so I wanted to find out!

    I know I sound demanding and not listening etc, but at skl on my phone posting these takes a while and I can't really make a proxy at school lol

  • #10
    New Coder
    Join Date
    Oct 2013
    Posts
    26
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Sorry I sound needy/beggy, I just really want a solution :S

  • #11
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,020
    Thanks
    75
    Thanked 4,323 Times in 4,289 Posts
    You would create a proxy server in PHP or JSP or ASP code...server side, nothing to do with JavaScript.

    So your JS code would, instead of hitting roblox directly, hit that proxy page on your own server.

    That proxy page would go hit the main page(s) such as
    http://www.roblox.com/Pieface-Jellyf...em?id=19381787
    and then it would either extract the data you need and send it back to your JS code in an easy to use format or it might just send the data unchanged.

    This may not be a trivial task. Certainly if you know nothing about server-side coding it may be beyond you at this time.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #12
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,190
    Thanks
    10
    Thanked 569 Times in 550 Posts
    i would use tampermonkey to run a script on top of the page as viewed in chrome. you can then use chrome to download your data or ship it somewhere else.
    my site (updated 13/9/26)
    BROWSER STATS [% share] (2014/1/19) IE7:0.2, IE8:6.7, IE11:7.4, IE9:3.8, IE10:4.4, FF:18.3, CH:43.6, SF:7.8, MOBILE:27.5

  • #13
    New Coder
    Join Date
    Oct 2013
    Posts
    26
    Thanks
    1
    Thanked 0 Times in 0 Posts
    @Old Pedant, I see where you are going with that but I'm afraid I've never coded or even.attempted coding in any of those 3 languages before.

    @md me has a lazier idea (which is good) using a chrome app to assist me, I wouldn't know what this script would be or how to make it or even the language, but then I also wouldn't know where to make chrome send the info. I'm really new to this.scene, I Story for being such a newbie :/

  • #14
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,190
    Thanks
    10
    Thanked 569 Times in 550 Posts
    Quote Originally Posted by Tomstery View Post
    @md me has a lazier idea (which is good) using a chrome app to assist me, I wouldn't know what this script would be or how to make it or even the language, but then I also wouldn't know where to make chrome send the info. I'm really new to this.scene, I Story for being such a newbie :/
    you use javascript in tampermonkey. the same js that you would use if you owned the page in question, like in post #3.

    as far as finding it on the non-mobile site, use jQuery or document.querySelectorAll() to hit elements using CSS selectors. grab the .value or.innerHTML of the elements, and add it into an output collection.


    you can store your collected values in localStorage or use my download function at http://danml.com/ks/download.js to save a string to the local computer as a file.




    at any rate, it sounds scary and complex when you list it all out, but each step is relatively simple. if you have a question about a specific part of the problem not working after you tried a few things yourself, post the code and we can dig you out of whatever hole you find yourself in.
    my site (updated 13/9/26)
    BROWSER STATS [% share] (2014/1/19) IE7:0.2, IE8:6.7, IE11:7.4, IE9:3.8, IE10:4.4, FF:18.3, CH:43.6, SF:7.8, MOBILE:27.5

  • #15
    New Coder
    Join Date
    Oct 2013
    Posts
    26
    Thanks
    1
    Thanked 0 Times in 0 Posts
    @rnd me I sent you a PM!

    Anyone else found an easier solution? >.<


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •