Created
January 3, 2023 08:17
-
-
Save firecatmusic/1cbddedec1c13bd2ecc4efc4438524b4 to your computer and use it in GitHub Desktop.
a simple lua auto accept invite party for gamesense.pub
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local panorama = panorama.open() | |
local partyBrowserApi = panorama.PartyBrowserAPI | |
local gameApi = panorama.GameStateAPI | |
local competitiveMatchApi = panorama.CompetitiveMatchAPI | |
local partyListApi = panorama.PartyListAPI | |
local friendsListApi = panorama.FriendsListAPI | |
local lobbyApi = panorama.LobbyAPI | |
local labelStart = ui.new_label("LUA", "B", "----------- Derank -----------") | |
local autoAcceptFromCode = ui.new_checkbox("LUA", "B", "Auto Accept From Code") | |
-- local autoInvite = ui.new_checkbox("LUA", "B", "Auto Invite") | |
-- local enable_button = ui.new_button("LUA", "B", "Invite All", function() | |
-- client.log("Started") | |
-- if not competitiveMatchApi.HasOngoingMatch() then | |
-- if gameApi.IsConnectedOrConnectingToServer() then | |
-- client.delay_call(1, function() | |
-- client.exec("disconnect") | |
-- end) | |
-- end | |
-- end | |
-- end) | |
local labelEnd = ui.new_label("LUA", "B", "----------- Derank -----------") | |
local code1 = friendsListApi.GetXuidFromFriendCode("") | |
local code2 = friendsListApi.GetXuidFromFriendCode("") | |
local code3 = friendsListApi.GetXuidFromFriendCode("") | |
local code4 = friendsListApi.GetXuidFromFriendCode("") | |
client.set_event_callback("paint_ui", function() | |
if ( ui.get(autoAcceptFromCode) == true ) then | |
if not competitiveMatchApi.HasOngoingMatch() then | |
for i = 1, partyBrowserApi.GetInvitesCount() do | |
local lobby_id = partyBrowserApi.GetInviteXuidByIndex(i-1) | |
print("inviter: " .. partyBrowserApi.GetPartyMemberXuid(lobby_id, 0)) | |
print("code1: " .. code1) | |
print("code2: " .. code2) | |
print("code3: " .. code3) | |
print("code4: " .. code4) | |
print(partyBrowserApi.GetPartyMemberXuid(lobby_id, 0) == code1 or | |
partyBrowserApi.GetPartyMemberXuid(lobby_id, 0) == code2 or | |
partyBrowserApi.GetPartyMemberXuid(lobby_id, 0) == code3 or | |
partyBrowserApi.GetPartyMemberXuid(lobby_id, 0) == code4 | |
) | |
if gameApi.IsConnectedOrConnectingToServer() then | |
client.delay_call(1, function() | |
client.exec("disconnect") | |
end) | |
end | |
if partyBrowserApi.GetPartyMemberXuid(lobby_id, 0) == code1 or | |
partyBrowserApi.GetPartyMemberXuid(lobby_id, 0) == code2 or | |
partyBrowserApi.GetPartyMemberXuid(lobby_id, 0) == code3 or | |
partyBrowserApi.GetPartyMemberXuid(lobby_id, 0) == code4 then | |
client.delay_call(2, function() | |
partyBrowserApi.ActionJoinParty(lobby_id) | |
end) | |
break | |
end | |
end | |
end | |
end | |
end) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
reference :
https://developer.valvesoftware.com/wiki/CSGO_Panorama_API
https://gamesensical.gitbook.io/docs/