twitch auto loot

14.7.2020, 13:40:04

目前为 2021-05-24 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name twitch auto loot
  3. // @namespace Violentmonkey Scripts
  4. // @match https://www.twitch.tv/*
  5. // @grant none
  6. // @version 1.2
  7. // @require https://code.jquery.com/jquery-3.5.1.min.js
  8. // @author -
  9. // @description 14.7.2020, 13:40:04
  10. // ==/UserScript==
  11. var classname = "ScCoreButton-sc-1qn4ixc-0 ScCoreButtonSuccess-sc-1qn4ixc-5 VGQNd";
  12. async function main(){
  13. buttoncounter = 0;
  14. while(true){
  15. secondsPassed = 0;
  16. while(document.getElementsByClassName(classname)[0] == undefined){
  17. await sleep(1000);
  18. secondsPassed++;
  19. console.log("Seconds: " + secondsPassed + " Buttons: " + buttoncounter);
  20. }
  21.  
  22. document.getElementsByClassName(classname)[0].click();
  23. buttoncounter++;
  24. console.log("Button clicked: " + buttoncounter);
  25. await sleep(1000);
  26. }
  27. };
  28.  
  29. function sleep(milliseconds) {
  30. return new Promise(resolve => setTimeout(resolve, milliseconds));
  31. }
  32. $( document ).ready(function() {
  33. main();
  34. console.log("Auto Loot active");
  35. });

QingJ © 2025

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