您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
This script can be used on Mixify.com while streaming your DJ set. The main reason why I created this script is that I couldn't see every single person who enters the stream so I thought it could be nice if script can annonce in chat who entered the stream with a warm welcome message.
当前为
// ==UserScript== // @name Fic's Mixify Auto Welcome Script // @namespace Booth // @include http://www.mixify.com/*/live/* // @version 1 // @grant none // @description This script can be used on Mixify.com while streaming your DJ set. The main reason why I created this script is that I couldn't see every single person who enters the stream so I thought it could be nice if script can annonce in chat who entered the stream with a warm welcome message. // ==/UserScript== var session = []; /* List of all users that entered the stream */ var DJ = $("#marqueeTitle")[0].innerHTML.replace('</h1>', '').replace('<h1>', '').trim(); /*Currnt DJ name*/ var me = $("ul#userDropDown li:eq(2) a").text().trim(); /* Your name on Mixify */ /* If you are on your own stream script is running */ if (me === DJ) { session.push(DJ); setInterval( /* Calling AJAX that is called my hovering mouse over attendees icon */ function () { $("#specatorsDockItem").mousemove(); setTimeout( function () { $("#specatorsDockItem").mouseout(); }, 500); var users = document.getElementsByClassName("username"); for (i = 0; i < users.length; i++) { if (users[i].getAttribute("target") !== null && users[i].innerHTML != "Guest" && jQuery.inArray(users[i].innerHTML.trim(), session) === -1) { /* Ignore duplicates and guests */ console.log("New guest is: " + users[i].innerHTML); $("#chat_input").val("Welcome " + users[i].innerHTML.trim() + "!"); /* Post welcome msg in chat */ $('#chat_input').focus().trigger(jQuery.Event('keydown', { keyCode: 13 })); session.push(users[i].innerHTML.trim()); /* Mark user as the one that already visited the stream */ } } }, 5000); /* Check for new guests every 5 seconds (Change 5000 ms to any other value you want) */ }