local imgui = require 'imgui'
local vkeys = require 'vkeys'
local fa = require 'fAwesome5'
local inicfg = require 'inicfg'
local encoding = require 'encoding' -- загружаем библиотеку
encoding.default = 'CP1251' -- указываем кодировку по умолчанию, она должна совпадать с кодировкой файла. CP1251 - это Windows-1251
u8 = encoding.UTF8 -- и создаЄм короткий псевдоним дл¤ кодировщика UTF-8
show_main_window = imgui.ImBool(false)
local slowheal = false
ini = inicfg.load({
Settings =
{
first = "/lock 1",
second = "/anim 11",
third = "/anim 4",
fourth = " ",
fifth = "/mask",
sixth = "/agit",
seventh = "/healme",
eighth = "/anim 4",
nineth = " ",
tenth = " "
}
})
local status = inicfg.load(ini, 'binder-TLR.ini')
if not doesFileExist('moonloader/config/binder-TLR.ini') then inicfg.save(ini, 'binder-TLR.ini') end
local fa_font = nil
local fa_glyph_ranges = imgui.ImGlyphRanges({ fa.min_range, fa.max_range })
function main()
while true do
wait(0)
if (not isSampfuncsConsoleActive() and not sampIsDialogActive() and not sampIsChatInputActive() and not sampIsScoreboardOpen()) then
if testCheat('Z') then
show_main_window.v = not show_main_window.v
end
imgui.Process = show_main_window.v
end
end
end
function imgui.BeforeDrawFrame()
if fa_font == nil then
local font_config = imgui.ImFontConfig() -- to use 'imgui.ImFontConfig.new()' on error
font_config.MergeMode = true
fa_font = imgui.GetIO().Fonts:AddFontFromFileTTF('moonloader/resource/fonts/fa-solid-900.ttf', 13.0, font_config, fa_glyph_ranges)
end
end
local test_text_buffer_1 = imgui.ImBuffer(256)
local test_text_buffer_2 = imgui.ImBuffer(256)
local test_text_buffer_3 = imgui.ImBuffer(256)
local test_text_buffer_4 = imgui.ImBuffer(256)
local test_text_buffer_5 = imgui.ImBuffer(256)
local test_text_buffer_6 = imgui.ImBuffer(256)
local test_text_buffer_7 = imgui.ImBuffer(256)
local test_text_buffer_8 = imgui.ImBuffer(256)
local test_text_buffer_9 = imgui.ImBuffer(256)
local test_text_buffer_10 = imgui.ImBuffer(256)
function imgui.OnDrawFrame()
if show_main_window.v then
local sw, sh = getScreenResolution()
imgui.SetNextWindowPos(imgui.ImVec2(sw / 2, sh / 2), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5))
imgui.SetNextWindowSize(imgui.ImVec2(507, 500), imgui.Cond.FirstUseEver)
imgui.Begin('binder 1.0 by Tottenham Hight', show_main_window, imgui.WindowFlags.NoCollapse)
imgui.Text(u8(ini.Settings.first))
if imgui.IsItemClicked() then
imgui.LogToClipboard()
imgui.LogText(u8(ini.Settings.first)) -- копирование текста
imgui.LogFinish()
end
if imgui.InputText(u8('1-й бинд'), test_text_buffer_1) then
ini.Settings.first = tostring(u8:decode(test_text_buffer_1.v))
inicfg.save(ini, 'binderr-TLR.ini')
end
imgui.SameLine()
if imgui.Button(fa.ICON_FA_TV .. u8('1-й бинд'), imgui.ImVec2(80, 40)) then
sampSendChat(ini.Settings.first)
end
--
imgui.Text(u8(ini.Settings.second))
if imgui.IsItemClicked() then
imgui.LogToClipboard()
imgui.LogText(u8(ini.Settings.second)) -- копирование текста
imgui.LogFinish()
end
if imgui.InputText(u8('2-й бинд'), test_text_buffer_2) then
ini.Settings.second = tostring(u8:decode(test_text_buffer_2.v))
inicfg.save(ini, 'binder-TLR.ini')
end
imgui.SameLine()
if imgui.Button(fa.ICON_FA_TV .. u8('2-й бинд'), imgui.ImVec2(80, 40)) then
sampSendChat(ini.Settings.second)
end
--
imgui.Text(u8(ini.Settings.third))
if imgui.IsItemClicked() then
imgui.LogToClipboard()
imgui.LogText(u8(ini.Settings.third)) -- копирование текста
imgui.LogFinish()
end
if imgui.InputText(u8('3-й бинд'), test_text_buffer_3) then
ini.Settings.third = tostring(u8:decode(test_text_buffer_3.v))
inicfg.save(ini, 'binder-TLR.ini')
end
imgui.SameLine()
if imgui.Button(fa.ICON_FA_TV .. u8('3-й бинд'), imgui.ImVec2(80, 40)) then
sampSendChat(ini.Settings.third)
end
--
imgui.Text(u8(ini.Settings.fourth))
if imgui.IsItemClicked() then
imgui.LogToClipboard()
imgui.LogText(u8(ini.Settings.fourth)) -- копирование текста
imgui.LogFinish()
end
if imgui.InputText(u8('4-й бинд'), test_text_buffer_4) then
ini.Settings.fourth = tostring(u8:decode(test_text_buffer_4.v))
inicfg.save(ini, 'binder-TLR.ini')
end
imgui.SameLine()
if imgui.Button(fa.ICON_FA_TV .. u8('4-й бинд'), imgui.ImVec2(80, 40)) then
sampSendChat(ini.Settings.fourth)
end
--
imgui.Text(u8(ini.Settings.fifth))
if imgui.IsItemClicked() then
imgui.LogToClipboard()
imgui.LogText(u8(ini.Settings.fifth)) -- копирование текста
imgui.LogFinish()
end
if imgui.InputText(u8('5-й бинд'), test_text_buffer_5) then
ini.Settings.fifth = tostring(u8:decode(test_text_buffer_5.v))
inicfg.save(ini, 'binder-TLR.ini')
end
imgui.SameLine()
if imgui.Button(fa.ICON_FA_TV .. u8('5-й бинд'), imgui.ImVec2(80, 40)) then
sampSendChat(ini.Settings.fifth)
end
--
imgui.Text(u8(ini.Settings.sixth))
if imgui.IsItemClicked() then
imgui.LogToClipboard()
imgui.LogText(u8(ini.Settings.sixth)) -- копирование текста
imgui.LogFinish()
end
if imgui.InputText(u8('6-й бинд'), test_text_buffer_6) then
ini.Settings.sixth = tostring(u8:decode(test_text_buffer_6.v))
inicfg.save(ini, 'binder-TLR.ini')
end
imgui.SameLine()
if imgui.Button(fa.ICON_FA_TV .. u8('6-й бинд'), imgui.ImVec2(80, 40)) then
sampSendChat(ini.Settings.sixth)
end
--
imgui.Text(u8(ini.Settings.seventh))
if imgui.IsItemClicked() then
imgui.LogToClipboard()
imgui.LogText(u8(ini.Settings.seventh)) -- копирование текста
imgui.LogFinish()
end
if imgui.InputText(u8('7-й бинд'), test_text_buffer_7) then
ini.Settings.seventh = tostring(u8:decode(test_text_buffer_7.v))
inicfg.save(ini, 'binder-TLR.ini')
end
imgui.SameLine()
if imgui.Button(fa.ICON_FA_TV .. u8('7-й бинд'), imgui.ImVec2(80, 40)) then
sampSendChat(ini.Settings.seventh)
end
--
imgui.Text(u8(ini.Settings.eighth))
if imgui.IsItemClicked() then
imgui.LogToClipboard()
imgui.LogText(u8(ini.Settings.eighth)) -- копирование текста
imgui.LogFinish()
end
if imgui.InputText(u8('8-й бинд'), test_text_buffer_8) then
ini.Settings.eighth = tostring(u8:decode(test_text_buffer_8.v))
inicfg.save(ini, 'binder-TLR.ini')
end
imgui.SameLine()
if imgui.Button(fa.ICON_FA_TV .. u8('8-й бинд'), imgui.ImVec2(80, 40)) then
sampSendChat(ini.Settings.eighth)
end
--
imgui.Text(u8(ini.Settings.nineth))
if imgui.IsItemClicked() then
imgui.LogToClipboard()
imgui.LogText(u8(ini.Settings.nineth)) -- копирование текста
imgui.LogFinish()
end
if imgui.InputText(u8('9-й бинд'), test_text_buffer_9) then
ini.Settings.nineth = tostring(u8:decode(test_text_buffer_9.v))
inicfg.save(ini, 'binder-TLR.ini')
end
imgui.SameLine()
if imgui.Button(fa.ICON_FA_TV .. u8('9-й бинд'), imgui.ImVec2(80, 40)) then
sampSendChat(ini.Settings.nineth)
end
--
imgui.Text(u8(ini.Settings.tenth))
if imgui.IsItemClicked() then
imgui.LogToClipboard()
imgui.LogText(u8(ini.Settings.tenth)) -- копирование текста
imgui.LogFinish()
end
if imgui.InputText(u8('10-й бинд'), test_text_buffer_10) then
ini.Settings.tenth = tostring(u8:decode(test_text_buffer_10.v))
inicfg.save(ini, 'binder-TLR.ini')
end
imgui.SameLine()
if imgui.Button(fa.ICON_FA_TV .. u8('10-й бинд'), imgui.ImVec2(80, 40)) then
sampSendChat(ini.Settings.tenth)
end
imgui.End()
end
end