hyperchromatism - Color test cheat

Cheat in a color test game. Just have fun :D

  1. // ==UserScript==
  2. // @name hyperchromatism - Color test cheat
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description Cheat in a color test game. Just have fun :D
  6. // @author firetree
  7. // @match https://www.webhek.com/post/color-test/
  8. // @icon https://www.webhek.com/favicon.ico
  9. // @grant none
  10. // @license GPL3
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. function findUniqueIndex(list) {
  17. for (let i = 1; i < list.length; i++) {
  18. if (list[i] !== list[i - 1]) {
  19. if (i === 1) {
  20. if (list[1] === list[2]) {
  21. return 0
  22. } else {
  23. return 1
  24. }
  25. } else {
  26. return i
  27. }
  28. }
  29. }
  30. }
  31.  
  32. const box = document.getElementById('box')
  33.  
  34. function solve() {
  35. box.children[findUniqueIndex([...box.children].map(el => el.style.backgroundColor))].click()
  36. }
  37.  
  38. const observer = new MutationObserver(() => setTimeout(() =>solve(), 10))
  39. const config = {childList: true}
  40. observer.observe(box, config)
  41.  
  42. })();

QingJ © 2025

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