腾讯课堂送花脚本(暴力版)

送花脚本,可能会引起老师不快,慎用!

  1. // ==UserScript==
  2. // @name 腾讯课堂送花脚本(暴力版)
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description 送花脚本,可能会引起老师不快,慎用!
  6. // @author shouxh
  7. // @match https://ke.qq.com/webcourse/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. var flowerTime = null;
  13. var sfStatus = false;
  14.  
  15. function _init() {
  16. var sf = document.createElement('button');
  17. sf.type = "button";
  18. sf.classList.add("toolbar-icon");
  19. sf.style.width="70px";
  20. sf.innerText = "开始送花";
  21. setTimeout(() => {
  22. document.querySelector('#toolbar').append(sf);
  23. }, 3000);
  24. sf.onclick = function () {
  25. if (!sfStatus) {
  26. let rate = parseInt(window.prompt('输入送花倍率,建议1-10之间', 1));
  27. if (isNaN(rate)) {
  28. return;
  29. }
  30. sfStatus=!sfStatus;
  31. sf.innerText="停止送花";
  32. sendFlower(rate);
  33. }else{
  34. sfStatus=!sfStatus;
  35. sf.innerText = "开始送花";
  36. clearFlower();
  37. }
  38. }
  39. }
  40. /**
  41. *
  42. * @param {Number} maxCount 最大一次想要送多少朵花,建议1-10之间
  43. */
  44. function sendFlower(maxCount = 1) {
  45. let flower = document.querySelectorAll('#toolbar button.toolbar-icon')[2];
  46. flowerTime = setInterval(() => {
  47. flower.click();
  48. flower.classList.remove("disabled");
  49. for (let i = 0; i < maxCount; i++) {
  50. flower.click();
  51. }
  52. }, 1000);
  53. };
  54.  
  55. /**
  56. *
  57. * 清除送花的脚本
  58. */
  59. function clearFlower() {
  60. if (flowerTime != null) {
  61. clearInterval(flowerTime);
  62. console.warn("送花脚本已停止..");
  63. } else {
  64. return;
  65. }
  66. }
  67.  
  68. window.onload=_init();
  69. })();

QingJ © 2025

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