Greasy Fork is available in English.

2024 Blooket Test 3

Add coins and tokens to your Blooket account

  1. // ==UserScript==
  2. // @name 2024 Blooket Test 3
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.3
  5. // @description Add coins and tokens to your Blooket account
  6. // @author You
  7. // @match https://dashboard.blooket.com/*
  8. // @grant none
  9. // @license MIT
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. // Function to add coins and tokens
  16. function addCoinsAndTokens() {
  17. // Prompt user for the number of coins and tokens
  18. let coins = prompt("Enter the number of coins you want to add:", "1000000");
  19. let tokens = prompt("Enter the number of tokens you want to add:", "1000000");
  20.  
  21. // Parse the input values to integers
  22. coins = parseInt(coins, 10);
  23. tokens = parseInt(tokens, 10);
  24.  
  25. // Check if the inputs are valid numbers
  26. if (isNaN(coins) || isNaN(tokens)) {
  27. alert("Please enter valid numbers.");
  28. return;
  29. }
  30.  
  31. // Make an HTTP request to update the user's balance
  32. fetch('https://dashboard.blooket.com/api/updateBalance', {
  33. method: 'POST',
  34. headers: {
  35. 'Content-Type': 'application/json',
  36. 'Authorization': 'Bearer YOUR_AUTH_TOKEN' // Replace with your actual auth token
  37. },
  38. body: JSON.stringify({
  39. coins: coins,
  40. tokens: tokens
  41. })
  42. })
  43. .then(response => response.json())
  44. .then(data => {
  45. if (data.success) {
  46. alert(`${coins} coins and ${tokens} tokens have been added to your account.`);
  47. updateBalanceDisplay(coins, tokens);
  48. } else {
  49. alert("Failed to add coins and tokens. Please try again.");
  50. }
  51. })
  52. .catch(error => {
  53. console.error('Error:', error);
  54. alert("An error occurred. Please try again.");
  55. });
  56. }
  57.  
  58. // Function to update the balance display on the page
  59. function updateBalanceDisplay(coins, tokens) {
  60. // Find the balance display elements and update them
  61. let balanceElement = document.querySelector('.balance'); // Update this selector based on actual page structure
  62. if (balanceElement) {
  63. balanceElement.textContent = `Coins: ${coins}, Tokens: ${tokens}`;
  64. } else {
  65. console.warn('Balance display element not found.');
  66. }
  67. }
  68.  
  69. // Run the function when the page loads
  70. addCoinsAndTokens();
  71. })();