haojiegg连点

独创

  1. // ==UserScript==
  2. // @name haojiegg连点
  3. // @namespace http://tampermonkey.net/
  4. // @license No License
  5. // @version 0.3
  6. // @match *://fxg.jinritemai.com/ffa/buyin/dashboard/live/*
  7. // @icon https://www.google.com/s2/favicons?sz=64&domain=juejin.cn
  8. // @grant none
  9. // @description 独创
  10. // ==/UserScript==
  11. (function() {
  12. 'use strict';
  13. var time = '';
  14. var a = 1;
  15. var t = 0;
  16. var oldI = 1;
  17. var bodys = document.querySelector('body');
  18.  
  19.  
  20. //清除按钮
  21. var dyBtn2 = document.createElement("input");
  22. dyBtn2.id = "btn2";
  23. dyBtn2.style = "font-size:18px;position: fixed;top: 70vh;right: 50px;z-index:9999;";
  24. dyBtn2.type = 'button';
  25. dyBtn2.value = "停止"
  26. dyBtn2.className = 'dyBtn2';
  27.  
  28.  
  29. //停止
  30. dyBtn2.onclick = ()=>{
  31. console.log('停止了')
  32. clearInterval(time)
  33. }
  34.  
  35. bodys.appendChild(dyBtn2);
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42. setTimeout(()=>{
  43. main()
  44.  
  45. //滚动之后自动添加
  46. document.querySelector('#live-control-goods-list-container>div').onscroll = debounce(()=>{
  47. main()
  48.  
  49. },600)
  50.  
  51.  
  52. },5000)
  53.  
  54. //主方法
  55.  
  56. function main(){
  57.  
  58. //链接大div
  59. var domarr = document.querySelectorAll('.goodsItem-KBGOY5');
  60.  
  61. domarr.forEach(function(item){
  62. var autoBtn = document.createElement("input");
  63. autoBtn.type = 'button';
  64. autoBtn.style = "font-size:14px;position: absolute;top: 60px;right: 152px;";
  65. autoBtn.value = "自动讲解"
  66. autoBtn.className = 'autoBtn';
  67.  
  68. item.lastChild.lastChild.appendChild(autoBtn);
  69.  
  70. setTimeout(()=>{
  71. autoBtn.onclick = function(){
  72. console.log(this.previousSibling)
  73. //auoClick(this.previousSibling.firstChild)
  74. auoClick(this.previousSibling.firstChild.parentNode.parentNode.firstChild.firstChild)
  75.  
  76. }
  77. },600)
  78. }
  79. )
  80.  
  81.  
  82. }
  83.  
  84. //自动点击方法
  85. function auoClick(dom){
  86. clearInterval(time);
  87. var douc = () => {
  88.  
  89. if (dom.className.split(" ").indexOf("active") == -1) {
  90. setTimeout(() => {
  91. dom.click();
  92. });
  93. } else {
  94. dom.click();
  95. t = 0;
  96. setTimeout(function() {
  97. dom.click();
  98. }, 2000);
  99. }
  100. };
  101. douc();
  102. time = setInterval(() => {
  103. console.log('开始了')
  104. t++;
  105. if (t >= 17) {
  106. douc();
  107. }
  108. }, 1000);
  109.  
  110. }
  111.  
  112.  
  113.  
  114.  
  115. function debounce(callback,delaytime){
  116. // 定义计时器
  117. let timer=null
  118. return function(){
  119. //如果定时器不是null 则需要重新计时
  120. if (timer!=null) {
  121. clearTimeout(timer)
  122.  
  123. }
  124. //如果定时器还是空 ,则开始倒计时
  125. timer=setTimeout(()=>{
  126. callback&&callback()
  127. }, delaytime)
  128.  
  129. }
  130. }
  131.  
  132.  
  133.  
  134. })();

QingJ © 2025

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