Помогите с lua скриптом

alessandro.fletcher

Новичок
Автор темы
5
1
Нужно написать lua скрипт. Суть его такова: У тебя закрывается Самп когда афк достигает 880-900 секунд. По возможности добавте предупреждение типа: Афк достигло 800 секунд через 100 секунд игра будет закрыта. Благодарю
 

ChromiusJ

Известный
Друг
4,816
3,122
Нужно написать lua скрипт. Суть его такова: У тебя закрывается Самп когда афк достигает 880-900 секунд. По возможности добавте предупреждение типа: Афк достигло 800 секунд через 100 секунд игра будет закрыта. Благодарю
за такое люди деньги платят,чтобы написать,поэтому просто так никто бы не сделал его
 
  • Нравится
Реакции: YarikVL

alessandro.fletcher

Новичок
Автор темы
5
1
за такое люди деньги платят,чтобы написать,поэтому просто так никто бы не сделал его
Ну может кто напишет бесплатно, если делать нечего, этот скрипт просто у меня выводит табличку что афк выше нормы, но игру не закрывает
 
  • Эм
Реакции: YarikVL

LorianS1

Новичок
8
4
Нужно написать lua скрипт. Суть его такова: У тебя закрывается Самп когда афк достигает 880-900 секунд. По возможности добавте предупреждение типа: Афк достигло 800 секунд через 100 секунд игра будет закрыта. Благодарю
Привет. Тебе нужен просто код?
Запускать в игре умеешь, используя инжектор?

Могу в принципе взяться, делов на 5 минут :)
 
Последнее редактирование:

alessandro.fletcher

Новичок
Автор темы
5
1
Привет. Тебе нужен просто код?
Запускать в игре умеешь, используя инжектор?

Могу в принципе взяться, делов на 5 минут :)
Я не знаю язык луа вообще, если сможешь обьяснить что и куда вставлять - буду благодарен
 

LorianS1

Новичок
8
4
Я не знаю язык луа вообще, если сможешь обьяснить что и куда вставлять - буду благодарен
Lua:
local timeWithoutInput = 0 -- время бездействия игрока
local warningThreshold = 800 -- пороговое значение времени бездействия для предупреждения (в секундах)
local maxThreshold = 900 -- максимальное значение времени бездействия (в секундах)

function main()
  while true do
    wait(1000) -- ждем 1 секунду, чтобы обновить время бездействия

    if isCharInAnyCar(PLAYER_PED) or isCharOnFoot(PLAYER_PED) then
      -- если игрок находится в машине или на ногах, то сбрасываем время бездействия
      timeWithoutInput = 0
    else
      -- иначе увеличиваем время бездействия на 1 секунду
      timeWithoutInput = timeWithoutInput + 1
    end

    if timeWithoutInput == warningThreshold then
      -- если время бездействия достигло порогового значения, выдаем предупреждение
      sampAddChatMessage("[AFK WARNING] You have been inactive for 800 seconds. Game will be closed in 100 seconds.", 0xFFFF00)
    elseif timeWithoutInput == maxThreshold then
      -- если время бездействия достигло максимального значения, закрываем игру
      sampAddChatMessage("[AFK KICK] You have been inactive for 900 seconds. Game will be closed now.", 0xFF0000)
      wait(2000)
      os.exit()
    end
  end
end

Этот скрипт следует поместить в файл с расширением .lua и запустить в игре, используя какой-либо инжектор, который поддерживает скрипты на Lua, такие как Moonloader
Можешь загуглить, как это делается
 

savvin

Известный
412
143
Lua:
local timeWithoutInput = 0 -- время бездействия игрока
local warningThreshold = 800 -- пороговое значение времени бездействия для предупреждения (в секундах)
local maxThreshold = 900 -- максимальное значение времени бездействия (в секундах)

function main()
  while true do
    wait(1000) -- ждем 1 секунду, чтобы обновить время бездействия

    if isCharInAnyCar(PLAYER_PED) or isCharOnFoot(PLAYER_PED) then
      -- если игрок находится в машине или на ногах, то сбрасываем время бездействия
      timeWithoutInput = 0
    else
      -- иначе увеличиваем время бездействия на 1 секунду
      timeWithoutInput = timeWithoutInput + 1
    end

    if timeWithoutInput == warningThreshold then
      -- если время бездействия достигло порогового значения, выдаем предупреждение
      sampAddChatMessage("[AFK WARNING] You have been inactive for 800 seconds. Game will be closed in 100 seconds.", 0xFFFF00)
    elseif timeWithoutInput == maxThreshold then
      -- если время бездействия достигло максимального значения, закрываем игру
      sampAddChatMessage("[AFK KICK] You have been inactive for 900 seconds. Game will be closed now.", 0xFF0000)
      wait(2000)
      os.exit()
    end
  end
end

Этот скрипт следует поместить в файл с расширением .lua и запустить в игре, используя какой-либо инжектор, который поддерживает скрипты на Lua, такие как Moonloader
Можешь загуглить, как это делается

Скрипт не будет работать в режиме паузы, да и чат не видно в афк
 

YarikVL

Известный
Проверенный
4,820
1,827
Ну может кто напишет бесплатно, если делать нечего, этот скрипт просто у меня выводит табличку что афк выше нормы, но игру не закрывает
Должно закрывать, ты правильно настроил?
Попробуй:
Lua:
require "lib.moonloader"
require 'lib.sampfuncs'

local ffi = require 'ffi'
local statuscheckafk = true
local inicfg = require 'inicfg'
local imgui = require 'imgui'
local encoding = require 'encoding'
encoding.default = 'CP1251'   
u8 = encoding.UTF8
CP1251 = encoding.CP1251
sw,sh = getScreenResolution()

script_name("Control AFK")
script_author("leeky rave")
script_description("я не люблю табуляцию")
script_version_number(1)
script_version("1")
script_properties('work-in-pause')


function ShowMessage(text, title, style)
    ffi.cdef [[
        int MessageBoxA(
            void* hWnd,
            const char* lpText,
            const char* lpCaption,
            unsigned int uType
        );
    ]]
    local hwnd = ffi.cast('void*', readMemory(0x00C8CF88, 4, false))
    ffi.C.MessageBoxA(hwnd, text,  title, style and (style + 0x50000) or 0x50000)
end








local directIni = "ControlAFK\\settings.ini"



local def = {

    settings = {
        
        state = true,
        limit = 900,
        allowance = -1,
        exit = true,
    },

}



local ini = inicfg.load(def, directIni)

if not doesDirectoryExist('moonloader/config/ControlAFK') then createDirectory ("moonloader/config/ControlAFK") end
if not doesFileExist('moonloader/config/ControlAFK/settings.ini') then inicfg.save(def, directIni) end


local afkSet = {
    ['state']   = imgui.ImBool(ini.settings.state),
    ['limit']       = imgui.ImInt(ini.settings.limit),
    ['allowance']   = imgui.ImInt(ini.settings.allowance),
    ['exitstate']   = imgui.ImBool(ini.settings.exit),
    ['wstate']      = imgui.ImBool(false)
}
local startafktime = 0

function main()

    if not isSampfuncsLoaded() or not isSampLoaded() then return end
    while not isSampAvailable() do wait(100) end

    sampRegisterChatCommand('cafk',function() afkSet['wstate'].v = not afkSet['wstate'].v end)
    sampAddChatMessage("{2DF61C}[Control AFK] {FFFFFF}Скрипт успешно запущен. Активация: {2DF61C}/cafk.",-1)


    while true do
        imgui.Process = afkSet['wstate'].v
    wait(0)
        if isGamePaused() and afkSet['state'].v and statuscheckafk then 

            startafktime = os.time()

            statuscheckafk = false

        elseif not isGamePaused()  then 

        

            statuscheckafk = true
            startafktime = 0
      
        end

            if afkSet['state'].v and isGamePaused() then
        
                if os.time() - startafktime == afkSet['limit'].v - afkSet['allowance'].v then 

                    ShowMessage('Значение афк уже достигло '.. afkSet['limit'].v - afkSet['allowance'].v ..' секунд\nЧерез 30 секунд игра будет закрыта.', 'Control AFK', 0x30)
      

                end
            end
            
            if afkSet['exitstate'].v and afkSet['state'].v and isGamePaused() then 

                if os.time() - startafktime == afkSet['limit'].v  then 
          
                  ShowMessage('Значение афк уже достигло '.. afkSet['limit'].v ..' секунд\nВыхожу из игры', 'Control AFK', 0x30)
                  
                  os.execute('taskkill /IM gta_sa.exe /F')
          
                end
          
            end
              
    end

    wait(-1)

end



function imgui.OnDrawFrame()

    if afkSet['wstate'].v then
    
        imgui.Begin(u8'Контроль афк',afkSet['wstate'],imgui.WindowFlags.NoResize + imgui.WindowFlags.NoCollapse + imgui.WindowFlags.AlwaysAutoResize)
          imgui.SetWindowPos(u8'Контроль афк', imgui.ImVec2(sw/2 - imgui.GetWindowSize().x/2, sh/2 - imgui.GetWindowSize().y/2),imgui.Cond.FirstUseEver)
            imgui.PushItemWidth(50)
            if imgui.Checkbox(u8'Вкл/Выкл',afkSet['state']) then ini.settings.state = afkSet['state'].v inicfg.save(def,directIni) end
            imgui.Hint(u8'Состояние контроля афк. Включить или выключить,и бобру понятно')
            if imgui.Checkbox(u8'Выход при превышении',afkSet['exitstate']) then ini.settings.exit = afkSet['exitstate'].v inicfg.save(def,directIni) end
            imgui.Hint(u8'Выходить при достижении лимита афк')
            if imgui.InputInt(u8'Лимит афк',afkSet['limit'],0,0) then ini.settings.limit = afkSet['limit'].v inicfg.save(def,directIni) end
            imgui.Hint(u8'Лимит афк в секундах')
            if imgui.InputInt(u8'Допуск афк',afkSet['allowance'],0,0) then ini.settings.allowance = afkSet['allowance'].v inicfg.save(def,directIni) end
            imgui.Hint(u8'Вывод предупреждения за допускное время')
            imgui.Text(u8'Авторство: ')
            imgui.SameLine()
            imgui.Link('https://www.blast.hk/members/354365/','BH')
            imgui.SameLine()
            imgui.Link('https://vk.com/ravexl','VK')
            imgui.PopItemWidth()


        
        imgui.End()
    end

end



function imgui.Hint(text, delay)
    if imgui.IsItemHovered() then
        if go_hint == nil then go_hint = os.clock() + (delay and delay or 0.0) end
        local alpha = (os.clock() - go_hint) * 5 -- скорость появления
        if os.clock() >= go_hint then
            imgui.PushStyleVar(imgui.StyleVar.Alpha, (alpha <= 1.0 and alpha or 1.0))
                imgui.PushStyleColor(imgui.Col.PopupBg, imgui.GetStyle().Colors[imgui.Col.ButtonHovered])
                    imgui.BeginTooltip()
                    imgui.PushTextWrapPos(450)
                    imgui.TextUnformatted(text)
                    if not imgui.IsItemVisible() and imgui.GetStyle().Alpha == 1.0 then go_hint = nil end
                    imgui.PopTextWrapPos()
                    imgui.EndTooltip()
                imgui.PopStyleColor()
            imgui.PopStyleVar()
        end
    end
  end
 





  function violet_theme()
    imgui.SwitchContext()
    local style = imgui.GetStyle()
    local colors = style.Colors
    local clr = imgui.Col
    local ImVec4 = imgui.ImVec4
    style.WindowPadding = imgui.ImVec2(8, 8)
  style.WindowRounding = 6
  style.ChildWindowRounding = 5
  style.FramePadding = imgui.ImVec2(5, 3)
  style.FrameRounding = 3.0
  style.ItemSpacing = imgui.ImVec2(5, 4)
  style.ItemInnerSpacing = imgui.ImVec2(4, 4)
  style.IndentSpacing = 21
  style.ScrollbarSize = 10.0
  style.ScrollbarRounding = 13
  style.GrabMinSize = 8
  style.GrabRounding = 1
  style.WindowTitleAlign = imgui.ImVec2(0.5, 0.5)
  style.ButtonTextAlign = imgui.ImVec2(0.5, 0.5)
 
    colors[clr.WindowBg]              = ImVec4(0.14, 0.12, 0.16, 1.00);
    colors[clr.Text]                   = ImVec4(0.95, 0.96, 0.98, 1.00);
    colors[clr.TextDisabled]           = ImVec4(0.29, 0.29, 0.29, 1.00);
    colors[clr.ChildWindowBg]         = ImVec4(0.30, 0.20, 0.39, 0.00);
    colors[clr.PopupBg]               = ImVec4(0.05, 0.05, 0.10, 0.90);
    colors[clr.Border]                = ImVec4(0.89, 0.85, 0.92, 0.30);
    colors[clr.BorderShadow]          = ImVec4(0.00, 0.00, 0.00, 0.00);
    colors[clr.FrameBg]               = ImVec4(0.30, 0.20, 0.39, 1.00);
    colors[clr.FrameBgHovered]        = ImVec4(0.41, 0.19, 0.63, 0.68);
    colors[clr.FrameBgActive]         = ImVec4(0.41, 0.19, 0.63, 1.00);
    colors[clr.TitleBg]               = ImVec4(0.41, 0.19, 0.63, 0.45);
    colors[clr.TitleBgCollapsed]      = ImVec4(0.41, 0.19, 0.63, 0.35);
    colors[clr.TitleBgActive]         = ImVec4(0.41, 0.19, 0.63, 0.78);
    colors[clr.MenuBarBg]             = ImVec4(0.30, 0.20, 0.39, 0.57);
    colors[clr.ScrollbarBg]           = ImVec4(0.30, 0.20, 0.39, 1.00);
    colors[clr.ScrollbarGrab]         = ImVec4(0.41, 0.19, 0.63, 0.31);
    colors[clr.ScrollbarGrabHovered]  = ImVec4(0.41, 0.19, 0.63, 0.78);
    colors[clr.ScrollbarGrabActive]   = ImVec4(0.41, 0.19, 0.63, 1.00);
    colors[clr.ComboBg]               = ImVec4(0.30, 0.20, 0.39, 1.00);
    colors[clr.CheckMark]             = ImVec4(0.56, 0.61, 1.00, 1.00);
    colors[clr.SliderGrab]            = ImVec4(0.41, 0.19, 0.63, 0.24);
    colors[clr.SliderGrabActive]      = ImVec4(0.41, 0.19, 0.63, 1.00);
    colors[clr.Button]                = ImVec4(0.41, 0.19, 0.63, 0.44);
    colors[clr.ButtonHovered]         = ImVec4(0.41, 0.19, 0.63, 0.86);
    colors[clr.ButtonActive]          = ImVec4(0.64, 0.33, 0.94, 1.00);
    colors[clr.Header]                = ImVec4(0.41, 0.19, 0.63, 0.76);
    colors[clr.HeaderHovered]         = ImVec4(0.41, 0.19, 0.63, 0.86);
    colors[clr.HeaderActive]          = ImVec4(0.41, 0.19, 0.63, 1.00);
    colors[clr.ResizeGrip]            = ImVec4(0.41, 0.19, 0.63, 0.20);
    colors[clr.ResizeGripHovered]     = ImVec4(0.41, 0.19, 0.63, 0.78);
    colors[clr.ResizeGripActive]      = ImVec4(0.41, 0.19, 0.63, 1.00);
    colors[clr.CloseButton]           = ImVec4(1.00, 1.00, 1.00, 0.75);
    colors[clr.CloseButtonHovered]    = ImVec4(0.88, 0.74, 1.00, 0.59);
    colors[clr.CloseButtonActive]     = ImVec4(0.88, 0.85, 0.92, 1.00);
    colors[clr.PlotLines]             = ImVec4(0.89, 0.85, 0.92, 0.63);
    colors[clr.PlotLinesHovered]      = ImVec4(0.41, 0.19, 0.63, 1.00);
    colors[clr.PlotHistogram]         = ImVec4(0.89, 0.85, 0.92, 0.63);
    colors[clr.PlotHistogramHovered]  = ImVec4(0.41, 0.19, 0.63, 1.00);
    colors[clr.TextSelectedBg]        = ImVec4(0.41, 0.19, 0.63, 0.43);
    colors[clr.ModalWindowDarkening]  = ImVec4(0.20, 0.20, 0.20, 0.35);
end
violet_theme()

  -- [[плохо криптуешь,бабенко]]


  function imgui.Link(link,name,myfunc)
    myfunc = type(name) == 'boolean' and name or myfunc or false
    name = type(name) == 'string' and name or type(name) == 'boolean' and link or link
    local size = imgui.CalcTextSize(name)
    local p = imgui.GetCursorScreenPos()
    local p2 = imgui.GetCursorPos()
    local resultBtn = imgui.InvisibleButton('##'..link..name, size)
    if resultBtn then
        if not myfunc then
            os.execute('explorer '..link)
        end
    end
    imgui.SetCursorPos(p2)
    if imgui.IsItemHovered() then
        imgui.TextColored(imgui.GetStyle().Colors[imgui.Col.ButtonHovered], name)
        imgui.GetWindowDrawList():AddLine(imgui.ImVec2(p.x, p.y + size.y), imgui.ImVec2(p.x + size.x, p.y + size.y), imgui.GetColorU32(imgui.GetStyle().Colors[imgui.Col.ButtonHovered]))
    else
        imgui.TextColored(imgui.GetStyle().Colors[imgui.Col.Button], name)
    end
    return resultBtn
end
Гайд как поставить этот код:



Я поменял способ выхода на этот
 

MLycoris

Помидорный диетолог
Проверенный
1,768
1,787
Могу предложить такую альтернативу, ставишь таймер, да уходишь куда тебе надо
 

alessandro.fletcher

Новичок
Автор темы
5
1
Должно закрывать, ты правильно настроил?
Попробуй:
Lua:
require "lib.moonloader"
require 'lib.sampfuncs'

local ffi = require 'ffi'
local statuscheckafk = true
local inicfg = require 'inicfg'
local imgui = require 'imgui'
local encoding = require 'encoding'
encoding.default = 'CP1251'  
u8 = encoding.UTF8
CP1251 = encoding.CP1251
sw,sh = getScreenResolution()

script_name("Control AFK")
script_author("leeky rave")
script_description("я не люблю табуляцию")
script_version_number(1)
script_version("1")
script_properties('work-in-pause')


function ShowMessage(text, title, style)
    ffi.cdef [[
        int MessageBoxA(
            void* hWnd,
            const char* lpText,
            const char* lpCaption,
            unsigned int uType
        );
    ]]
    local hwnd = ffi.cast('void*', readMemory(0x00C8CF88, 4, false))
    ffi.C.MessageBoxA(hwnd, text,  title, style and (style + 0x50000) or 0x50000)
end








local directIni = "ControlAFK\\settings.ini"



local def = {

    settings = {
       
        state = true,
        limit = 900,
        allowance = -1,
        exit = true,
    },

}



local ini = inicfg.load(def, directIni)

if not doesDirectoryExist('moonloader/config/ControlAFK') then createDirectory ("moonloader/config/ControlAFK") end
if not doesFileExist('moonloader/config/ControlAFK/settings.ini') then inicfg.save(def, directIni) end


local afkSet = {
    ['state']   = imgui.ImBool(ini.settings.state),
    ['limit']       = imgui.ImInt(ini.settings.limit),
    ['allowance']   = imgui.ImInt(ini.settings.allowance),
    ['exitstate']   = imgui.ImBool(ini.settings.exit),
    ['wstate']      = imgui.ImBool(false)
}
local startafktime = 0

function main()

    if not isSampfuncsLoaded() or not isSampLoaded() then return end
    while not isSampAvailable() do wait(100) end

    sampRegisterChatCommand('cafk',function() afkSet['wstate'].v = not afkSet['wstate'].v end)
    sampAddChatMessage("{2DF61C}[Control AFK] {FFFFFF}Скрипт успешно запущен. Активация: {2DF61C}/cafk.",-1)


    while true do
        imgui.Process = afkSet['wstate'].v
    wait(0)
        if isGamePaused() and afkSet['state'].v and statuscheckafk then

            startafktime = os.time()

            statuscheckafk = false

        elseif not isGamePaused()  then

       

            statuscheckafk = true
            startafktime = 0
     
        end

            if afkSet['state'].v and isGamePaused() then
       
                if os.time() - startafktime == afkSet['limit'].v - afkSet['allowance'].v then

                    ShowMessage('Значение афк уже достигло '.. afkSet['limit'].v - afkSet['allowance'].v ..' секунд\nЧерез 30 секунд игра будет закрыта.', 'Control AFK', 0x30)
     

                end
            end
           
            if afkSet['exitstate'].v and afkSet['state'].v and isGamePaused() then

                if os.time() - startafktime == afkSet['limit'].v  then
         
                  ShowMessage('Значение афк уже достигло '.. afkSet['limit'].v ..' секунд\nВыхожу из игры', 'Control AFK', 0x30)
                 
                  os.execute('taskkill /IM gta_sa.exe /F')
         
                end
         
            end
             
    end

    wait(-1)

end



function imgui.OnDrawFrame()

    if afkSet['wstate'].v then
   
        imgui.Begin(u8'Контроль афк',afkSet['wstate'],imgui.WindowFlags.NoResize + imgui.WindowFlags.NoCollapse + imgui.WindowFlags.AlwaysAutoResize)
          imgui.SetWindowPos(u8'Контроль афк', imgui.ImVec2(sw/2 - imgui.GetWindowSize().x/2, sh/2 - imgui.GetWindowSize().y/2),imgui.Cond.FirstUseEver)
            imgui.PushItemWidth(50)
            if imgui.Checkbox(u8'Вкл/Выкл',afkSet['state']) then ini.settings.state = afkSet['state'].v inicfg.save(def,directIni) end
            imgui.Hint(u8'Состояние контроля афк. Включить или выключить,и бобру понятно')
            if imgui.Checkbox(u8'Выход при превышении',afkSet['exitstate']) then ini.settings.exit = afkSet['exitstate'].v inicfg.save(def,directIni) end
            imgui.Hint(u8'Выходить при достижении лимита афк')
            if imgui.InputInt(u8'Лимит афк',afkSet['limit'],0,0) then ini.settings.limit = afkSet['limit'].v inicfg.save(def,directIni) end
            imgui.Hint(u8'Лимит афк в секундах')
            if imgui.InputInt(u8'Допуск афк',afkSet['allowance'],0,0) then ini.settings.allowance = afkSet['allowance'].v inicfg.save(def,directIni) end
            imgui.Hint(u8'Вывод предупреждения за допускное время')
            imgui.Text(u8'Авторство: ')
            imgui.SameLine()
            imgui.Link('https://www.blast.hk/members/354365/','BH')
            imgui.SameLine()
            imgui.Link('https://vk.com/ravexl','VK')
            imgui.PopItemWidth()


       
        imgui.End()
    end

end



function imgui.Hint(text, delay)
    if imgui.IsItemHovered() then
        if go_hint == nil then go_hint = os.clock() + (delay and delay or 0.0) end
        local alpha = (os.clock() - go_hint) * 5 -- скорость появления
        if os.clock() >= go_hint then
            imgui.PushStyleVar(imgui.StyleVar.Alpha, (alpha <= 1.0 and alpha or 1.0))
                imgui.PushStyleColor(imgui.Col.PopupBg, imgui.GetStyle().Colors[imgui.Col.ButtonHovered])
                    imgui.BeginTooltip()
                    imgui.PushTextWrapPos(450)
                    imgui.TextUnformatted(text)
                    if not imgui.IsItemVisible() and imgui.GetStyle().Alpha == 1.0 then go_hint = nil end
                    imgui.PopTextWrapPos()
                    imgui.EndTooltip()
                imgui.PopStyleColor()
            imgui.PopStyleVar()
        end
    end
  end
 





  function violet_theme()
    imgui.SwitchContext()
    local style = imgui.GetStyle()
    local colors = style.Colors
    local clr = imgui.Col
    local ImVec4 = imgui.ImVec4
    style.WindowPadding = imgui.ImVec2(8, 8)
  style.WindowRounding = 6
  style.ChildWindowRounding = 5
  style.FramePadding = imgui.ImVec2(5, 3)
  style.FrameRounding = 3.0
  style.ItemSpacing = imgui.ImVec2(5, 4)
  style.ItemInnerSpacing = imgui.ImVec2(4, 4)
  style.IndentSpacing = 21
  style.ScrollbarSize = 10.0
  style.ScrollbarRounding = 13
  style.GrabMinSize = 8
  style.GrabRounding = 1
  style.WindowTitleAlign = imgui.ImVec2(0.5, 0.5)
  style.ButtonTextAlign = imgui.ImVec2(0.5, 0.5)
 
    colors[clr.WindowBg]              = ImVec4(0.14, 0.12, 0.16, 1.00);
    colors[clr.Text]                   = ImVec4(0.95, 0.96, 0.98, 1.00);
    colors[clr.TextDisabled]           = ImVec4(0.29, 0.29, 0.29, 1.00);
    colors[clr.ChildWindowBg]         = ImVec4(0.30, 0.20, 0.39, 0.00);
    colors[clr.PopupBg]               = ImVec4(0.05, 0.05, 0.10, 0.90);
    colors[clr.Border]                = ImVec4(0.89, 0.85, 0.92, 0.30);
    colors[clr.BorderShadow]          = ImVec4(0.00, 0.00, 0.00, 0.00);
    colors[clr.FrameBg]               = ImVec4(0.30, 0.20, 0.39, 1.00);
    colors[clr.FrameBgHovered]        = ImVec4(0.41, 0.19, 0.63, 0.68);
    colors[clr.FrameBgActive]         = ImVec4(0.41, 0.19, 0.63, 1.00);
    colors[clr.TitleBg]               = ImVec4(0.41, 0.19, 0.63, 0.45);
    colors[clr.TitleBgCollapsed]      = ImVec4(0.41, 0.19, 0.63, 0.35);
    colors[clr.TitleBgActive]         = ImVec4(0.41, 0.19, 0.63, 0.78);
    colors[clr.MenuBarBg]             = ImVec4(0.30, 0.20, 0.39, 0.57);
    colors[clr.ScrollbarBg]           = ImVec4(0.30, 0.20, 0.39, 1.00);
    colors[clr.ScrollbarGrab]         = ImVec4(0.41, 0.19, 0.63, 0.31);
    colors[clr.ScrollbarGrabHovered]  = ImVec4(0.41, 0.19, 0.63, 0.78);
    colors[clr.ScrollbarGrabActive]   = ImVec4(0.41, 0.19, 0.63, 1.00);
    colors[clr.ComboBg]               = ImVec4(0.30, 0.20, 0.39, 1.00);
    colors[clr.CheckMark]             = ImVec4(0.56, 0.61, 1.00, 1.00);
    colors[clr.SliderGrab]            = ImVec4(0.41, 0.19, 0.63, 0.24);
    colors[clr.SliderGrabActive]      = ImVec4(0.41, 0.19, 0.63, 1.00);
    colors[clr.Button]                = ImVec4(0.41, 0.19, 0.63, 0.44);
    colors[clr.ButtonHovered]         = ImVec4(0.41, 0.19, 0.63, 0.86);
    colors[clr.ButtonActive]          = ImVec4(0.64, 0.33, 0.94, 1.00);
    colors[clr.Header]                = ImVec4(0.41, 0.19, 0.63, 0.76);
    colors[clr.HeaderHovered]         = ImVec4(0.41, 0.19, 0.63, 0.86);
    colors[clr.HeaderActive]          = ImVec4(0.41, 0.19, 0.63, 1.00);
    colors[clr.ResizeGrip]            = ImVec4(0.41, 0.19, 0.63, 0.20);
    colors[clr.ResizeGripHovered]     = ImVec4(0.41, 0.19, 0.63, 0.78);
    colors[clr.ResizeGripActive]      = ImVec4(0.41, 0.19, 0.63, 1.00);
    colors[clr.CloseButton]           = ImVec4(1.00, 1.00, 1.00, 0.75);
    colors[clr.CloseButtonHovered]    = ImVec4(0.88, 0.74, 1.00, 0.59);
    colors[clr.CloseButtonActive]     = ImVec4(0.88, 0.85, 0.92, 1.00);
    colors[clr.PlotLines]             = ImVec4(0.89, 0.85, 0.92, 0.63);
    colors[clr.PlotLinesHovered]      = ImVec4(0.41, 0.19, 0.63, 1.00);
    colors[clr.PlotHistogram]         = ImVec4(0.89, 0.85, 0.92, 0.63);
    colors[clr.PlotHistogramHovered]  = ImVec4(0.41, 0.19, 0.63, 1.00);
    colors[clr.TextSelectedBg]        = ImVec4(0.41, 0.19, 0.63, 0.43);
    colors[clr.ModalWindowDarkening]  = ImVec4(0.20, 0.20, 0.20, 0.35);
end
violet_theme()

  -- [[плохо криптуешь,бабенко]]


  function imgui.Link(link,name,myfunc)
    myfunc = type(name) == 'boolean' and name or myfunc or false
    name = type(name) == 'string' and name or type(name) == 'boolean' and link or link
    local size = imgui.CalcTextSize(name)
    local p = imgui.GetCursorScreenPos()
    local p2 = imgui.GetCursorPos()
    local resultBtn = imgui.InvisibleButton('##'..link..name, size)
    if resultBtn then
        if not myfunc then
            os.execute('explorer '..link)
        end
    end
    imgui.SetCursorPos(p2)
    if imgui.IsItemHovered() then
        imgui.TextColored(imgui.GetStyle().Colors[imgui.Col.ButtonHovered], name)
        imgui.GetWindowDrawList():AddLine(imgui.ImVec2(p.x, p.y + size.y), imgui.ImVec2(p.x + size.x, p.y + size.y), imgui.GetColorU32(imgui.GetStyle().Colors[imgui.Col.ButtonHovered]))
    else
        imgui.TextColored(imgui.GetStyle().Colors[imgui.Col.Button], name)
    end
    return resultBtn
end
Гайд как поставить этот код:



Я поменял способ выхода на этот
Могу мунлодер лог кинуть, хз не сворачивается самп