-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathanonymizer.js
More file actions
153 lines (142 loc) · 5.81 KB
/
anonymizer.js
File metadata and controls
153 lines (142 loc) · 5.81 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
// ==UserScript==
// @name Anonymizer
// @namespace NyaggerSquad
// @icon https://i.imgur.com/LeIOXEm.png
// @version 1.11
// @description Press ctrl to Why
// @author anon
// @include https://mahjongsoul.game.yo-star.com/
// @include https://game.mahjongsoul.com/
// @include https://majsoul.union-game.com/0/
// ==/UserScript==
(function() {
'use strict'
var NAME = "";
var TITLE = 600001;
var RANK = 10101;
var RANK3 = 20101;
var HEAD = 0;//400101;
var KEY = 17;
var USE_TOGGLE = false;
var ready = true;
var down = false;
var toggle = false;
document.addEventListener('keydown', function(e) {
e = e || window.event;
if ((e.keyCode == KEY || e.key == KEY) && ready && !down){
if (!USE_TOGGLE)
Anonymize(true);
}
}, true);
document.addEventListener('keyup', function(e) {
e = e || window.event;
if ((e.keyCode == KEY || e.key == KEY) && ready){
Anonymize(false);
}
}, true);
var WinNameBeautifulHack = "";
function Anonymize(check){
if (USE_TOGGLE){
toggle = !toggle;
check = toggle;
}
let uiscene = 0;
function checkScene(scene){
return scene && ((scene.Inst && scene.Inst._enable) || (scene._Inst && scene._Inst._enable))
}
if (checkScene(uiscene=uiscript.UI_Lobby)){
//uiscene.Inst.top.label_name.text = NAME;
//uiscene.Inst.top.name.text = NAME;
uiscene.Inst.top.name._childs[0]._tf.text = NAME;
uiscene.Inst.top.rank.id = RANK;
uiscene.Inst.top.title.id = TITLE;
uiscene.Inst.top.small_rank.id = RANK3;
if (!check) uiscene.Inst.refreshInfo();
}
if (checkScene(uiscene=uiscript.UI_PlayerInfo)){
//uiscene.Inst.name.text = NAME;
//uiscript.UI_PlayerInfo.Inst.container_info.getChildByName("name")
uiscene.Inst.name._childs[0]._tf.text = NAME;
uiscene.Inst.level.exp = 0;
uiscript.UI_PlayerInfo.Inst.detail_data.mj_category==1?uiscene.Inst.level.id = RANK:uiscene.Inst.level.id = RANK3;
uiscene.Inst.title.id = TITLE;
if (!check){
uiscene.Inst.refreshBaseInfo();
uiscript.UI_PlayerInfo.Inst.changeMJCategory(uiscript.UI_PlayerInfo.Inst.detail_data.mj_category);
}
}
if (checkScene(uiscene=uiscript.UI_DesktopInfo)){
for (let i in uiscene.Inst._player_infos){
//uiscene.Inst._player_infos[i].name.text = NAME;
//uiscript.UI_DesktopInfo.Inst._player_infos[0].container.getChildByName("container_name").getChildByName("name")
uiscene.Inst._player_infos[i].name._childs[0]._tf.text = NAME;
uiscene.Inst._player_infos[i].title.id = TITLE;
if (HEAD) uiscene.Inst._player_infos[i].head.id = HEAD;
}
if (!check) uiscene.Inst.refreshSeat();
}
if (checkScene(uiscene=uiscript.UI_GameEnd)){
for (let i in uiscene.Inst.players)
//uiscene.Inst.players[i].label_name.text = NAME;
uiscene.Inst.players[i].name._childs[0]._tf.text = NAME;
if (!check) uiscene.Inst.show();
}
if (checkScene(uiscene=uiscript.UI_ScoreChange)){
for (let i in uiscene.Inst.viewplayers){
//uiscene.Inst.viewplayers[i].txt_name.text = NAME;
uiscene.Inst.viewplayers[i].name._childs[0]._tf.text = NAME;
if (HEAD) uiscene.Inst.viewplayers[i].head.id = HEAD;
}
//if (!check) uiscene.Inst.show(!1);
}
if (checkScene(uiscene=uiscript.UI_FightBegin)){
for (let i in uiscene._Inst.cells){
uiscene._Inst.cells[i].title.id = TITLE;
uiscene._Inst.cells[i].rank.id = RANK;
//uiscene._Inst.cells[i].name.text = NAME;
uiscene._Inst.cells[i].name._childs[0]._tf.text = NAME;
//uiscene._Inst.cells[i].body
}
}
if (checkScene(uiscene=uiscript.UI_Win)){
if (check){
WinNameBeautifulHack = uiscene.Inst.winner_name._childs[0]._tf.text
//uiscene.Inst.label_winner_name.text = NAME;
uiscene.Inst.winner_name._childs[0]._tf.text = NAME;
} else uiscene.Inst.winner_name._childs[0]._tf.text = WinNameBeautifulHack;
//if (!check) uiscene.Inst.show(uiscene.Inst.data, !1);
}
if (checkScene(uiscene=uiscript.UI_WaitingRoom)){
for (let i in uiscene.Inst.players){
//uiscene.Inst.player_cells[i].name.text = NAME;
uiscene.Inst.player_cells[i].name._childs[0]._tf.text = NAME;
uiscene.Inst.player_cells[i].rank.id = RANK;
uiscene.Inst.player_cells[i].title.id = TITLE;
if (!check) uiscene.Inst._refreshPlayerInfo(uiscene.Inst.players[i]);
}
}
down = check;
}
function ToggleCheck() {
var cacheF = uiscript.UIBase.onEnable;
return function(){
console.log(this);
var result = cacheF.apply(this, arguments);
return result;
};
}
var LobbyCheck = setInterval(function(){
if (GameMgr.prototype.EnterLobby){
GameMgr.prototype.EnterLobby = (function() {
var cacheF = GameMgr.prototype.EnterLobby;
return function(){
ready = true;
uiscript.UIBase.onEnable = ToggleCheck;
var result = cacheF.apply(this, arguments);
return result;
};
})();
clearInterval(LobbyCheck);
}
},2000);
})();