您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Play song if object is found
- // ==UserScript==
- // @name DC - Object_found
- // @author Unknow
- // @version 1.2
- // @grant none
- // @description Play song if object is found
- // @match https://www.dreadcast.net/Main
- // @namespace InGame
- // ==/UserScript==
- var audioElement = new Audio("https://www.thesoundarchive.com/email/tarzan-screaming.mp3");
- $('body').append(audioElement);
- $("#DC_object_found").prop('volume', '1');
- let barreAction = $('span.action.inlineBlock')[0];
- $(document).ready( function() {
- function alert_user() {
- const string = barreAction.innerText;
- const regex = /Objet trouvé/i
- if (regex.test(string)) {
- audioElement.load();
- audioElement.play();
- 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');