-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathMapTP.lua
40 lines (33 loc) · 1.2 KB
/
MapTP.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
local GUI = {}
GUI.Teleport = gui.Button(gui.Reference("Misc", "Movement", "Other"), "Teleport", function() GUI.TeleportFn() end)
local pClientState = ffi.cast("uintptr_t**", mem.FindPattern("engine.dll", "A1 ?? ?? ?? ?? 8B 80 ?? ?? ?? ?? C3") + 1)[0][0]
local m_nSignonState = ffi.cast("int*", pClientState + 0x108)
local bPatched = false
local flPatchedTime = 0
local flLastCheckTime = 0
local bShouldTeleport = false
callbacks.Register("Draw", function()
if not bShouldTeleport then return end
if not bPatched then
if common.Time() - flLastCheckTime >= 0.1 then
if m_nSignonState[0] > 5 then
m_nSignonState[0] = 5
bPatched = true
flPatchedTime = common.Time()
end
client.Command("joingame", true)
flLastCheckTime = common.Time()
end
else
if common.Time() - flPatchedTime >= 2.2 then
m_nSignonState[0] = 6
bShouldTeleport = false
end
end
end)
GUI.TeleportFn = function()
client.Command("disconnect", true)
panorama.RunScript("CompetitiveMatchAPI.ActionReconnectToOngoingMatch()")
bShouldTeleport = true
bPatched = false
end