-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathSpy.lua
296 lines (234 loc) · 10 KB
/
Spy.lua
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
--This file is part of Game Master Genie.
--Copyright 2011-2014 Chocochaos
--Game Master Genie is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3 of the License.
--Game Master Genie is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
--You should have received a copy of the GNU General Public License along with Game Master Genie. If not, see <http://www.gnu.org/licenses/>.
GMGenie.Spy = {};
GMGenie.Spy.waitingForPin = false;
GMGenie.Spy.pinCache = "";
function GMGenie.Spy.antiCheat(name)
GMGenie.Spy.spy(name);
GMGenie.Spy.antiCheatPlayer();
GMGenie.Hud.toggleVisibility(false);
GMGenie.Spy.appear();
end
function GMGenie.Spy.spy(name)
if not name or string.len(name) < 1 or name == "%t" then
name = UnitName("target");
end
if name and string.len(name) > 1 then
GMGenie.Spy.waitingForPin = true;
GMGenie.Spy.currentRequest = { account = "", accountId = "", class = "", email = "", gmLevel = "", guid = "", guild = "", ip = "", latency = "", level = "", location = "", login = "", money = "", name = "", phase = "", playedTime = "", race = "" };
GMGenie.Spy.clearCache();
GMGenie.Spy.resetBoxes();
GMGenie.Spy.currentRequest["name"] = name;
GMGenie.Spy.clearCache();
SendChatMessage(".pin " .. name, "GUILD");
else
GMGenie.showGMMessage("Please enter a name or make sure you have someone targeted.");
end
end
function GMGenie.Spy.clearCache()
GMGenie.Spy.pinCache = "";
end
function GMGenie.Spy.addToCache(pin)
GMGenie.Spy.pinCache = GMGenie.Spy.pinCache .. pin .. "\n";
end
function GMGenie.Spy.processPin01(offline, name1, guid, pin)
GMGenie.Spy.currentRequest["name"] = name1;
GMGenie.Spy.currentRequest["offline"] = offline;
GMGenie.Spy.currentRequest["guid"] = guid;
GMGenie.Spy.addToCache(pin);
end
function GMGenie.Spy.processPin02(phase, pin)
GMGenie.Spy.currentRequest["phase"] = phase;
GMGenie.Spy.addToCache(pin);
end
function GMGenie.Spy.processPin03(account, accountId, gmLevel, pin)
GMGenie.Spy.currentRequest["account"] = account;
GMGenie.Spy.currentRequest["accountId"] = accountId;
GMGenie.Spy.currentRequest["gmLevel"] = gmLevel;
GMGenie.Spy.addToCache(pin);
end
function GMGenie.Spy.processPin04(login, failedLogins, pin)
GMGenie.Spy.currentRequest["login"] = login;
-- todo failedLogins
GMGenie.Spy.addToCache(pin);
end
function GMGenie.Spy.processPin05(os, latency, pin)
-- todo os
GMGenie.Spy.currentRequest["latency"] = latency;
GMGenie.Spy.addToCache(pin);
end
function GMGenie.Spy.processPin06(email, pin)
GMGenie.Spy.currentRequest["email"] = email;
GMGenie.Spy.addToCache(pin);
end
function GMGenie.Spy.processPin07(ip, locked, pin)
GMGenie.Spy.currentRequest["ip"] = ip;
-- todo locked
GMGenie.Spy.addToCache(pin);
end
function GMGenie.Spy.processPin08(level, pin)
GMGenie.Spy.currentRequest["level"] = level;
GMGenie.Spy.addToCache(pin);
end
function GMGenie.Spy.processPin09(race, class, pin)
GMGenie.Spy.currentRequest["race"] = race;
GMGenie.Spy.currentRequest["class"] = class;
GMGenie.Spy.addToCache(pin);
end
function GMGenie.Spy.processPin10(alive, pin)
-- todo alive
GMGenie.Spy.addToCache(pin);
end
function GMGenie.Spy.processPin11(money, pin)
GMGenie.Spy.currentRequest["money"] = money;
GMGenie.Spy.addToCache(pin);
end
function GMGenie.Spy.processPin12(map, area, zone, pin)
GMGenie.Spy.currentRequest["location"] = map;
if map ~= area then
GMGenie.Spy.currentRequest["location"] = area .. ', ' .. GMGenie.Spy.currentRequest["location"];
end
if string.upper(zone) ~= '<UNKNOWN>' then
GMGenie.Spy.currentRequest["location"] = zone .. ', ' .. GMGenie.Spy.currentRequest["location"];
end
GMGenie.Spy.addToCache(pin);
end
function GMGenie.Spy.processPin13(guild, guildId, pin)
GMGenie.Spy.currentRequest["guild"] = '<' .. guild .. '> (' .. guildId .. ')';
GMGenie.Spy.addToCache(pin);
end
function GMGenie.Spy.processPin14(guildRank, pin)
GMGenie.Spy.currentRequest["guild"] = '"' .. guildRank .. '" of ' .. GMGenie.Spy.currentRequest["guild"];
GMGenie.Spy.addToCache(pin);
end
function GMGenie.Spy.processPin15(note, pin)
-- todo note
GMGenie.Spy.addToCache(pin);
end
function GMGenie.Spy.processPin16(officerNote, pin)
-- todo officerNote
GMGenie.Spy.addToCache(pin);
end
function GMGenie.Spy.processPin17(playedTime, pin)
GMGenie.Spy.currentRequest["playedTime"] = playedTime;
GMGenie.Spy.addToCache(pin);
GMGenie.Spy.waitingForPin = false;
GMGenie.Spy.waitingForMail = true;
Chronos.scheduleByName('mailinpinprotection', 2, GMGenie.Spy.abortWaitingForMail);
GMGenie.Spy.resetBoxes();
GMGenie_Spy_InfoWindow:Show();
end
function GMGenie.Spy.processPin18(read, total, pin)
GMGenie.Spy.addToCache(pin);
GMGenie.Spy.waitingForMail = false;
Chronos.unscheduleByName('mailinpinprotection');
GMGenie.Spy.resetBoxes();
GMGenie_Spy_InfoWindow:Show();
end
function GMGenie.Spy.abortWaitingForMail()
GMGenie.Spy.waitingForMail = false;
end
function GMGenie.Spy.resetBoxes()
GMGenie_Spy_InfoWindow_Info_CharInfo:SetText("Level " .. GMGenie.Spy.currentRequest["level"] .. " " .. GMGenie.Spy.currentRequest["race"] .. " " .. GMGenie.Spy.currentRequest["class"]);
GMGenie_Spy_InfoWindow_Info_Guild:SetText(GMGenie.Spy.currentRequest["guild"]);
GMGenie_Spy_InfoWindow_Title_Text:SetText(GMGenie.Spy.currentRequest["name"]);
GMGenie_Spy_InfoWindow_Character_Name:SetText(GMGenie.Spy.currentRequest["name"]);
GMGenie_Spy_InfoWindow_Character_Id:SetText(GMGenie.Spy.currentRequest["guid"]);
GMGenie_Spy_InfoWindow_Account_Name:SetText(GMGenie.Spy.currentRequest["account"]);
GMGenie_Spy_InfoWindow_Account_Id:SetText(GMGenie.Spy.currentRequest["accountId"]);
GMGenie_Spy_InfoWindow_Email_Email:SetText(GMGenie.Spy.currentRequest["email"]);
GMGenie_Spy_InfoWindow_IpLat_Ip:SetText(GMGenie.Spy.currentRequest["ip"]);
if tonumber(GMGenie.Spy.currentRequest["latency"]) and tonumber(GMGenie.Spy.currentRequest["latency"]) > 1000 then
GMGenie_Spy_InfoWindow_IpLat_Latency:SetFontObject(GenieFontRedSmall);
else
GMGenie_Spy_InfoWindow_IpLat_Latency:SetFontObject(GenieFontHighlightSmall);
end
GMGenie_Spy_InfoWindow_IpLat_Latency:SetText(GMGenie.Spy.currentRequest["latency"]);
GMGenie_Spy_InfoWindow_LastLogin_LastLogin:SetText(GMGenie.Spy.currentRequest["login"]);
GMGenie_Spy_InfoWindow_PlayedGM_PlayedTime:SetText(GMGenie.Spy.currentRequest["playedTime"]);
GMGenie_Spy_InfoWindow_PlayedGM_GM:SetText(GMGenie.Spy.currentRequest["gmLevel"]);
GMGenie_Spy_InfoWindow_MoneyPhase_Money:SetText(GMGenie.Spy.currentRequest["money"]);
GMGenie_Spy_InfoWindow_MoneyPhase_Phase:SetText(GMGenie.Spy.currentRequest["phase"]);
GMGenie_Spy_InfoWindow_Location_Location:SetText(GMGenie.Spy.currentRequest["location"]);
GMGenie_Spy_InfoWindow_Location_Location:SetCursorPosition(0);
end
function GMGenie.Spy.loadDropdown(_, level)
local info = UIDropDownMenu_CreateInfo();
info.hasArrow = false;
info.notCheckable = true;
info.text = 'Ban Info';
info.func = GMGenie.Spy.banInfo;
UIDropDownMenu_AddButton(info, level);
local info = UIDropDownMenu_CreateInfo();
info.hasArrow = false;
info.notCheckable = true;
info.text = 'Lookup Player';
info.func = GMGenie.Spy.lookupPlayer;
UIDropDownMenu_AddButton(info, level);
end
SLASH_SPY1 = "/spy";
SlashCmdList["SPY"] = GMGenie.Spy.spy;
function GMGenie.Spy.copyPin()
GMGenie.showGMMessage(GMGenie.Spy.pinCache);
end
function GMGenie.Spy.whisper()
ChatFrame_SendTell(GMGenie.Spy.currentRequest["name"]);
end
function GMGenie.Spy.summon()
GMGenie.Macros.summon(GMGenie.Spy.currentRequest["name"]);
end
function GMGenie.Spy.appear()
GMGenie.Macros.appear(GMGenie.Spy.currentRequest["name"]);
end
function GMGenie.Spy.revive()
GMGenie.Macros.revive(GMGenie.Spy.currentRequest["name"]);
end
function GMGenie.Spy.freeze()
GMGenie.Macros.freeze(GMGenie.Spy.currentRequest["name"]);
end
function GMGenie.Spy.unfreeze()
GMGenie.Macros.unfreeze(GMGenie.Spy.currentRequest["name"]);
end
function GMGenie.Spy.rename()
GMGenie.Macros.rename(GMGenie.Spy.currentRequest["name"]);
end
function GMGenie.Spy.antiCheatPlayer()
GMGenie.Macros.antiCheatPlayer(GMGenie.Spy.currentRequest["name"]);
end
function GMGenie.Spy.customize()
GMGenie.Macros.customize(GMGenie.Spy.currentRequest["name"]);
end
function GMGenie.Spy.changefaction()
GMGenie.Macros.changefaction(GMGenie.Spy.currentRequest["name"]);
end
function GMGenie.Spy.changerace()
GMGenie.Macros.changerace(GMGenie.Spy.currentRequest["name"]);
end
function GMGenie.Spy.banInfo()
CloseDropDownMenus()
SendChatMessage(".baninfo account " .. GMGenie.Spy.currentRequest["account"], "GUILD");
SendChatMessage(".baninfo character " .. GMGenie.Spy.currentRequest["name"], "GUILD");
SendChatMessage(".baninfo ip " .. GMGenie.Spy.currentRequest["ip"], "GUILD");
end
function GMGenie.Spy.lookupPlayer()
CloseDropDownMenus()
SendChatMessage(".lookup player account " .. GMGenie.Spy.currentRequest["account"], "GUILD");
SendChatMessage(".lookup player email " .. GMGenie.Spy.currentRequest["email"], "GUILD");
SendChatMessage(".lookup player ip " .. GMGenie.Spy.currentRequest["ip"], "GUILD");
end
local Saved_SetItemRef = SetItemRef;
function SetItemRef(link, text, button, chatFrame)
if (strsub(link, 1, 9) == "anticheat") then
local _, name = strsplit(":", link);
if (button == "LeftButton") then
GMGenie.Spy.antiCheat(name);
elseif (button == "RightButton") then
FriendsFrame_ShowDropdown(name, 1);
end
return;
end
Saved_SetItemRef(link, text, button, chatFrame);
end