-
Notifications
You must be signed in to change notification settings - Fork 3
/
massinvite.lua
63 lines (59 loc) · 2.38 KB
/
massinvite.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
--name lobby tricks
--desc spams people from looking to play with invites to lobby.
--author sekc
if not eclipse.isInGame() then
panorama.executeScript([[
collectedSteamIDS = [];
collectedSteamIDS.push("123");
]], "CSGOMainMenu")
end
function onUI()
if eclipse.isInGame() then
ui.label("lua only works in lobby.")
return
end
if ui.button("invite all friends") then
panorama.executeScript([[
_PauseMainMenuCharacter();
_NavigateToTab( 'JsInventory', 'mainmenu_inventory' );
var friends = FriendsListAPI.GetCount();
for (var id = 0; id < friends; id++) {
var xuid = FriendsListAPI.GetXuidByIndex(id);
FriendsListAPI.ActionInviteFriend(xuid, "");
}]], "CSGOMainMenu")
end
ui.checkbox("mass invite", "mass invite")
end
local timeToNextInviteSpam = 0
function onDraw()
if eclipse.isInGame() then
return
end
timeToNextInviteSpam = timeToNextInviteSpam - draw.deltaTime()
if ui.getConfigBool("mass invite") and timeToNextInviteSpam < 0 then
timeToNextInviteSpam = 10
panorama.executeScript([[
PartyBrowserAPI.Refresh();
var lobbies = PartyBrowserAPI.GetResultsCount();
for (var lobbyid = 0; lobbyid < lobbies; lobbyid++) {
var xuid = PartyBrowserAPI.GetXuidByIndex(lobbyid);
if (!collectedSteamIDS.includes(xuid)) {
if (collectedSteamIDS.includes('123')) {
collectedSteamIDS.splice(collectedSteamIDS.indexOf('123'), 1);
}
collectedSteamIDS.push(xuid);
$.Msg(`Adding ${xuid} to the collection..`);
}
}
$.Msg(`Mass invite collection: ${collectedSteamIDS.length}`);
collectedSteamIDS.forEach(xuid => {
FriendsListAPI.ActionInviteFriend(xuid, "");
});]], "CSGOMainMenu")
end
end
function onUnload()
panorama.executeScript("massInviteEnabled = false;", "CSGOMainMenu")
end
eclipse.registerHook("UI", onUI)
eclipse.registerHook("draw", onDraw)
eclipse.registerHook("unload", onUnload)