forked from Luricz285/GoS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTurnAround.lua
More file actions
66 lines (56 loc) · 2 KB
/
TurnAround.lua
File metadata and controls
66 lines (56 loc) · 2 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
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
if not pcall( require, "Inspired" ) then PrintChat("You are missing Inspired.lua - Go download it and save it Common!") return end
LastMove = 0
Move = false
lastRightClick = {x = nil, y = nil, z = nil}
lastPos = {x = nil, y = nil, z = nil}
PrintChat(" >> TurnAround Script loaded! <<")
OnTick(function(myHero)
if Move == true and GetTickCount() - LastMove > 850 then
IOW.movementEnabled = true
MoveToXYZ(lastRightClick)
Move = false
end
if lastRightClick.x ~= nil then
if math.abs(GetOrigin(myHero).x-lastRightClick.x) <= 75 and math.abs(GetOrigin(myHero).y-lastRightClick.y) <= 75 and math.abs(GetOrigin(myHero).z-lastRightClick.z) <= 75 then
lastRightClick.x = nil
lastRightClick.y = nil
lastRightClick.z = nil
end
if lastPos.x ~= nil and lastPos.x == GetOrigin(myHero).x and lastPos.y == GetOrigin(myHero).y and lastPos.z == GetOrigin(myHero).z then
lastRightClick.x = nil
lastRightClick.y = nil
lastRightClick.z = nil
end
lastPos.x = GetOrigin(myHero).x
lastPos.y = GetOrigin(myHero).y
lastPos.y = GetOrigin(myHero).z
end
end)
OnProcessSpell(function(unit,spell)
if GetTeam(unit) ~= GetTeam(myHero) then
if spell.name == "CassiopeiaPetrifyingGaze" and GetDistance(unit) <= 750 then
IOW.movementEnabled = false
local DodgeThat = Vector(myHero)+(Vector(myHero)-Vector(unit)):normalized()*100
MoveToXYZ(DodgeThat)
if lastRightClick.x ~= nil then
Move = true
LastMove = GetTickCount()
end
end
if spell.name == "MockingShout" and GetDistance(unit) <= 850 then
IOW.movementEnabled = false
local DodgeThat = Vector(myHero)+(Vector(myHero)-Vector(unit)):normalized()*(-100)
MoveToXYZ(DodgeThat)
if lastRightClick.x ~= nil then
Move = true
LastMove = GetTickCount()
end
end
end
end)
OnWndMsg(function(msg,wParam)
if msg == WM_RBUTTONDOWN then
local mousePos = GetMousePos()
lastRightClick = {x = mousePos.x, y = mousePos.y, z = mousePos.z}
end
end)