Advertisement
iradap

Lootfilter w pętli v2

Jun 26th, 2022 (edited)
752
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.57 KB | None | 0 0
  1. // ==UserScript==
  2. // @name         Alkatria lootfilter w pętli v2
  3. // @namespace    http://tampermonkey.net/
  4. // @version      0.2
  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. (function() {
  13.     console.log("Funkcja lootfilter rozpoczeła działanie");
  14.     'use strict';
  15.  
  16.     //Definicja funkcji
  17.  
  18.     function Lootfilter(){
  19.         setTimeout(() => { //żeby dobrze pobrał element
  20.             let buttonSearch = document.getElementsByClassName('logout-button').item(0);
  21.  
  22.             const LookFor = "Tekst"; // Change this to find a different string
  23.             const content = document.body.textContent || document.body.innerText;
  24.             const hasText = content.indexOf(LookFor) !== -1;
  25.  
  26.             if(!hasText) { //jeżeli znalazło szczepionki
  27.  
  28.                 //Lootfilter
  29.                 setTimeout(() => {
  30.                     let Uni1 = document.getElementsByClassName('button-loot-accept button-loot loot-pickup-accept').item(0); //Magiczny Kryształ Rzemieślnika
  31.                     // console.log('Uni1');
  32.                     Uni1.click();
  33.                 }, 0)
  34.             } else { //jeżeli nie znalazło szczepionki
  35.                 //  buttonSearch.click();
  36.                 buttonSearch.click();
  37.             }
  38.         }, 0);
  39.     }
  40.  
  41.     //Uruchamianie skryptu w pętli
  42.     setTimeout(() => {const timerVar = setInterval (function() {Lootfilter(); }, 1000);}, 5000)
  43. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement