Classes
c_prediction

c_prediction

Functions

predict

ArgumentTypeRequired
target_indexnumber+
projectile_rangenumber+
projectile_speednumber+
projectile_widthnumber+
delaynumber+
source_positionvec3-
extendboolean-
flagsnumber-
spell_typee_spell_flag-
returnsprediction_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

ArgumentTypeRequired
target_indexnumber+
timenumber+
returnsvec3
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

ArgumentTypeRequired
objectc_objet+
timenumber+
multiple_attacksboolean-
returnsnumber
local predicted = features.prediction:predict_health(minion, 0.25)
 
print("Predicted health is " .. predicted)

minion_in_line

ArgumentTypeRequired
start_posvec3+
end_posvec3+
projectile_widthnumber+
ignored_network_idnumber+
returnsboolean
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

ArgumentTypeRequired
start_posvec3+
end_posvec3+
projectile_widthnumber+
ignored_network_idnumber+
returnsnumber
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

ArgumentTypeRequired
indexnumber+
delaynumber+
predict_multiple_attacksboolean-
returnsnumber