My Twitch Drop Claimer

automatically clicks the "Claim" button

  1. // ==UserScript==
  2. // @name My Twitch Drop Claimer
  3. // @name:ru My Twitch Drop Claimer
  4. // @namespace http://www.aazone.ru/
  5. // @version 0.7
  6. // @description automatically clicks the "Claim" button
  7. // @description:ru автоматически нажимает кнопку "Получить"
  8. // @author Aaz
  9. // @match https://www.twitch.tv/*
  10. // @match *://*.twitch.tv/*
  11. // @match *://twitch.tv/*
  12. // @icon https://static.twitchcdn.net/assets/favicon-32-d6025c14e900565d6177.png
  13. // @grant none
  14. // ==/UserScript==
  15.  
  16. /* jshint esversion: 6 */
  17. (function() { 'use strict';
  18. const ClaimButtonNames = [
  19. 'Claim', //English
  20. 'Hent', //Dansk
  21. 'Abholen', //Deutsch
  22. 'Reclamar', //Español
  23. 'Obtenir', //Français
  24. 'Riscatta', //Italiano
  25. 'Megszerzés', //Magyar
  26. 'Claimen', //Nederlands
  27. 'Motta', //Norsk
  28. 'Odbierz', //Polski
  29. 'Resgatar', //Português
  30. 'Solicită', //Română
  31. 'Vyzdvihnúť', //Slovenčina
  32. 'Lunasta', //Suomi
  33. 'Hämta', //Svenska
  34. 'Nhận', //Tiếng Việt
  35. 'Al', //Türkçe
  36. 'Vyzvednout', //Čeština
  37. 'Διεκδίκηση', //Ελληνικά
  38. 'Заявяване', //Български
  39. 'Получить', //Русский
  40. 'เคลม', //ภาษาไทย
  41. '领取', //中文 简体
  42. '領取', //中文 繁體
  43. '受け取る', //日本語
  44. '받기', //한국어
  45. ]
  46. const CloseChatRulesButtonName = ['chat-rules-ok-button', ];
  47. var ClaimButtonClass = '';
  48. var CloseChatRulesButtonClass = '';
  49. const GetClass = function (But, PressIt, ignorName) {
  50. let ButtonClass = '';
  51. const yNode = document.querySelectorAll('button');
  52. if (yNode) {
  53. let s = '';
  54. for (let i = 0; i < yNode.length; i++) {
  55. s = '';
  56. if (!ignorName) {
  57. s = yNode.item(i).textContent;
  58. }
  59. if (s == '' && yNode.item(i).attributes[1]) {
  60. s = yNode.item(i).attributes[1].nodeValue;
  61. }
  62. if (s != '' && But.includes(s)) {
  63. ButtonClass = '.' + yNode.item(i).classList.value.replace(/ /ig, '.');
  64. if (PressIt) {
  65. yNode.item(i).click();
  66. console.log('Button "' + s + '" is pressed');
  67. }
  68. break;
  69. }
  70. }
  71. }
  72. return ButtonClass;
  73. }
  74. const GetClaimButton = () => {
  75. if (ClaimButtonClass == '') {
  76. ClaimButtonClass = GetClass(ClaimButtonNames, false, false);
  77. }
  78. if (ClaimButtonClass != '') {
  79. const xNode = document.querySelector(ClaimButtonClass);
  80. if (xNode) {
  81. xNode.click();
  82. console.log('Claim drop button is pressed');
  83. }
  84. }
  85. if (CloseChatRulesButtonClass == '') {
  86. CloseChatRulesButtonClass = GetClass(CloseChatRulesButtonName, true, true);
  87. }
  88. };
  89. setInterval(GetClaimButton, 5000);
  90.  
  91. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址