Ogame Expeditions Return Notifier

Plays notify sound when expedition returns

  1. // ==UserScript==
  2. // @name Ogame Expeditions Return Notifier
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description Plays notify sound when expedition returns
  6. // @author Alexander Bulgakov
  7. // @match *.ogame.gameforge.com/game/index.php*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=gameforge.com
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. let events = document.querySelectorAll('.eventFleet[data-return-flight="true"][data-mission-type="15"]')
  13.  
  14. let flyArr = []
  15.  
  16. function playSound() {
  17. let audio = document.createElement('audio')
  18. audio.src = 'https://zvukitop.com/wp-content/uploads/2021/03/poluchil-uvedomlenie.mp3?_=27'
  19. audio.play()
  20. delete audio
  21. }
  22.  
  23. if (events.lenght != 0) {
  24. for (let i of events) {
  25. flyArr.push({id: i.id.replace(/\D/g, ''), backTime: +i.dataset.arrivalTime})
  26. }
  27. } else flyArr = []
  28.  
  29. function checkReturn() {
  30. for (let i in flyArr) {
  31. if (new Date(flyArr[i].backTime * 1000).toLocaleString() == new Date(Date.now()).toLocaleString()) {
  32. playSound()
  33. flyArr.splice(i, 1)
  34. }
  35. }
  36. }
  37.  
  38. setInterval(checkReturn, 1000)

QingJ © 2025

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