c_prediction
Functions
predict
Argument | Type | Required |
---|---|---|
target_index | number | + |
projectile_range | number | + |
projectile_speed | number | + |
projectile_width | number | + |
delay | number | + |
source_position | vec3 | - |
extend | boolean | - |
flags | number | - |
spell_type | e_spell_flag | - |
returns | prediction_result_t |
-- Example data from https://forum.slotted.cc/threads/168/
local q_range, q_speed, q_width, q_windup = 710, 2200, 150 / 2, 0.25
local target = features.target_selector:get_default_target()
local q_hit = features.prediction:predict(target.index, q_range, q_speed, q_width, q_windup, g_local.position)
if q_hit.valid then
-- do something with predicted position
g_input:cast_spell(e_spell_slot.q, q_hit.position)
end
predict_default
Argument | Type | Required |
---|---|---|
target_index | number | + |
time | number | + |
returns | vec3 |
local target = features.target_selector:get_default_target()
local predicted = features.prediction:predict_default(target.index, 0.25)
if predicted ~= nil then
print("Predicted position is vec3(" .. predicted.x .. ", " .. predicted.y .. ", " .. predicted.z .. ")")
end
predict_health
Argument | Type | Required |
---|---|---|
object | c_objet | + |
time | number | + |
multiple_attacks | boolean | - |
returns | number |
local predicted = features.prediction:predict_health(minion, 0.25)
print("Predicted health is " .. predicted)
minion_in_line
Argument | Type | Required |
---|---|---|
start_pos | vec3 | + |
end_pos | vec3 | + |
projectile_width | number | + |
ignored_network_id | number | + |
returns | boolean |
local target = features.target_selector:get_default_target()
if target == nil then
return
end
local in_line = features.prediction:minion_in_line(g_local.position, target.position, 40, -1)
if in_line then
return
end
-- cast spell
count_minions_in_line
Argument | Type | Required |
---|---|---|
start_pos | vec3 | + |
end_pos | vec3 | + |
projectile_width | number | + |
ignored_network_id | number | + |
returns | number |
local target = features.target_selector:get_default_target()
if target == nil then
return
end
local minions_in_line = features.prediction:count_minions_in_line(g_local.position, target.position, 40, -1)
print("There are " .. minions_in_line .. " minions in line")
predict_minion_health
Argument | Type | Required |
---|---|---|
index | number | + |
delay | number | + |
predict_multiple_attacks | boolean | - |
returns | number |