gulper.io fast respawn

Fast respawn on gulper.io

  1. // ==UserScript==
  2. // @name gulper.io fast respawn
  3. // @namespace Violentmonkey Scripts
  4. // @match https://gulper.io/*
  5. // @grant none
  6. // @version 1.0
  7. // @license MIT
  8. // @author illegalsolutions
  9. // @description Fast respawn on gulper.io
  10. // @require https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. var targetNode = document.getElementById('game-stats');
  17. var config = { attributes: true, attributeFilter: ['style'] };
  18.  
  19. var callback = function(mutationsList, observer) {
  20. for(var mutation of mutationsList) {
  21. if (mutation.type == 'attributes') {
  22. var visibility = window.getComputedStyle(targetNode).getPropertyValue('visibility');
  23. if (visibility === 'visible') {
  24. $("#restart-btn").click();
  25. }
  26. }
  27. }
  28. };
  29.  
  30. var observer = new MutationObserver(callback);
  31. observer.observe(targetNode, config);
  32. })();