Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local quickpeek_key = gui.new_checkbox('Quickpeek key', 'QPK', false)
- quickpeek_key:set_tooltip('Bind it to a key')
- local Shot_fired = 0
- local activated_bool = false
- local position = nil
- local position2 = nil
- local position3 = nil
- local qp_k_used_counter = 0
- local position_checkY = nil
- local position_checkX = nil
- local activated_bool = false
- local m_local = entity_list.get_entity(engine_client.get_local_player())
- local test_render = 0
- local ScreenTestX
- local ScreenTestY
- function on_player_jump(ev)
- -- optional engine_client.exec('say i just jumped')
- end
- function on_shot_fired()
- Shot_fired = 1
- end
- function get_position()
- test_render = 0
- local screenX, screenY = -1, -1
- if not activated_bool then
- activated_bool = true
- position = m_local:get_eye_position()
- position = vec3.new(position.x, position.y, position.z - 65)
- end
- local screenX, screenY = renderer.world_to_screen(position)
- if screenX ~= -1 then
- renderer.rect(screenX -5, screenY -5, screenX + 5, screenY + 5, color.new(120, 81, 169))
- if Shot_fired == 1 then
- --return
- end
- end
- end
- function on_paint()
- local qp_k_used = quickpeek_key:get_value()
- if engine_client.is_ingame() then
- if qp_k_used then
- get_position()
- qp_k_used_counter = 1
- elseif qp_k_used_counter == 1 then --maybe wrong but i am too busy/lazy to check
- --if shot_fired
- position2 = m_local:get_eye_position()
- position2 = vec3.new(position2.x, position2.y, position2.z - 65)
- position_check_before_movement_Y = position.y - position2.y
- position_check_before_movement_X = position.x - position2.x
- on_setup_command(cmd)
- position3 = m_local:get_eye_position()
- position3 = vec3.new(position3.x, position3.y, position3.z - 65)
- position_checkY_after_movement_right_Y = position.y - position3.y
- position_checkX_after_movement_right_X = position.x - position3.x
- if position_check_before_movement_X < position_checkX_after_movement_right_X or position_check_before_movement_Y < position_checkY_after_movement_right_Y then
- --try to move 2x left
- --checking position after moving left, if the position_check is smaller if not move right and then back etc.....
- end
- qp_k_used_counter = 0
- else
- activated_bool = false
- end
- end
- if qp_k_used then
- if Shot_fired == 1 then
- Shot_fired = 0
- end
- end
- end
- function on_setup_command(cmd)
- --error('on_setup_command')
- --cmd:set_button(buttons.right)
- --cmd:unset_button(buttons.right)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement