World Language Games - Automation for "Millions" (DEFUNCT)

This script will automatically launch and complete the game "Millions" on World Language Games, while adding a random duration between 1:00 and 3:59, and 0 to 4 wrong guesses. PLEASE NOTE - This script is defunct and was made for an older version of Millions that has since been updated.

  1. // ==UserScript==
  2. // @name World Language Games - Automation for "Millions" (DEFUNCT)
  3. // @license MIT
  4. // @namespace https://github.com/engelthehyp/Automation-for-World-Language-Games
  5. // @version 2.1
  6. // @description This script will automatically launch and complete the game "Millions" on World Language Games, while adding a random duration between 1:00 and 3:59, and 0 to 4 wrong guesses. PLEASE NOTE - This script is defunct and was made for an older version of Millions that has since been updated.
  7. // @author https://www.github.com/engelthehyp
  8. // @match *://wlangames.net/PlayGame.php?Game=Millions4Pts.php*
  9. // @icon https://www.google.com/s2/favicons?domain=wlangames.net
  10. // @grant none
  11. // @run-at document-end
  12. // ==/UserScript==
  13.  
  14. /**
  15. * gotoCongrats() is the command which completes the game.
  16. * It does record the time, so if your teacher sees that you played your games in 0 seconds,
  17. * they would be aufully suspicious. I've fixed this problem.
  18. */
  19.  
  20. (function () {
  21. 'use strict';
  22.  
  23. const wrongGuessCount = getRandomInt(0, 4);
  24. const minutesPlayed = getRandomInt(1, 3);
  25. const secondsPlayed = getRandomInt(0, 59);
  26.  
  27. const timeElementsAndAmounts = {
  28. TotalMins: minutesPlayed,
  29. Minutes: minutesPlayed,
  30. TotalSecs: secondsPlayed,
  31. Seconds: secondsPlayed,
  32. pTimeCenter: formatTime(minutesPlayed, secondsPlayed),
  33. };
  34.  
  35. const element = document.getElementById;
  36.  
  37. document.PlayBingo.JulianTime.value = new Date().getTime();
  38. document.PlayBingo.pGuessLabel.value = String(wrongGuessCount);
  39.  
  40. Object.entries(timeElementsAndAmounts).forEach(
  41. ([id, amount]) => (element(id).value = amount)
  42. );
  43.  
  44. function formatTime(minutes, seconds) {
  45. return `${minutes}:${String(seconds).padStart(2, '0')}`;
  46. }
  47.  
  48. function getRandomInt(min, max) {
  49. min = Math.ceil(min);
  50. max = Math.floor(max);
  51. return Math.floor(Math.random() * (max - min + 1)) + min;
  52. }
  53. })();