TikTok Live Auto Like and Comment

Automatically clicks the like button and comments "W" on TikTok Live every 45 seconds.

  1. // ==UserScript==
  2. // @name TikTok Live Auto Like and Comment
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.2
  5. // @description Automatically clicks the like button and comments "W" on TikTok Live every 45 seconds.
  6. // @author Loonyatom
  7. // @match *://*.tiktok.com/*/live
  8. // @grant none
  9. // @license MIT
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. const totalClicks = 500; // Total number of likes to send
  16. const clickInterval = 50; // Interval between clicks in milliseconds
  17. const cooldownTime = 15000; // Cooldown time in milliseconds (15 seconds)
  18. const commentInterval = 45000; // Comment every 45 seconds
  19.  
  20. let currentClicks = 0; // Track the number of likes clicked
  21.  
  22. function clickLikeButton() {
  23. const likeButton = document.querySelector('.css-1if2uwl-DivLikeBtnIcon'); // Selector for the like button
  24. if (likeButton && currentClicks < totalClicks) {
  25. likeButton.click();
  26. currentClicks++;
  27.  
  28. // Continue clicking until total clicks are reached
  29. setTimeout(clickLikeButton, clickInterval);
  30. } else if (currentClicks >= totalClicks) {
  31. console.log("Reached 500 likes, cooling down for 15 seconds...");
  32. setTimeout(() => {
  33. currentClicks = 0; // Reset click count after cooldown
  34. clickLikeButton(); // Start clicking again
  35. }, cooldownTime);
  36. } else {
  37. console.log("Like button not found.");
  38. }
  39. }
  40.  
  41. function comment() {
  42. const chatInput = document.querySelector('div[contenteditable="plaintext-only"][placeholder="Say something nice"]'); // Selector for the chat input
  43. if (chatInput) {
  44. chatInput.textContent = "W"; // Set the chat input value to "W"
  45. chatInput.dispatchEvent(new Event('input', { bubbles: true })); // Trigger input event
  46.  
  47. // Simulate pressing Enter to send the comment
  48. const enterEvent = new KeyboardEvent('keydown', {
  49. bubbles: true,
  50. cancelable: true,
  51. key: 'Enter',
  52. code: 'Enter'
  53. });
  54. chatInput.dispatchEvent(enterEvent);
  55. } else {
  56. console.log("Chat input not found.");
  57. }
  58. }
  59.  
  60. function startLoop() {
  61. comment();
  62. setTimeout(startLoop, commentInterval); // Comment every 45 seconds
  63. }
  64.  
  65. // Start the like button clicking and comment loops after a short delay to allow the page to load
  66. setTimeout(() => {
  67. clickLikeButton();
  68. startLoop();
  69. }, 5000); // Wait 5 seconds before starting
  70. })();

QingJ © 2025

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