Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Roblox Character Grabber
- // @namespace swoodgrommets
- // @description For grabbing OBJ and MTL of roblox characters automatically
- // @include http://web.roblox.com/*
- // @include web.roblox.com/*
- // @include http://www.roblox.com/*
- // @include www.roblox.com/*
- // @exclude http://www.roblox.com/userads/*
- // @exclude http://web.roblox.com/userads/*
- // @exclude www.roblox.com/userads/*
- // @exclude web.roblox.com/userads/*
- // @version 2
- // @grant none
- // ==/UserScript==
- var new_button;
- console.log("Script Running");
- new_button = document.createElement("a");
- new_button.id = "DownloadOBJ";
- new_button.href = "";
- new_button.innerHTML = "Download OBJ<br>";
- new_buttons = document.createElement("a");
- new_buttons.id = "DownloadMTL";
- new_buttons.href = "";
- new_buttons.innerHTML = "Download MTL<br>";
- function xmlst(urls) {
- var xmlhttp = new XMLHttpRequest();
- xmlhttp.onreadystatechange = function() {
- if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
- var myArr = JSON.parse(xmlhttp.responseText);
- new_button.href = myArr.Url;
- document.getElementsByClassName("container-list profile-avatar")[0].insertBefore(new_buttons,document.getElementsByClassName("container-list profile-avatar")[0].firstChild);
- document.getElementsByClassName("container-list profile-avatar")[0].insertBefore(new_button,document.getElementsByClassName("container-list profile-avatar")[0].firstChild);
- }
- }
- xmlhttp.open("GET", "http://web.roblox.com/thumbnail/resolve-hash/" + urls, true);
- xmlhttp.send();
- }
- function xmlst2(urls) {
- var xmlhttp = new XMLHttpRequest();
- xmlhttp.onreadystatechange = function() {
- if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
- var myArr = JSON.parse(xmlhttp.responseText);
- new_buttons.href = myArr.Url;
- }
- }
- xmlhttp.open("GET", "http://web.roblox.com/thumbnail/resolve-hash/" + urls, true);
- xmlhttp.send();
- }
- function xmlst3(urls,swood,new_buttonss) {
- console.log("XML Stage 3");
- var xmlhttp = new XMLHttpRequest();
- xmlhttp.onreadystatechange = function() {
- if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
- var myArr = JSON.parse(xmlhttp.responseText);
- new_buttonss[swood].href = myArr.Url;
- console.log(myArr.Url);
- document.getElementsByClassName("container-list profile-avatar")[0].insertBefore(new_buttonss[swood],document.getElementsByClassName("col-sm-6 profile-avatar-left")[0].previousSibling.previousSibling);
- }
- }
- xmlhttp.open("GET", "http://web.roblox.com/thumbnail/resolve-hash/" + urls, true);
- xmlhttp.send();
- }
- function xmlstwo(urls) {
- console.log("XML Stage 2");
- var xmlhttp = new XMLHttpRequest();
- xmlhttp.onreadystatechange = function() {
- console.log("XML Stage 2.5" + xmlhttp.readyState + " " + xmlhttp.status)
- if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
- var myArr = JSON.parse(xmlhttp.responseText);
- xmlst(myArr.obj);
- xmlst2(myArr.mtl);
- var new_buttonss = myArr.textures.slice(0);
- console.log("WHY IS THIS NOT WORKING");
- for (i = 0; i < myArr.textures.length; i++) {
- console.log(new_buttonss[i]);
- new_buttonss[i] = document.createElement("a");
- new_buttonss[i].id = "DownloadTex" + i;
- new_buttonss[i].href = "";
- new_buttonss[i].innerHTML = "Download Texture " + (i + 1) + "<br>";
- xmlst3(myArr.textures[i],i,new_buttonss);
- }
- }
- }
- xmlhttp.open("GET", urls, true);
- xmlhttp.send();
- }
- function xmls(urls) {
- console.log("XML Stage 1");
- var xmlhttp = new XMLHttpRequest();
- xmlhttp.onreadystatechange = function() {
- if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
- var myArr = JSON.parse(xmlhttp.responseText);
- xmlstwo(myArr.Url);
- }
- }
- xmlhttp.open("GET", "http://web.roblox.com" + urls, true);
- xmlhttp.send();
- }
- var jsons;
- jsons = document.getElementsByClassName("thumbnail-span")[0].getAttribute("data-3d-url");
- console.log("XML Stage 0");
- xmls(jsons);
Add Comment
Please, Sign In to add comment