Greasy Fork is available in English.

虎牙自动领宝箱

定时轮询开箱

  1. // ==UserScript==
  2. // @name 虎牙自动领宝箱
  3. // @namespace https://greasyfork.org/
  4. // @version 2.1
  5. // @description 定时轮询开箱
  6. // @author Cosil
  7. // @include *www.huya.com/*
  8. // ==/UserScript==
  9. $(function() {
  10. var t2 = setInterval(function(){
  11. //console.log("t2 is live");
  12. var box = $(".player-box-stat3");
  13. if($(box[5]).parent().children("p")[3].innerHTML == ""){
  14. box.each(function(){
  15. if(this.style.visibility=="visible"){
  16. this.click();
  17. $("#player-box")[0].style.display="none";
  18. }
  19. });
  20. }else{
  21. clearInterval(t2);
  22. console.log("宝箱已领取完毕");
  23. }
  24. }, 10000);
  25. })