Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local script = {
- menu = { "AA", "Other"}
- }
- function script:call(func, name, ...)
- if func == nil then
- return
- end
- local end_name = name[2] or ""
- if name[1] ~= nil then
- end_name = end_name ~= "" and (end_name .. " ") or end_name
- end_name = end_name .. "\n " .. name[1]
- end
- return func(self.menu[1], self.menu[2], end_name, ...)
- end
- local active = script:call(ui.new_checkbox, { "mn_active", "Manyouall" })
- local picker = script:call(ui.new_color_picker, { "mn_manual_color_picker", "Color picker" }, 130, 156, 212, 255)
- local left_dir = script:call(ui.new_hotkey, { "mn_manual_left", "Left direction" })
- local right_dir = script:call(ui.new_hotkey, { "mn_manual_right", "Right direction" })
- local back_dir = script:call(ui.new_hotkey, { "mn_manual_back", "Backwards direction" })
- local manual_state = script:call(ui.new_slider, { "mn_manual_state", nil }, 0, 3, 0)
- local arrow_dst = script:call(ui.new_slider, { "mn_manual_arrow_distance", nil }, 1, 100, 12, true, "%")
- local picker_inactive = script:call(ui.new_color_picker, { "mn_manual_color_picker_inactive", "Color picker" }, 130, 156, 212, 255)
- local yaw, yaw_num = ui.reference("AA", "Anti-aimbot angles", "Yaw")
- local multi_exec = function(func, list)
- if func == nil then
- return
- end
- for ref, val in pairs(list) do
- func(ref, val)
- end
- end
- local compare = function(tab, val)
- for i = 1, #tab do
- if tab[i] == val then
- return true
- end
- end
- return false
- end
- local bind_system = {
- left = false,
- right = false,
- back = false
- }
- function bind_system:update()
- ui.set(left_dir, "On hotkey")
- ui.set(right_dir, "On hotkey")
- ui.set(back_dir, "On hotkey")
- local m_state = ui.get(manual_state)
- local left_state, right_state, back_state = ui.get(left_dir), ui.get(right_dir), ui.get(back_dir)
- if left_state == self.left and
- right_state == self.right and
- back_state == self.back then
- return
- end
- self.left, self.right, self.back = left_state, right_state, back_state
- if (left_state and m_state == 1) or (right_state and m_state == 2) or (back_state and m_state == 3) then
- ui.set(manual_state, 3)
- return
- end
- if left_state and m_state ~= 1 then
- ui.set(manual_state, 1)
- end
- if right_state and m_state ~= 2 then
- ui.set(manual_state, 2)
- end
- if back_state and m_state ~= 3 then
- ui.set(manual_state, 3)
- end
- end
- local menu_callback = function(e, menu_call)
- local visible = not ui.get(active) -- or (e == nil and menu_call == nil)
- local manual = ui.get(active)
- multi_exec(ui.set_visible, {
- [picker] = not visible and manual,
- [arrow_dst] = not visible and manual,
- [left_dir] = not visible and manual,
- [right_dir] = not visible and manual,
- [back_dir] = not visible and manual,
- [picker] = not visible and manual,
- [manual_state] = false
- })
- end
- client.set_event_callback("setup_command", function(e)
- if not ui.get(active) then
- return
- end
- local direction = ui.get(manual_state)
- local manual_yaw = {
- [0] = direction ~= 0 and "0",
- [1] = -90,
- [2] = 90,
- [3] = 0
- }
- multi_exec(ui.set, {
- [yaw_num] = manual_yaw[direction]
- })
- end)
- client.set_event_callback("round_end", function()
- ui.set(manual_state, 3)
- end)
- client.set_event_callback("shutdown", menu_callback)
- client.set_event_callback("paint", function()
- menu_callback(true, true)
- bind_system:update()
- local me = entity.get_local_player()
- if not entity.is_alive(me) or not ui.get(active) then
- return
- end
- if ui.get(active) then
- local w, h = client.screen_size()
- local r, g, b, a = ui.get(picker)
- local r_1, g_1, b_1, a_1 = ui.get(picker_inactive)
- local m_state = ui.get(manual_state)
- local realtime = globals.realtime() % 3
- local distance = (w/2) / 210 * ui.get(arrow_dst)
- local alpha = math.floor(math.sin(realtime * 8) * (a/2-1) + a/2) or a
- renderer.text(w/2 - distance, h / 2 - 1, r_1, g_1, b_1, a_1, "+c", 0, "<")
- renderer.text(w/2 + distance, h / 2 - 1, r_1, g_1, b_1, a_1, "+c", 0, ">")
- renderer.text(w/2, h / 2 + distance, r_1, g_1, b_1, a_1, "+c", 0, "v")
- if m_state == 1 then
- renderer.text(w/2 - distance, h / 2 - 1, r, g, b, alpha, "+c", 0, "<")
- end
- if m_state == 2 then
- renderer.text(w/2 + distance, h / 2 - 1, r, g, b, alpha, "+c", 0, ">")
- end
- if m_state == 3 then
- renderer.text(w/2, h / 2 + distance, r, g, b, alpha, "+c", 0, "v")
- end
- end
- end)
- menu_callback(active)
- ui.set_callback(active, menu_callback)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement