itch to tw for auto inventory

'itch to tw for auto inventory' automatically hits claim on an inventory website 'itch to the tw' in the background in all languages

  1. // ==UserScript==
  2. // @name itch to tw for auto inventory
  3. // @namespace itchToTheTwforAutoInventory
  4. // @version 0.1
  5. // @license MIT
  6. // @description 'itch to tw for auto inventory' automatically hits claim on an inventory website 'itch to the tw' in the background in all languages
  7. // @author DayXP
  8. // @match https://www.twitch.tv/drops/inventory*
  9. // @run-at document-end
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. const refminutes = 5; //refresh the inventory page every x minutes. default = 5
  14. const refseconds = 10; //try to hit claim after the refreshed page in x seconds. default = 10. choose 30-45 for slow computers, avoid go lower than 5.
  15. let buttonText = ['claim now', 'jetzt abholen', 'reclamar ahora', 'en profiter', 'riscuoti subito', 'kiváltás most!', 'claim nu', 'hent nå', 'odbierz teraz',
  16. 'resgatar agora', 'solicită acum', 'vyzdvihnúť teraz', 'lunasta nyt', 'hämta nu', 'nhận ngay', 'Şimdi Al', 'vyzvednout kořist', 'Διεκδίκηση τώρα',
  17. 'Взимане сега', 'Получить сейчас', 'เคลมตอนนี้', '现在领取', '立即領取', '今すぐ入手', '지금 받기'];
  18.  
  19. const IdleTimer = setTimeout(function(){
  20. let items = document.querySelectorAll("[class*='ScCoreButton']");
  21. items.forEach((item) => {
  22. buttonText.forEach((searchText) => {
  23. if (item.innerText.toLowerCase().includes(searchText.toLowerCase())) {
  24. if (item != null) { item.click(); };
  25. }
  26. });
  27. });
  28. items = null;
  29. clearTimeout(IdleTimer);
  30. }, refseconds*1000);
  31. setInterval(function() {
  32. window.location.reload();
  33. }, refminutes*60250);