-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathAutoQueue.lua
More file actions
30 lines (24 loc) · 1.12 KB
/
AutoQueue.lua
File metadata and controls
30 lines (24 loc) · 1.12 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
--[[
Auto Queue for Lmaobox
Author: LNX (github.com/lnx00)
]]
AutoQueue = true
local lastTime = 0
local casualQueue = party.GetAllMatchGroups()["Casual"]
local function Draw_AutoQueue()
if not AutoQueue or gamecoordinator.HasLiveMatch() or gamecoordinator.IsConnectedToMatchServer() or gamecoordinator.GetNumMatchInvites() > 0 then
return
end
if globals.RealTime() - lastTime < 4 then
return
end
lastTime = globals.RealTime()
if #party.GetQueuedMatchGroups() == 0 and not party.IsInStandbyQueue() and party.CanQueueForMatchGroup(casualQueue) == true then
party.QueueUp(casualQueue)
end
end
-- Can't use CreateMove, because it's not called in main menu
callbacks.Unregister("Draw", "Draw_AutoQueue")
callbacks.Register("Draw", "Draw_AutoQueue", Draw_AutoQueue)
engine.Notification("AutoQueue info", "You have just executed the AutoQueue script.\nIf you want to stop it, simply type this into the console:\nlua AutoQueue = false\n\nYou can re-enable AutoQueue again by running the script again or by typing:\nlua AutoQueue = true")
client.Command('play "ui/buttonclick"', true)