Classes
c_input

c_input

Functions

set_cursor_position

Change the cursor position on screen.

ArgumentTypeRequired
positionvec2+
g_input:set_cursor_position(vec2:new(50, 50))

get_cursor_position

Get the current cursor position.

ArgumentTypeRequired
returnsvec2
local pos = g_input:get_cursor_position()
 
print("vec2(" .. pos.x .. ", " .. pos.y .. " )")

send_key_event

Send a key event to the game.

ArgumentTypeRequired
keye_key+
statee_key_state+
g_input:send_key_event(e_key.space, e_key_state.key_down)
g_input:send_key_event(e_key.space, e_key_state.key_up)

send_mouse_key_event

Send a mouse key event to the game.

ArgumentTypeRequired
mouse_buttone_mouse_button+
statee_key_state+
g_input:send_mouse_key_event(e_mouse_button.left, e_key_state.key_down)
g_input:send_mouse_key_event(e_mouse_button.left, e_key_state.key_up)

issue_order_move

Call leagues internal move command.

ArgumentTypeRequired
positionvec3+
returnsboolean
g_input:issue_order_move(g_local.position)

issue_order_attack

Call leagues internal attack command.

ArgumentTypeRequired
objectc_object+
returnsboolean

or

ArgumentTypeRequired
network_idnumber+
returnsboolean
local target = features.target_selector:get_default_target()
 
if target ~= nil then
  g_input:issue_order_attack(target)
end

cast_spell

Call leagues internal cast spell command.

ArgumentTypeRequired
slote_spell_slot+
objectc_object+
endvec3+
returnsboolean

or

ArgumentTypeRequired
slote_spell_slot+
positionvec3+
endvec3+
returnsboolean

or

ArgumentTypeRequired
slote_spell_slot+
network_idnumber+
endvec3+
returnsboolean
local target = features.target_selector:get_default_target()
 
if target ~= nil then
  g_input:cast_spell(e_spell_slot.q, target)
end

release_chargeable

Release a chargable spell.

ArgumentTypeRequired
slote_spell_slot+
positionvec3+
returnsboolean
local cast_start = -1.0
local channeling_q = false
 
cheat.on("feature.run", function()
    local target = features.target_selector:get_default_target()
 
    if target == nil then
        return
    end
 
    if not channeling_q and g_input:cast_spell(e_spell_slot.q) then
        cast_start = g_time
        channeling_q = true
        return
    end
 
    if g_time - cast_start > 0.2 then
        g_input:release_chargeable(e_spell_slot.q, target.position)
        channeling_q = false
    end
end)
 
g_input:release_chargeable(e_spell_slot.q, g_local.position)

is_key_pressed

Check if a key is currently pressed.

ArgumentTypeRequired
keye_key+
returnsboolean
if g_input:is_key_pressed(e_key.space) then
  print("space is pressed")
end

block_cast_spell

Block all cast spell calls until block_cast_spell is called again with should_block = false.

ArgumentTypeRequired
should_blockboolean+

block_issue_order

Block all issue order calls until block_issue_order is called again with should_block = false.

ArgumentTypeRequired
should_blockboolean+

is_cast_spell_blocked

Check if cast spell is currently blocked.

ArgumentTypeRequired
returnsboolean

is_issue_order_blocked

Check if issue order is currently blocked.

ArgumentTypeRequired
returnsboolean

get_cursor_position_game

Get the current cursor position in game.

ArgumentTypeRequired
returnsvec3