This repository has been archived by the owner on Jun 9, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Mei.lua
112 lines (94 loc) · 2.71 KB
/
Mei.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
tmpSmooth = 0
baseSmooth = 0
AimKey = 0x1
function dst(xm1,xm2) return math.sqrt( (xm2.x-xm1.x)^2+(xm2.y-xm1.y)^2+(xm2.z-xm1.z)^2) end
function TargetSelecter()
local bestFov = Game.Engine:GetFov()
bestBone = 0
bestTarget = Player()
local cnt = Game.Engine:GetPlayerCount()
for i = 0, cnt-1 do
(function()
local player = Game.Engine:GetPlayerAt(i)
if not (player:IsEnemy()) then
return
end
local Health = player:GetHealth()
if (not Health or not (Health:GetLife().y > 0)) then
return
end
if (isheal) then
if ((Health:GetLife().x <= Health:GetLife().y)) then
return
end
end
local out = Math.XMFLOAT2(0, 0)
local Mesh = player:GetMesh()
if (not Mesh) then
return
end
local worldPos = Mesh:GetLocation()
if (not Game.Engine:WorldToScreen(worldPos, out)) then
return
end
local found = Game.Engine:FindBestBone(player, bestFov, player:GetBoneId(2), 1)
-- head 0x11
if (found.bFound) then
bestFov = found.lastFov
bestBone = found.foundBone
bestTarget = player
end
end)()
end
end
function sleep (a) local s=tonumber(os.clock()+a)while(os.clock()<s)do end end
function Aimbot()
local Mesh
local locPos
local Control
local dstAngle
if (Game.Utils.IsKeyPressed(0x1)) then --Only supports Left Key
if (bestBone > 0) then
Mesh = bestTarget:GetMesh()
if (Mesh) then
locPos = Game.Engine:GetViewMatrix():GetCameraVec()
bonePos = Mesh:GetBonePos(bestBone)
local predicted = Math.Predict(locPos, bonePos, Mesh:GetVelocity(), 160, 0)
predicted.y = bonePos.y + (predicted.y - bonePos.y ) * 0.3
Control = Game.Engine:GetController()
dstAngle = Math.LerpVec3(Control:GetAngle(), Math.NormalizeVec3(predicted - locPos), 0.02)
Control:SetAngle(dstAngle)
--sleep(0.001)
end
end
elseif (Game.Utils.IsKeyPressed(0x2)) then --right Key
if (bestBone > 0) then
Mesh = bestTarget:GetMesh()
if (Mesh) then
locPos = Game.Engine:GetViewMatrix():GetCameraVec()
bonePos = Mesh:GetBonePos(bestBone)
local predicted = Math.Predict(locPos, bonePos, Mesh:GetVelocity(), 115, 0)
predicted.y = bonePos.y + (predicted.y - bonePos.y ) * 0.3
Control = Game.Engine:GetController()
dstAngle = Math.LerpVec3(Control:GetAngle(), Math.NormalizeVec3(predicted - locPos), 0.02)
Control:SetAngle(dstAngle)
--sleep(0.001)
end
end
end
end
function OnUpdate()
Game.Engine:SetFov(4)
collectgarbage("collect")
TargetSelecter()
Aimbot()
end
function OnDraw()
collectgarbage("collect")
Game.Renderer:DrawText("UdyrPack - Zarya", 10, 20, 22, 0xFFFFFFFF, false)
end
local Module = {
OnUpdate = OnUpdate,
OnDraw = OnDraw
}
return Module