-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathping.js
More file actions
52 lines (47 loc) · 1.66 KB
/
ping.js
File metadata and controls
52 lines (47 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// ==UserScript==
// @name Invite Beeper
// @namespace NyaggerSquad
// @icon https://i.imgur.com/i6SJdWL.png
// @version 1.0
// @description Konnichiwa
// @author anon
// @grant GM_notification
// @include https://mahjongsoul.game.yo-star.com/
// @include https://game.mahjongsoul.com/
// @include https://game.maj-soul.com/1/
// ==/UserScript==
(function() {
'use strict';
const CHARID = 200007;
const BRAP = "lobby_playerlogin";
const USE_NOTIFICATION = true;
function Beep(){
USE_NOTIFICATION && GM_notification ( {
title: 'Mahjong Soul',
highlight: true,
text: 'You got an invite from '+uiscript.UI_Invite._invites.slice(-1)[0].nickname,
image: 'https://i.imgur.com/i6SJdWL.png',
onclick: () => { event.preventDefault(); parent.focus(); window.focus(); }
} );
let slist = cfg.voice.sound.findGroup(cfg.item_definition.character.get(CHARID).sound)
for (let o = 0; o < slist.length; o++){
if (slist[o].type == BRAP){
view.AudioMgr.PlaySound(slist[o].path, 1.0, null);
break;
}
}
}
var LazyCheck = setInterval(function(){
if (uiscript?.UI_Invite?.onNewInvite){
uiscript.UI_Invite.onNewInvite = (function(){
var cacheF = uiscript.UI_Invite.onNewInvite;
return function(){
var result = cacheF.apply(this, arguments);
Beep();
return result;
};
})();
clearInterval(LazyCheck);
}
},2000);
})();