local ffi = require 'ffi' local clipboard = require 'gamesense/clipboard' local base64 = require "gamesense/base64" local vector = require "vector" local http = require 'gamesense/http' local path, csgo_files do local fsdll = "filesystem_stdio.dll" local fs = "VFileSystem017" local int_ptr = ffi.typeof("int[1]") local char_buffer = ffi.typeof("char[?]") local function sig_bind(module, interface, signature, typestring) local iface = client.create_interface(module, interface) or error("invalid interface", 2) local instance = client.find_signature(module, signature) or error("invalid signature", 2) local success, typeof = pcall(ffi.typeof, typestring) if not success then error(typeof, 2) end local fnptr = ffi.cast(typeof, instance) or error("invalid typecast", 2) return function(...) return fnptr(iface, ...) end end local add_to_searchpath = vtable_bind("filesystem_stdio.dll", "VFileSystem017", 11, "void(__thiscall*)(void*, const char*, const char*, int)"); local find_next = sig_bind(fsdll, fs, "\x55\x8B\xEC\x83\xEC\x0C\x53\x8B\xD9\x8B\x0D\xCC\xCC\xCC\xCC", "const char*(__thiscall*)(void*, int)") local find_is_directory = sig_bind(fsdll, fs, "\x55\x8B\xEC\x0F\xB7\x45\x08", "bool(__thiscall*)(void*, int)") local find_close = sig_bind(fsdll, fs, "\x55\x8B\xEC\x53\x8B\x5D\x08\x85", "void(__thiscall*)(void*, int)") local find_first = sig_bind(fsdll, fs, "\x55\x8B\xEC\x6A\x00\xFF\x75\x10\xFF\x75\x0C\xFF\x75\x08\xE8\xCC\xCC\xCC\xCC\x5D", "const char*(__thiscall*)(void*, const char*, const char*, int*)") local get_current_directory = sig_bind(fsdll, fs, "\x55\x8B\xEC\x56\x8B\x75\x08\x56\xFF\x75\x0C", "bool(__thiscall*)(void*, char*, int)") local csgo_folder = char_buffer(128) get_current_directory(csgo_folder, ffi.sizeof(csgo_folder)) csgo_folder = ffi.string(csgo_folder) add_to_searchpath(csgo_folder, "", 0) local function get_lua_files() local found_files = {} local fileHandle = int_ptr() local fileName = find_first("*", "", fileHandle) while fileName ~= nil do local conv = ffi.string(fileName) if not find_is_directory(fileHandle[0]) and conv:find('.lua') then table.insert(found_files, conv) end fileName = find_next(fileHandle[0]) end find_close(fileHandle[0]) return found_files end path = csgo_folder csgo_files = get_lua_files() end local menu_c = ui.reference("misc", "settings", "menu color") local menu = {ui.get(menu_c)} local hexed_menu = string.format( '%02x%02x%02x%02x', menu[1], menu[2], menu[3], menu[4] ) local reload_active_scripts = ui.new_button("lua", "b", "Reload active scripts", client.reload_active_scripts) local list_menu = ui.new_listbox("lua", "b", " ", {}) local db = { status = {}, names = {}, loaded = database.read("shh") or { } } local last_click_index = -1 local last_click_time = 0 local lua = {}; function lua.update_list() for _, name in ipairs(csgo_files) do db.status[name] = false table.insert(db.names, name) ui.update(list_menu, db.names) end end lua.update_list() function lua.custom_load(item) local lua_path = path .. "/" .. item if readfile(lua_path) ~= nil then local source = load(readfile(lua_path)) db.loaded[item] = true db.status[item] = true database.write("shh", db.loaded) for i, name in ipairs(db.names) do if name:match(item) then db.names[i] = "\a" .. hexed_menu .. name ui.update(list_menu, db.names) break; end end source() end end function lua.custom_unload(item) db.loaded[item] = nil database.write("shh", db.loaded) db.status[item] = false client.reload_active_scripts() end function lua.click_load() local value = ui.get(list_menu) + 1 if value == nil then return end local curtime = globals.curtime() if last_click_index == value and last_click_time + 0.5 > curtime then local item = ui.get(list_menu, value) + 1 local selected = csgo_files[item] db.status[selected] = not (db.status[selected] or false) if db.status[selected] ~= nil and db.status[selected] == true then lua.custom_load(selected) else lua.custom_unload(selected) end last_click_index = -1 else last_click_index = value last_click_time = curtime end end function lua.automatic_load() for script_name, is_loaded in pairs(db.loaded) do if is_loaded then lua.custom_load(script_name) end end end lua.automatic_load() ui.set_callback(list_menu, lua.click_load) видел что многие плакали, ибо в кряке нет load on startup, и каждый запуск все сбивается. 1. загрузите основную луа 2. в LUA табе появился лист со всеми доступными луа, загрузите вам нужные двойным кликом(запуск-autoload on startup) *На каждом заходе в игру просто запускайте луа скрипт из пункта 1, и все готово ОПАСНОСТЬ!!! Не загружайте в листе луа, которую вы скачали в первом пункте, не загружайте обфусцированные файлы (они могут повлиять на ФПС, либо скрипт попросту не загрузится)