Blooket Token Adder

Adds tokens and XP to your Blooket account (up to 1,000,000 tokens daily)

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Blooket Token Adder
// @namespace    https://github.com/yourusername/blooket-token-adder
// @version      1.0
// @description  Adds tokens and XP to your Blooket account (up to 1,000,000 tokens daily)
// @author       Your Name
// @license      MIT
// @match        https://www.blooket.com/*
// @grant        none
// ==/UserScript==

// Get the player's name by verifying their token
async function getName() {
    const response = await fetch('https://api.blooket.com/api/users/verify-token', {
        method: "GET",
        headers: {
            "accept": "application/json, text/plain, */*",
            "accept-language": "en-US,en;q=0.9,ru;q=0.8",
        },
        credentials: "include"
    });

    if (response.ok) {
        const data = await response.json();
        return data.name;
    } else {
        alert("Error: Unable to retrieve user data.");
        return null;
    }
}

// Function to add tokens and XP
async function addCurrencies() {
    // Ask for the number of tokens the user wants to add
    const tokens = Number(prompt('How many tokens do you want to add to your Blooket account? (Max 1,000,000 tokens daily)'));

    // If the user input is not a valid number
    if (isNaN(tokens) || tokens <= 0) {
        alert("Please enter a valid number of tokens.");
        return;
    }

    // If the tokens are more than 1 million, show an error
    if (tokens > 1000000) {
        alert('You can only add up to 1,000,000 tokens daily.');
        return; // Stop further execution if the limit is exceeded
    }

    // Fetch the user's name
    const name = await getName();
    if (!name) return; // Exit if we couldn't retrieve the user's name

    // Make a request to add tokens and XP
    const response = await fetch('https://api.blooket.com/api/users/add-rewards', {
        method: "PUT",
        headers: {
            "referer": "https://www.blooket.com/",
            "content-type": "application/json",
        },
        credentials: "include",
        body: JSON.stringify({
            addedTokens: tokens,
            addedXp: 300,
            name: name
        })
    });

    // Handle the response from the server
    if (response.status === 200) {
        alert(`${tokens} tokens and 300 XP successfully added to your account!`);
    } else {
        alert('An error occurred while adding tokens. Please try again later.');
    }
}

// Run the function to add currencies
addCurrencies();