您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Play song if object is found
当前为
// ==UserScript== // @name DC - Object_found // @author Unknow // @version 1 // @grant none // @description Play song if object is found // @match https://www.dreadcast.net/Main // @namespace InGame // ==/UserScript== var audioElement = new Audio("https://www.cjoint.com/data3/LLFa7LfRTQD_Guta-Adrenaline.mp3"); $('body').append(audioElement); $("#DC_object_found").prop('volume', '1'); console.log('HELP'); let barreAction = $('span.action.inlineBlock')[0]; var found = false; $(document).ready( function() { function alert_user() { const string = barreAction.innerText; const regex = /Objet trouvé/i if(barreAction.innerText == "Vous êtes en train de fouiller la zone") found = false; if (regex.test(string) && found == false) { audioElement.load(); audioElement.play(); found = true; const Timeout = setTimeout(audioElement.stop(), 3000); } } $(document).ajaxComplete( function(a,b,c) { if(/Check/.test(c.url)) { alert_user(); } }); }); console.log('DC - Object found started');