Advertisement
Guest User

Untitled

a guest
Nov 13th, 2023
309
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 2.08 KB | Source Code | 0 0
  1. // ==UserScript==
  2. // @name     rss clicker
  3. // @include  https://rsadnetworkinfo.com/*
  4. // @include  https://rssoftwareinfo.com/*
  5. // @include  https://rsinsuranceinfo.com/*
  6. // @include  https://rshostinginfo.com/*
  7. // @include  https://rseducationinfo.com/*
  8. // @include  https://rsfinanceinfo.com/*
  9. // @grant    GM_addStyle
  10. // @run-at   document-start
  11. // ==/UserScript==
  12.  
  13. (function () {
  14.   "use strict";
  15.  
  16.   function getElement(selector) {
  17.     return document.querySelector(selector);
  18.   }
  19.  
  20.   function waitAndClick(selector, timeout) {
  21.     setTimeout(function() {
  22.       getElement(selector).click();
  23.     }, timeout);
  24.   }
  25.  
  26.   function removeAdbWall() {
  27.     let adb = getElement('img[alt="CHP Adblock Icon"]');
  28.     if (adb) {
  29.       adb = adb.closest('div[class]').className;
  30.       adb = 'div[id^="'.concat(adb.substring(0, 10), '"]');
  31.       getElement(adb).remove();
  32.     }
  33.   }
  34.  
  35. // Unhide the button and captcha
  36.  
  37.   GM_addStyle( `
  38.     div {
  39.       display: block !important;
  40.     } `
  41.   );
  42.  
  43. // End of Unhide
  44.  
  45. var script = document.createElement('script');
  46. script.textContent = 'document.superListener = document.addEventListener;\
  47.  document.addEventListener = function(type, listener, useCapture) {\
  48.  if(type != "contextmenu")\
  49.  document.superListener(type, listener, !!useCapture);\
  50. };';
  51. script.async = false
  52.  
  53. document.head.insertBefore(script, document.head.firstChild)
  54.  
  55. //  document.querySelectorAll("script")[2].remove();
  56.  
  57. // Clicker. After 2 sec, if captcha on page,
  58. // waiting for the captcha to be solved and click button.
  59. // Otherwise, press the button after 3 seconds
  60.  
  61.   setTimeout(function() {
  62.     if (getElement('.iconcaptcha-modal')) {
  63.       removeAdbWall();
  64.       getElement(".iconcaptcha-modal__body-circle").click();
  65.       let interval = setInterval( () => {
  66.       let solved = getElement(".iconcaptcha-modal__body-checkmark");
  67.       if (solved) {
  68.         waitAndClick('div > button', 0);
  69.         clearInterval(interval);
  70.       }}, 3000);
  71.     }
  72.     else {
  73.       waitAndClick('div > button', 3000);
  74.     }
  75.   }, 2000);
  76.  
  77. // End of Clicker
  78.  
  79. })();
  80.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement