2024 Blooket Test 2

Add coins and tokens to your Blooket account

  1. // ==UserScript==
  2. // @name 2024 Blooket Test 2
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.2
  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. },
  37. body: JSON.stringify({
  38. coins: coins,
  39. tokens: tokens
  40. })
  41. })
  42. .then(response => response.json())
  43. .then(data => {
  44. if (data.success) {
  45. alert(`${coins} coins and ${tokens} tokens have been added to your account.`);
  46. updateBalanceDisplay(coins, tokens);
  47. } else {
  48. alert("Failed to add coins and tokens. Please try again.");
  49. }
  50. })
  51. .catch(error => {
  52. console.error('Error:', error);
  53. alert("An error occurred. Please try again.");
  54. });
  55. }
  56.  
  57. // Function to update the balance display on the page
  58. function updateBalanceDisplay(coins, tokens) {
  59. // Find the balance display elements and update them
  60. let balanceElement = document.querySelector('.balance'); // Update this selector based on actual page structure
  61. if (balanceElement) {
  62. balanceElement.textContent = `Coins: ${coins}, Tokens: ${tokens}`;
  63. }
  64. }
  65.  
  66. // Run the function when the page loads
  67. addCoinsAndTokens();
  68. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址