-
Notifications
You must be signed in to change notification settings - Fork 3
/
lobbytricks.lua
78 lines (68 loc) · 2.69 KB
/
lobbytricks.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
--name lobby tricks
--desc allows for tricks such as spamming popups to your teammates
--author sekc
if not eclipse.isInGame() then
panorama.executeScript([[
disallowQueue = false;
disallowQueueReason = "";
function stopQueue() {
$.Schedule(2, stopQueue);
if (disallowQueue && LobbyAPI.GetMatchmakingStatusString() == "#SFUI_QMM_State_find_searching") {
reason = disallowQueueReason;
if (reason != "") {
PartyListAPI.SessionCommand("Game::ChatReportError", `run all xuid ${MyPersonaAPI.GetXuid()} error #SFUI_QMM_ERROR_${reason}`);
}
LobbyAPI.StopMatchmaking();
}
}
stopQueue()]], "CSGOMainMenu")
end
function onUI()
if eclipse.isInGame() then
ui.label("lua only works in lobby.")
return
end
if ui.button("popup") then
panorama.executeScript([[PartyListAPI.SessionCommand("Game::HostEndGamePlayAgain", "run all xuid ${MyPersonaAPI.GetXuid()}");]], "CSGOMainMenu")
end
if ui.button("spam popups") then
panorama.executeScript([[
function closeAllPopups() {
$.DispatchEvent("CSGOHideMainMenu");
}
for (i = 0; i < 200; i++) {
PartyListAPI.SessionCommand("Game::HostEndGamePlayAgain", "run all xuid ${MyPersonaAPI.GetXuid()}");
}
$.Schedule(2, closeAllPopups);]], "CSGOMainMenu")
end
if ui.button("close all popups") then
panorama.executeScript([[$.DispatchEvent("CSGOHideMainMenu");]], "CSGOMainMenu")
end
ui.separator()
if ui.button("stop matchmaking") then
panorama.executeScript([[LobbyAPI.StopMatchmaking();]], "CSGOMainMenu")
end
ui.checkbox("disallow queue", "disallow queue")
ui.textInput("disallow reason", "reason for disallow")
ui.separator()
ui.textInput("lobby error message", "lobby error message")
if ui.button("send error message") then
panorama.executeScript([[PartyListAPI.SessionCommand("Game::ChatReportError", `run all xuid ${MyPersonaAPI.GetXuid()} error #SFUI_QMM_ERROR_]] .. ui.getConfigStr("lobby error message") .. [[`);]], "CSGOMainMenu")
end
panorama.executeScript([[
disallowQueue = ]] .. (ui.getConfigBool("disallow queue") and "true" or "false") .. [[;
disallowQueueReason = "]] .. ui.getConfigStr("reason for disallow") .. [[";
]], "CSGOMainMenu")
end
function onDraw()
if ui.isMenuOpen() then
ui.beginComplexWindow("custom panorama runner", 0)
ui.textInputMultiline("custom panorama js", "custom panorama js", ui.getCurrentWindowSize().y - 65)
if ui.button("run panorama js") then
panorama.executeScript(ui.getConfigStr("custom panorama js"), "CSGOMainMenu")
end
ui.endWindow()
end
end
eclipse.registerHook("UI", onUI)
eclipse.registerHook("draw", onDraw)