您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Plays notify sound when expedition returns
- // ==UserScript==
- // @name Ogame Expeditions Return Notifier
- // @namespace http://tampermonkey.net/
- // @version 1.0
- // @description Plays notify sound when expedition returns
- // @author Alexander Bulgakov
- // @match *.ogame.gameforge.com/game/index.php*
- // @icon https://www.google.com/s2/favicons?sz=64&domain=gameforge.com
- // @grant none
- // ==/UserScript==
- let events = document.querySelectorAll('.eventFleet[data-return-flight="true"][data-mission-type="15"]')
- let flyArr = []
- function playSound() {
- let audio = document.createElement('audio')
- audio.src = 'https://zvukitop.com/wp-content/uploads/2021/03/poluchil-uvedomlenie.mp3?_=27'
- audio.play()
- delete audio
- }
- if (events.lenght != 0) {
- for (let i of events) {
- flyArr.push({id: i.id.replace(/\D/g, ''), backTime: +i.dataset.arrivalTime})
- }
- } else flyArr = []
- function checkReturn() {
- for (let i in flyArr) {
- if (new Date(flyArr[i].backTime * 1000).toLocaleString() == new Date(Date.now()).toLocaleString()) {
- playSound()
- flyArr.splice(i, 1)
- }
- }
- }
- setInterval(checkReturn, 1000)
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址