Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const request = require('request');
- const Request = request;
- const zlib = require("zlib");
- var un = "ace0003"
- var pw = "6KLm4E2014"
- var xsrf;
- var cookie;
- const security_cookie = "_|WARNING:-DO-NOT-SHARE-THIS.--Sharing-this-will-allow-someone-to-log-in-as-you-and-to-steal-your-ROBUX-and-items.|_17364B426C17C33058425588F161D5FE65F03002FF7FCAE4906DD12839C4166D346D3D9A5F4E14212851CDBFA66A6F607769D3BB96C7AAD98CB2DDA07E42C3495EFAA08A3D07504FB9F34EA58189A160A3236AEE6F2EC13ED1B380548B1A44C0BD70059C34AEE00D01679DA0A7F31A2A1595DCEC1DF8704DEF033B9275664DB92D96838B47954720E5445FE6427E0BF4677823628C9C80D25D811F994AD31DA197810E3B128FC1657A9A3FCF8E50A9AB7387C38FBE10A43F1684173EA6F2C554DF4B175ECF46870977B330A2363A571EF1E99EE025CEC89F3E7D060BFC8D6C09D67042EE0EFD95E4CAA8F88D5AF230CBA2E8377FCB40E494367BD4A41C468455128A5191468F6E02EA888BA195A596BCBAC4704AF0B2E64DBD544F4EC84B8888D837E6ED"
- function GetTokenAndBuy() {
- console.log("Logging in. Please wait...");
- request.post("https://api.roblox.com/sign-out/v1", (error, response, body) => {
- if(error) {
- console.log(error);
- return;
- }
- if(!response.headers['x-csrf-token']){
- console.log("ERROR WITH XSRF TOKEN!");
- }
- xsrf = response.headers['x-csrf-token'];
- BuyItem({ AssetId: 1829155983 }, "PZfcOVL/+i3w")
- })
- }
- function Buy(productId, expectedPrice, sellerId, xsrftoken, item, recursive) {
- if (recursive > 1) {
- return;
- }
- xsrftoken = "J3BGdPvGK/Mi";
- Request.post(
- {
- url: `https://www.roblox.com/api/item.ashx?rqtype=purchase&productID=${productId}&expectedCurrency=1&expectedPrice=${expectedPrice}&expectedSellerID=${sellerId}&userAssetID=`,
- method: 'POST',
- encoding: null,
- headers: {
- 'Host': 'www.roblox.com',
- 'Connection': 'keep-alive',
- 'Content-Length': 0,
- 'Accept': '*/*',
- 'Origin': 'https://www.roblox.com',
- 'X-CSRF-TOKEN': xsrf,
- 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36',
- 'Content-Type': 'application/json; charset=utf-8',
- 'Referer': `https://www.roblox.com/catalog/${item.AssetId}/${item.Name}`,
- 'Accept-Encoding': 'gzip, deflate, br',
- 'Accept-Language': 'en-GB,en-US;q=0.9,en;q=0.8,nl;q=0.7',
- 'Cookie': '.ROBLOSECURITY=' + security_cookie
- }
- },
- function (err, res, body) {
- if (err) return console.log("you failed little shit (3)");
- //console.log(res.headers);
- console.log("X-CSRF-TOKEN from last request:", res.headers['x-csrf-token']);
- xsrf = res.headers['x-csrf-token'];
- zlib.gunzip(body, function(err, dezipped) {
- if (dezipped != undefined) {
- var json_string = dezipped.toString('utf-8');
- console.log("Attempt to purchase item. Response: " + json_string);
- } else {
- console.log("Failed to purchase. " + res.statusMessage + " ("+ res.statusCode + ")");
- Buy(productId, expectedPrice, sellerId, xsrftoken, item, recursive + 1)
- }
- });
- console.log("Attempt to purchase item. Response: " + body)
- //console.log("willem check ur inv", body, res.statusCode)
- //console.log(res.headers);
- /*Request.post({
- url: "https://discordapp.com/api/webhooks/529961201099079680/8gVVAj1tGga8DFQI-NlkjHh48gSN-HMJVmnqy7VfnLJHHQg6HfkLKyofKEQ20mI-eQnB",
- method: 'POST',
- formData: {
- "content": `Attempted to buy item.\nItem name: ${item.Name}\nExpected price: ${expectedPrice}\nSeller: https://www.roblox.com/users/${sellerId}/profile\nHTTP Status Code: ${res.statusCode} (${res.statusMessage}\nItem URL: https://www.roblox.com/catalog/${item.AssetId}/${item.Name}`,
- "avatar_url": item.ThumbnailUrl,
- "username": `Item Sniper (res ${res.statusCode})`,
- }
- });*/
- }
- )
- }
- function GetDetails(item) {
- Request(
- {
- url: `https://www.roblox.com/catalog/${item.AssetId}/${item.Name || "willem"}`,
- method: 'GET',
- headers: {
- 'Accept-Charset': 'utf-8'
- }
- },
- function (err, res, body){
- if (err) return console.log("You failed little shit! (2)");
- var jsdom = require("jsdom");
- const { JSDOM } = jsdom;
- const { window } = new JSDOM(body);
- var $ = jQuery = require('jquery')(window);
- let ItemData = $("#item-container").data();
- const expectedPrice = parseInt( ItemData.expectedPrice ) || 0;
- const sellerId = parseInt( ItemData.expectedSellerId ) || 0;
- const productId = parseInt( ItemData.productId ) || 0;
- console.log(expectedPrice)
- Buy(productId, expectedPrice, sellerId, xsrf, item, 0);
- }
- );
- }
- function BuyItem(item, xsrftoken) {
- console.log("X-CSRF-TOKEN", xsrftoken);
- Request.post(
- {
- url: `https://www.roblox.com/api/item.ashx?rqtype=purchase&productID=${productId}&expectedCurrency=1&expectedPrice=${expectedPrice}&expectedSellerID=${sellerId}&userAssetID=`,
- method: 'POST',
- encoding: null,
- headers: {
- 'Host': 'www.roblox.com',
- 'Connection': 'keep-alive',
- 'Content-Length': 0,
- 'Accept': '*/*',
- 'Origin': 'https://www.roblox.com',
- 'X-CSRF-TOKEN': xsrftoken,
- 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36',
- 'Content-Type': 'application/json; charset=utf-8',
- 'Referer': `https://www.roblox.com/catalog/${item.AssetId}/${item.Name}`,
- 'Accept-Encoding': 'gzip, deflate, br',
- 'Accept-Language': 'en-GB,en-US;q=0.9,en;q=0.8,nl;q=0.7',
- 'Cookie': 'GuestData=UserID=-1491175195; gig_hasGmid=ver2; _ga=GA1.2.232860733.1539263602; RBXcb=11; RBXSource=rbx_acquisition_time=12/16/2018 9:18:45 AM&rbx_acquisition_referrer=&rbx_medium=Direct&rbx_source=&rbx_campaign=&rbx_adgroup=&rbx_keyword=&rbx_matchtype=&rbx_send_info=1; PCWARS_OPEN=0; RBXEventTrackerV2=CreateDate=12/26/2018 6:44:16 AM&rbxid=106739906&browserid=32090297579; _gid=GA1.2.79550314.1546003951; __utmz=200924205.1546346422.126.20.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=(not%20provided); __utma=200924205.232860733.1539263602.1546355545.1546418325.128; __utmc=200924205; gig_canary=false; gig_canary_ver=2155-1-25773600; .ROBLOSECURITY=' + security_cookie
- }
- },
- function (err, res, body) {
- if (err) return console.log("you failed little shit (3)");
- zlib.gunzip(body, function(err, dezipped) {
- if (dezipped != undefined) {
- var json_string = dezipped.toString('utf-8');
- console.log("Attempt to purchase item. Response: " + json_string);
- } else {
- console.log("Failed to purchase. " + res.statusMessage + " ("+ res.statusCode + ")");
- }
- });
- console.log("Attempt to purchase item. Response: " + body)
- //console.log("willem check ur inv", body, res.statusCode)
- //console.log(res.headers);
- /*Request.post({
- url: "https://discordapp.com/api/webhooks/529961201099079680/8gVVAj1tGga8DFQI-NlkjHh48gSN-HMJVmnqy7VfnLJHHQg6HfkLKyofKEQ20mI-eQnB",
- method: 'POST',
- formData: {
- "content": `Attempted to buy item.\nItem name: ${item.Name}\nExpected price: ${expectedPrice}\nSeller: https://www.roblox.com/users/${sellerId}/profile\nHTTP Status Code: ${res.statusCode} (${res.statusMessage}\nItem URL: https://www.roblox.com/catalog/${item.AssetId}/${item.Name}`,
- "avatar_url": item.ThumbnailUrl,
- "username": `Item Sniper (res ${res.statusCode})`,
- }
- });*/
- }
- )
- }
- /* FUNCTION BELOW NOT WORKING: NEED TO WAIT FOR LOGIN CAPTCHA BYPASS! */
- function login(username, password) {
- console.log("Logging in. Please wait...");
- request.post("https://api.roblox.com/sign-out/v1", (error, response, body) => {
- if(error) {
- console.log(error);
- return;
- }
- if(!response.headers['x-csrf-token']){
- console.log("ERROR WITH XSRF TOKEN!");
- }
- xsrf = response.headers['x-csrf-token'];
- var post = JSON.stringify({
- "ctype": "Username",
- "cvalue": username,
- "password": password
- });
- //post = "username=" + username + "&password=" + password; //comment out this line if you're using auth.roblox.com instead of api.roblox.com
- request.post("https://auth.roblox.com/v2/login", {
- body: post,
- //proxy: "https://176.192.110.66:45781",
- /*formData: {
- "username": username,
- "password": password
- },*/
- //proxy: pr,
- headers: {
- "Content-Type": "text/json",
- "Connection": "keep-alive",
- "Content-Length": post.length,
- "Accept": "application/json, text/plain, */*",
- "Origin": "https://www.roblox.com",
- "Referer": "https://www.roblox.com/Login",
- "Accept-Encoding": "gzip, deflate, br",
- "User-agent": "Roblox/WinInet",
- "X-CSRF-TOKEN": xsrf,
- }
- }, (error, response, body) => {
- if(error) {
- console.log(error);
- return;
- }
- console.log("X-CSRF-TOKEN from last request:", response.headers['x-csrf-token']);
- if(response.statusCode == 200) {
- cookie = response.headers['set-cookie'][0].split(";")[0];
- console.log("Successfull request!");
- request.post("https://api.roblox.com/sign-out/v1", {
- headers: {
- "Connection": "keep-alive",
- "Accept": "application/json, text/plain, */*",
- "Origin": "https://www.roblox.com",
- "Content-Type": "application/json;charset=UTF-8",
- "Referer": "https://www.roblox.com/Login",
- "Accept-Encoding": "gzip, deflate, br",
- "User-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36",
- "Cookie": cookie
- }
- }, (error, response, body) => {
- if(!response.headers['x-csrf-token']){
- console.log("ERROR WITH XSRF TOKEN!");
- }
- xsrf = response.headers['x-csrf-token'];
- //askMode();
- })
- } else {
- console.log("Failed to login!");
- console.log(response.statusCode, response.statusMessage);
- console.log(body);
- }
- })
- })
- }
- GetDetails({ AssetId: 1639361 });
- //GetTokenAndBuy()
- //BuyItem(1829155983, )
- //login(un, pw);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement