forked from sirxkilller/PiSeries
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathThreshFastQ.lua
More file actions
119 lines (92 loc) · 3.46 KB
/
Copy pathThreshFastQ.lua
File metadata and controls
119 lines (92 loc) · 3.46 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
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
113
114
115
116
117
118
119
--> ThreshFastQ - by Raspberry Pi <--
local version = "1.03"
local AUTOUPDATE = true
if myHero.charName ~= "Thresh" then return end
require 'Prodiction'
local UPDATE_NAME = "ThreshFastQ"
local UPDATE_HOST = "raw.github.com"
local UPDATE_PATH = "/RankedFire/PiSeries/master/ThreshFastQ.lua".."?rand="..math.random(1,10000)
local UPDATE_FILE_PATH = SCRIPT_PATH..GetCurrentEnv().FILE_NAME
local UPDATE_URL = "https://"..UPDATE_HOST..UPDATE_PATH
function AutoupdaterMsg(msg) print("<font color=\"#6699ff\"><b>"..UPDATE_NAME..":</b></font> <font color=\"#FFFFFF\">"..msg..".</font>") end
if AUTOUPDATE then
local ServerData = GetWebResult(UPDATE_HOST, UPDATE_PATH, "", 5)
if ServerData then
local ServerVersion = string.match(ServerData, "local version = \"%d+.%d+\"")
ServerVersion = string.match(ServerVersion and ServerVersion or "", "%d+.%d+")
if ServerVersion then
ServerVersion = tonumber(ServerVersion)
if tonumber(version) < ServerVersion then
AutoupdaterMsg("New version available"..ServerVersion)
AutoupdaterMsg("Updating, please don't press F9")
DownloadFile(UPDATE_URL, UPDATE_FILE_PATH, function () AutoupdaterMsg("Successfully updated. ("..version.." => "..ServerVersion.."), press F9 twice to load the updated version.") end)
else
AutoupdaterMsg("You have got the latest version ("..ServerVersion..")")
end
end
else
AutoupdaterMsg("Error downloading version info")
end
end
local SpellQ = {Range = 1100, Speed = 1500, Delay = 0.5 , Width = 70 }
local Prodict = nil
local menu = nil
local target = nil
local PiSetUp = false
local QReady = nil
function setupMenu()
menu = scriptConfig("ThreshFastQ", "ThreshFastQ")
menu:addSubMenu("Prediction","pred")
menu.pred:addParam("Prodiction","PROdiction",SCRIPT_PARAM_ONOFF, true)
menu.pred:addParam("hit","Hitchance (2 = recommended)", SCRIPT_PARAM_SLICE, 2, 1, 5, 0)
menu:addSubMenu("Keybindings", "combo")
menu.combo:addParam("active","Combo active",SCRIPT_PARAM_ONKEYDOWN, false, 32)
menu.combo:addParam("sep", "", SCRIPT_PARAM_INFO, "")
menu.combo:addParam("useQ", "Use Q", SCRIPT_PARAM_ONOFF, true)
menu:addSubMenu("Drawings", "Draw")
menu.Draw:addParam("DrawQ", "Draw Q", SCRIPT_PARAM_ONOFF, true)
menu.combo:permaShow("active")
menu.combo:permaShow("useQ")
menu.Draw:permaShow("DrawQ")
end
function OnLoad()
PiSet()
end
function PiSet()
-- Menu
setupMenu()
ts = TargetSelector(TARGET_LESS_CAST_PRIORITY, SpellQ.Range, DAMAGE_PHYISCAL)
ts.name = "Thresh"
menu:addTS(ts)
-- after loading everything fine, printing out that Script did load successfully.
print("<b><font color=\"#00A300\">ThreshFastQ ".. tostring(version)..":</font></b> <font color=\"#FFFFFF\">loaded!</font>")
-- end the set-up
PiSetUp = true
end
function OnTick()
if PiSetUp then
target = ts.target
ts:update()
Checks()
if menu.combo.active then combo() end
end
end
function combo()
if menu.combo.useQ and target and QReady then CastQ(target) end
end
function CastQ(Target)
if menu.pred.Prodiction and ValidTarget(Target,SpellQ.Range) then
local pos, info = Prodiction.GetPrediction(Target, SpellQ.Range, SpellQ.Speed, SpellQ.Delay, SpellQ.Width)
if pos and QReady and target and not info.mCollision() and info.hitchance >= menu.pred.hit then
CastSpell(_Q, pos.x, pos.z)
end
end
end
function Checks()
QReady = (myHero:CanUseSpell(_Q) == READY)
end
function OnDraw()
if menu.Draw.DrawQ then
DrawCircle3D(myHero.x, myHero.y, myHero.z, SpellQ.Range, 1, ARGB(255, 0, 255, 255))
end
end