c_input
Functions
set_cursor_position
Change the cursor position on screen.
Argument | Type | Required |
---|---|---|
position | vec2 | + |
g_input:set_cursor_position(vec2:new(50, 50))
get_cursor_position
Get the current cursor position.
Argument | Type | Required |
---|---|---|
returns | vec2 |
local pos = g_input:get_cursor_position()
print("vec2(" .. pos.x .. ", " .. pos.y .. " )")
send_key_event
Send a key event to the game.
Argument | Type | Required |
---|---|---|
key | e_key | + |
state | e_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.
Argument | Type | Required |
---|---|---|
mouse_button | e_mouse_button | + |
state | e_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.
Argument | Type | Required |
---|---|---|
position | vec3 | + |
returns | boolean |
g_input:issue_order_move(g_local.position)
issue_order_attack
Call leagues internal attack command.
Argument | Type | Required |
---|---|---|
object | c_object | + |
returns | boolean |
or
Argument | Type | Required |
---|---|---|
network_id | number | + |
returns | boolean |
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.
Argument | Type | Required |
---|---|---|
slot | e_spell_slot | + |
object | c_object | + |
end | vec3 | + |
returns | boolean |
or
Argument | Type | Required |
---|---|---|
slot | e_spell_slot | + |
position | vec3 | + |
end | vec3 | + |
returns | boolean |
or
Argument | Type | Required |
---|---|---|
slot | e_spell_slot | + |
network_id | number | + |
end | vec3 | + |
returns | boolean |
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.
Argument | Type | Required |
---|---|---|
slot | e_spell_slot | + |
position | vec3 | + |
returns | boolean |
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.
Argument | Type | Required |
---|---|---|
key | e_key | + |
returns | boolean |
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
.
Argument | Type | Required |
---|---|---|
should_block | boolean | + |
block_issue_order
Block all issue order calls until block_issue_order
is called again with should_block = false
.
Argument | Type | Required |
---|---|---|
should_block | boolean | + |
is_cast_spell_blocked
Check if cast spell is currently blocked.
Argument | Type | Required |
---|---|---|
returns | boolean |
is_issue_order_blocked
Check if issue order is currently blocked.
Argument | Type | Required |
---|---|---|
returns | boolean |
get_cursor_position_game
Get the current cursor position in game.
Argument | Type | Required |
---|---|---|
returns | vec3 |