Wiiplay123

Roblox Character Downloader

Nov 7th, 2015
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name        Roblox Character Grabber
  3. // @namespace   swoodgrommets
  4. // @description For grabbing OBJ and MTL of roblox characters automatically
  5. // @include     http://web.roblox.com/*
  6. // @include web.roblox.com/*
  7. // @include     http://www.roblox.com/*
  8. // @include www.roblox.com/*
  9. // @exclude http://www.roblox.com/userads/*
  10. // @exclude http://web.roblox.com/userads/*
  11. // @exclude www.roblox.com/userads/*
  12. // @exclude web.roblox.com/userads/*
  13. // @version     2
  14. // @grant       none
  15. // ==/UserScript==
  16. var new_button;
  17. console.log("Script Running");
  18. new_button = document.createElement("a");
  19. new_button.id = "DownloadOBJ";
  20. new_button.href = "";
  21. new_button.innerHTML = "Download OBJ<br>";
  22. new_buttons = document.createElement("a");
  23. new_buttons.id = "DownloadMTL";
  24. new_buttons.href = "";
  25. new_buttons.innerHTML = "Download MTL<br>";
  26.  
  27. function xmlst(urls) {
  28. var xmlhttp = new XMLHttpRequest();
  29. xmlhttp.onreadystatechange = function() {
  30.     if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
  31.         var myArr = JSON.parse(xmlhttp.responseText);
  32.         new_button.href = myArr.Url;
  33.        
  34.             document.getElementsByClassName("container-list profile-avatar")[0].insertBefore(new_buttons,document.getElementsByClassName("container-list profile-avatar")[0].firstChild);
  35.    document.getElementsByClassName("container-list profile-avatar")[0].insertBefore(new_button,document.getElementsByClassName("container-list profile-avatar")[0].firstChild);
  36.    
  37.     }
  38. }
  39. xmlhttp.open("GET", "http://web.roblox.com/thumbnail/resolve-hash/" + urls, true);
  40. xmlhttp.send();
  41. }
  42. function xmlst2(urls) {
  43. var xmlhttp = new XMLHttpRequest();
  44. xmlhttp.onreadystatechange = function() {
  45.     if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
  46.         var myArr = JSON.parse(xmlhttp.responseText);
  47.         new_buttons.href = myArr.Url;
  48.     }
  49. }
  50. xmlhttp.open("GET", "http://web.roblox.com/thumbnail/resolve-hash/" + urls, true);
  51. xmlhttp.send();
  52. }
  53. function xmlst3(urls,swood,new_buttonss) {
  54.     console.log("XML Stage 3");
  55. var xmlhttp = new XMLHttpRequest();
  56. xmlhttp.onreadystatechange = function() {
  57.     if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
  58.         var myArr = JSON.parse(xmlhttp.responseText);
  59.         new_buttonss[swood].href = myArr.Url;
  60.         console.log(myArr.Url);
  61.         document.getElementsByClassName("container-list profile-avatar")[0].insertBefore(new_buttonss[swood],document.getElementsByClassName("col-sm-6 profile-avatar-left")[0].previousSibling.previousSibling);
  62.    
  63.          }
  64. }
  65. xmlhttp.open("GET", "http://web.roblox.com/thumbnail/resolve-hash/" + urls, true);
  66. xmlhttp.send();
  67. }
  68. function xmlstwo(urls) {
  69.     console.log("XML Stage 2");
  70. var xmlhttp = new XMLHttpRequest();
  71. xmlhttp.onreadystatechange = function() {
  72.     console.log("XML Stage 2.5" + xmlhttp.readyState + " " + xmlhttp.status)
  73.     if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
  74.         var myArr = JSON.parse(xmlhttp.responseText);
  75.         xmlst(myArr.obj);
  76.         xmlst2(myArr.mtl);
  77.         var new_buttonss = myArr.textures.slice(0);
  78.         console.log("WHY IS THIS NOT WORKING");
  79.         for (i = 0; i < myArr.textures.length; i++) {
  80.             console.log(new_buttonss[i]);
  81.     new_buttonss[i] = document.createElement("a");
  82.            
  83.     new_buttonss[i].id = "DownloadTex" + i;
  84.     new_buttonss[i].href = "";
  85.     new_buttonss[i].innerHTML = "Download Texture " + (i + 1) + "<br>";
  86.         xmlst3(myArr.textures[i],i,new_buttonss);
  87.         }
  88.     }
  89. }
  90. xmlhttp.open("GET", urls, true);
  91. xmlhttp.send();
  92. }
  93. function xmls(urls) {
  94.     console.log("XML Stage 1");
  95. var xmlhttp = new XMLHttpRequest();
  96. xmlhttp.onreadystatechange = function() {
  97.     if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
  98.         var myArr = JSON.parse(xmlhttp.responseText);
  99.         xmlstwo(myArr.Url);
  100.     }
  101. }
  102. xmlhttp.open("GET", "http://web.roblox.com" + urls, true);
  103. xmlhttp.send();
  104. }
  105. var jsons;
  106. jsons = document.getElementsByClassName("thumbnail-span")[0].getAttribute("data-3d-url");
  107. console.log("XML Stage 0");
  108. xmls(jsons);
Add Comment
Please, Sign In to add comment