Advertisement
iradap

Komunikat off

Jul 1st, 2022 (edited)
533
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.89 KB | None | 0 0
  1. // ==UserScript==
  2. // @name         Alkatria komunikaty off
  3. // @namespace    http://tampermonkey.net/
  4. // @version      0.1
  5. // @description  try to take over the world!
  6. // @author       You
  7. // @match        https://alkatria.pl/game
  8. // @icon         https://www.google.com/s2/favicons?sz=64&domain=alkatria.pl
  9. // @grant        none
  10. // ==/UserScript==
  11.  
  12. //<div class="small-info-alert vmWoDq-nFAzwF-NqePtr-DxAhVp-Lwibhp-zLegUN small-alert-undefined">Musisz wybrać przeciwnika!</div>
  13.  
  14. (function() {
  15.     console.log("Funkcja Komunikaty Off");
  16.     'use strict';
  17.  
  18.     //Definicja funkcji
  19.  
  20.     function Komunikaty(){
  21.         setTimeout(() => { //żeby dobrze pobrał element
  22.             let buttonSearch = document.getElementsByClassName('logout-button').item(0);
  23.  
  24.             const LookFor = "Tekst"; // Change this to find a different string
  25.             const content = document.body.textContent || document.body.innerText;
  26.             const hasText = content.indexOf(LookFor) !== -1;
  27.  
  28.             if(!hasText) { //jeżeli znalazło szczepionki
  29.  
  30.                 //Uniaty
  31.                 setTimeout(() => {
  32.                     let Komunikat1 = document.getElementsByClassName('small-info-alert').item(0);
  33.                     // console.log('Komunikat1');
  34.                     Komunikat1.click();
  35.                 }, 0)
  36.                 //Hera
  37.                 setTimeout(() => {
  38.                     let Komunikat2 = document.getElementsByClassName('small-info-alert').item(0);
  39.                      //console.log('Epik1');
  40.                     Komunikat2.click();
  41.                 }, 0)
  42.             } else { //jeżeli nie znalazło szczepionki
  43.                 //  buttonSearch.click();
  44.                 buttonSearch.click();
  45.             }
  46.         }, 0);
  47.     }
  48.  
  49.     //Uruchamianie skryptu w pętli
  50.     setTimeout(() => {const timerVar = setInterval (function() {Komunikaty(); }, 101);}, 5000)
  51. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement