Guest User

Untitled

a guest
Jan 14th, 2020
100
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. setInterval(function () {
  2.  
  3. const elements = document.getElementsByClassName("farm_icon_c");
  4.  
  5. if (elements.length === 0)
  6. location.reload();
  7.  
  8. let have = false;
  9. let amount = 0;
  10.  
  11. for (let row in elements) {
  12.  
  13.  
  14. const element = elements[row];
  15.  
  16. if (element.classList && !element.classList.contains("farm_icon_disabled")) {
  17. have = true;
  18. amount++;
  19. element.click();
  20.  
  21. if (+document.getElementById("light").innerHTML === 0)
  22. break;
  23.  
  24. if (amount === 4)
  25. break
  26. }
  27.  
  28. }
  29.  
  30. if (!have)
  31. location.reload();
  32.  
  33.  
  34. }, 5000);
RAW Paste Data