script_name('Тренер Капчи')
script_author('Fabrego')
local version = '1.1'
local q = require 'lib.samp.events'
local inicfg = require 'inicfg'
local vkeys = require 'vkeys'
local imgui = require 'imgui'
local mem = require 'memory'
local bNotf, notf = pcall(import, "imgui_notf.lua")
local captcha = ''
local captchaTable = {}
local HLcfg = inicfg.load({
main = {
onkey = false,
key = 'U',
texttime = false,
}
}, "HelperLovli")
local encoding = require 'encoding'
encoding.default = 'CP1251'
u8 = encoding.UTF8
local tags = imgui.ImBool(false)
local main_window_state = imgui.ImBool(false)
buffer = imgui.ImBuffer(tostring(HLcfg.main.jtext), 256)
buffer.v = string.gsub(tostring(buffer.v), '"', '')
keybuff = imgui.ImBuffer(tostring(HLcfg.main.key), 5)
buffermenu = imgui.ImBuffer(tostring(HLcfg.main.activation), 256)
function apply_custom_style()
imgui.SwitchContext()
local style = imgui.GetStyle()
local colors = style.Colors
local clr = imgui.Col
local ImVec4 = imgui.ImVec4
style.WindowRounding = 2.0
style.WindowTitleAlign = imgui.ImVec2(0.5, 0.84)
style.ChildWindowRounding = 2.0
style.FrameRounding = 2.0
style.ItemSpacing = imgui.ImVec2(5.0, 4.0)
style.ScrollbarSize = 13.0
style.ScrollbarRounding = 0
style.GrabMinSize = 8.0
style.GrabRounding = 1.0
colors[clr.FrameBg] = ImVec4(0.16, 0.48, 0.42, 0.54)
colors[clr.FrameBgHovered] = ImVec4(0.26, 0.98, 0.85, 0.40)
colors[clr.FrameBgActive] = ImVec4(0.26, 0.98, 0.85, 0.67)
colors[clr.TitleBg] = ImVec4(0.04, 0.04, 0.04, 1.00)
colors[clr.TitleBgActive] = ImVec4(0.16, 0.48, 0.42, 1.00)
colors[clr.TitleBgCollapsed] = ImVec4(0.00, 0.00, 0.00, 0.51)
colors[clr.CheckMark] = ImVec4(0.26, 0.98, 0.85, 1.00)
colors[clr.SliderGrab] = ImVec4(0.24, 0.88, 0.77, 1.00)
colors[clr.SliderGrabActive] = ImVec4(0.26, 0.98, 0.85, 1.00)
colors[clr.Button] = ImVec4(0.26, 0.98, 0.85, 0.40)
colors[clr.ButtonHovered] = ImVec4(0.26, 0.98, 0.85, 1.00)
colors[clr.ButtonActive] = ImVec4(0.06, 0.98, 0.82, 1.00)
colors[clr.Header] = ImVec4(0.26, 0.98, 0.85, 0.31)
colors[clr.HeaderHovered] = ImVec4(0.26, 0.98, 0.85, 0.80)
colors[clr.HeaderActive] = ImVec4(0.26, 0.98, 0.85, 1.00)
colors[clr.Separator] = colors[clr.Border]
colors[clr.SeparatorHovered] = ImVec4(0.10, 0.75, 0.63, 0.78)
colors[clr.SeparatorActive] = ImVec4(0.10, 0.75, 0.63, 1.00)
colors[clr.ResizeGrip] = ImVec4(0.26, 0.98, 0.85, 0.25)
colors[clr.ResizeGripHovered] = ImVec4(0.26, 0.98, 0.85, 0.67)
colors[clr.ResizeGripActive] = ImVec4(0.26, 0.98, 0.85, 0.95)
colors[clr.PlotLines] = ImVec4(0.61, 0.61, 0.61, 1.00)
colors[clr.PlotLinesHovered] = ImVec4(1.00, 0.81, 0.35, 1.00)
colors[clr.TextSelectedBg] = ImVec4(0.26, 0.98, 0.85, 0.35)
colors[clr.Text] = ImVec4(1.00, 1.00, 1.00, 1.00)
colors[clr.TextDisabled] = ImVec4(0.50, 0.50, 0.50, 1.00)
colors[clr.WindowBg] = ImVec4(0.06, 0.06, 0.06, 0.94)
colors[clr.ChildWindowBg] = ImVec4(1.00, 1.00, 1.00, 0.00)
colors[clr.PopupBg] = ImVec4(0.08, 0.08, 0.08, 0.94)
colors[clr.ComboBg] = colors[clr.PopupBg]
colors[clr.Border] = ImVec4(0.43, 0.43, 0.50, 0.50)
colors[clr.BorderShadow] = ImVec4(0.00, 0.00, 0.00, 0.00)
colors[clr.MenuBarBg] = ImVec4(0.14, 0.14, 0.14, 1.00)
colors[clr.ScrollbarBg] = ImVec4(0.02, 0.02, 0.02, 0.53)
colors[clr.ScrollbarGrab] = ImVec4(0.31, 0.31, 0.31, 1.00)
colors[clr.ScrollbarGrabHovered] = ImVec4(0.41, 0.41, 0.41, 1.00)
colors[clr.ScrollbarGrabActive] = ImVec4(0.51, 0.51, 0.51, 1.00)
colors[clr.CloseButton] = ImVec4(0.41, 0.41, 0.41, 0.50)
colors[clr.CloseButtonHovered] = ImVec4(0.98, 0.39, 0.36, 1.00)
colors[clr.CloseButtonActive] = ImVec4(0.98, 0.39, 0.36, 1.00)
colors[clr.PlotHistogram] = ImVec4(0.90, 0.70, 0.00, 1.00)
colors[clr.PlotHistogramHovered] = ImVec4(1.00, 0.60, 0.00, 1.00)
colors[clr.ModalWindowDarkening] = ImVec4(0.80, 0.80, 0.80, 0.35)
end
function lightBlue()
imgui.SwitchContext()
local style = imgui.GetStyle()
local colors = style.Colors
local clr = imgui.Col
local ImVec4 = imgui.ImVec4
colors[clr.Text] = ImVec4(1.00, 1.00, 1.00, 1.00)
colors[clr.TextDisabled] = ImVec4(0.60, 0.60, 0.60, 1.00)
colors[clr.WindowBg] = ImVec4(0.11, 0.10, 0.11, 1.00)
colors[clr.ChildWindowBg] = ImVec4(0.00, 0.00, 0.00, 0.00)
colors[clr.PopupBg] = ImVec4(0.00, 0.00, 0.00, 0.00)
colors[clr.Border] = ImVec4(0.86, 0.86, 0.86, 1.00)
colors[clr.BorderShadow] = ImVec4(0.00, 0.00, 0.00, 0.00)
colors[clr.FrameBg] = ImVec4(0.21, 0.20, 0.21, 0.60)
colors[clr.FrameBgHovered] = ImVec4(0.00, 0.46, 0.65, 1.00)
colors[clr.FrameBgActive] = ImVec4(0.00, 0.46, 0.65, 1.00)
colors[clr.TitleBg] = ImVec4(0.00, 0.46, 0.65, 1.00)
colors[clr.TitleBgCollapsed] = ImVec4(0.00, 0.46, 0.65, 1.00)
colors[clr.TitleBgActive] = ImVec4(0.00, 0.46, 0.65, 1.00)
colors[clr.MenuBarBg] = ImVec4(0.00, 0.46, 0.65, 1.00)
colors[clr.ScrollbarBg] = ImVec4(0.00, 0.46, 0.65, 0.00)
colors[clr.ScrollbarGrab] = ImVec4(0.00, 0.46, 0.65, 0.44)
colors[clr.ScrollbarGrabHovered] = ImVec4(0.00, 0.46, 0.65, 0.74)
colors[clr.ScrollbarGrabActive] = ImVec4(0.00, 0.46, 0.65, 1.00)
colors[clr.ComboBg] = ImVec4(0.15, 0.14, 0.15, 1.00)
colors[clr.CheckMark] = ImVec4(0.00, 0.46, 0.65, 1.00)
colors[clr.SliderGrab] = ImVec4(0.00, 0.46, 0.65, 1.00)
colors[clr.SliderGrabActive] = ImVec4(0.00, 0.46, 0.65, 1.00)
colors[clr.Button] = ImVec4(0.00, 0.46, 0.65, 1.00)
colors[clr.ButtonHovered] = ImVec4(0.00, 0.46, 0.65, 1.00)
colors[clr.ButtonActive] = ImVec4(0.00, 0.46, 0.65, 1.00)
colors[clr.Header] = ImVec4(0.00, 0.46, 0.65, 1.00)
colors[clr.HeaderHovered] = ImVec4(0.00, 0.46, 0.65, 1.00)
colors[clr.HeaderActive] = ImVec4(0.00, 0.46, 0.65, 1.00)
colors[clr.ResizeGrip] = ImVec4(1.00, 1.00, 1.00, 0.30)
colors[clr.ResizeGripHovered] = ImVec4(1.00, 1.00, 1.00, 0.60)
colors[clr.ResizeGripActive] = ImVec4(1.00, 1.00, 1.00, 0.90)
colors[clr.CloseButton] = ImVec4(1.00, 0.10, 0.24, 0.00)
colors[clr.CloseButtonHovered] = ImVec4(0.00, 0.10, 0.24, 0.00)
colors[clr.CloseButtonActive] = ImVec4(1.00, 0.10, 0.24, 0.00)
colors[clr.PlotLines] = ImVec4(0.00, 0.00, 0.00, 0.00)
colors[clr.PlotLinesHovered] = ImVec4(0.00, 0.00, 0.00, 0.00)
colors[clr.PlotHistogram] = ImVec4(0.00, 0.00, 0.00, 0.00)
colors[clr.PlotHistogramHovered] = ImVec4(0.00, 0.00, 0.00, 0.00)
colors[clr.TextSelectedBg] = ImVec4(0.00, 0.00, 0.00, 0.00)
colors[clr.ModalWindowDarkening] = ImVec4(0.00, 0.00, 0.00, 0.00)
end
function redTheme()
imgui.SwitchContext()
local style = imgui.GetStyle()
local colors = style.Colors
local clr = imgui.Col
local ImVec4 = imgui.ImVec4
local ImVec2 = imgui.ImVec2
style.WindowPadding = ImVec2(15, 15)
style.WindowRounding = 5.0
style.FramePadding = ImVec2(5, 5)
style.FrameRounding = 4.0
style.ItemSpacing = ImVec2(12, 8)
style.ItemInnerSpacing = ImVec2(8, 6)
style.IndentSpacing = 25.0
style.ScrollbarSize = 15.0
style.ScrollbarRounding = 9.0
style.GrabMinSize = 5.0
style.GrabRounding = 3.0
colors[clr.Text] = ImVec4(0.80, 0.80, 0.83, 1.00)
colors[clr.TextDisabled] = ImVec4(0.24, 0.23, 0.29, 1.00)
colors[clr.WindowBg] = ImVec4(0.06, 0.05, 0.07, 1.00)
colors[clr.ChildWindowBg] = ImVec4(0.07, 0.07, 0.09, 1.00)
colors[clr.PopupBg] = ImVec4(0.07, 0.07, 0.09, 1.00)
colors[clr.Border] = ImVec4(0.80, 0.80, 0.83, 0.88)
colors[clr.BorderShadow] = ImVec4(0.92, 0.91, 0.88, 0.00)
colors[clr.FrameBg] = ImVec4(0.10, 0.09, 0.12, 1.00)
colors[clr.FrameBgHovered] = ImVec4(0.24, 0.23, 0.29, 1.00)
colors[clr.FrameBgActive] = ImVec4(0.56, 0.56, 0.58, 1.00)
colors[clr.TitleBg] = ImVec4(0.10, 0.09, 0.12, 1.00)
colors[clr.TitleBgCollapsed] = ImVec4(1.00, 0.98, 0.95, 0.75)
colors[clr.TitleBgActive] = ImVec4(0.07, 0.07, 0.09, 1.00)
colors[clr.MenuBarBg] = ImVec4(0.10, 0.09, 0.12, 1.00)
colors[clr.ScrollbarBg] = ImVec4(0.10, 0.09, 0.12, 1.00)
colors[clr.ScrollbarGrab] = ImVec4(0.80, 0.80, 0.83, 0.31)
colors[clr.ScrollbarGrabHovered] = ImVec4(0.56, 0.56, 0.58, 1.00)
colors[clr.ScrollbarGrabActive] = ImVec4(0.06, 0.05, 0.07, 1.00)
colors[clr.ComboBg] = ImVec4(0.19, 0.18, 0.21, 1.00)
colors[clr.CheckMark] = ImVec4(0.80, 0.80, 0.83, 0.31)
colors[clr.SliderGrab] = ImVec4(0.80, 0.80, 0.83, 0.31)
colors[clr.SliderGrabActive] = ImVec4(0.06, 0.05, 0.07, 1.00)
colors[clr.Button] = ImVec4(0.10, 0.09, 0.12, 1.00)
colors[clr.ButtonHovered] = ImVec4(0.24, 0.23, 0.29, 1.00)
colors[clr.ButtonActive] = ImVec4(0.56, 0.56, 0.58, 1.00)
colors[clr.Header] = ImVec4(0.10, 0.09, 0.12, 1.00)
colors[clr.HeaderHovered] = ImVec4(0.56, 0.56, 0.58, 1.00)
colors[clr.HeaderActive] = ImVec4(0.06, 0.05, 0.07, 1.00)
colors[clr.ResizeGrip] = ImVec4(0.00, 0.00, 0.00, 0.00)
colors[clr.ResizeGripHovered] = ImVec4(0.56, 0.56, 0.58, 1.00)
colors[clr.ResizeGripActive] = ImVec4(0.06, 0.05, 0.07, 1.00)
colors[clr.CloseButton] = ImVec4(0.40, 0.39, 0.38, 0.16)
colors[clr.CloseButtonHovered] = ImVec4(0.40, 0.39, 0.38, 0.39)
colors[clr.CloseButtonActive] = ImVec4(0.40, 0.39, 0.38, 1.00)
colors[clr.PlotLines] = ImVec4(0.40, 0.39, 0.38, 0.63)
colors[clr.PlotLinesHovered] = ImVec4(0.25, 1.00, 0.00, 1.00)
colors[clr.PlotHistogram] = ImVec4(0.40, 0.39, 0.38, 0.63)
colors[clr.PlotHistogramHovered] = ImVec4(0.25, 1.00, 0.00, 1.00)
colors[clr.TextSelectedBg] = ImVec4(0.25, 1.00, 0.00, 0.43)
colors[clr.ModalWindowDarkening] = ImVec4(1.00, 0.98, 0.95, 0.73)
end
function ShowHelpMarker(desc)
imgui.TextDisabled('(?)')
if imgui.IsItemHovered() then
imgui.BeginTooltip()
imgui.PushTextWrapPos(450.0)
imgui.TextUnformatted(desc)
imgui.PopTextWrapPos()
imgui.EndTooltip()
end
end
function GetTheme()
if HLcfg.main.theme == 1 then apply_custom_style()
elseif HLcfg.main.theme == 2 then lightBlue()
elseif HLcfg.main.theme == 3 then redTheme() end
end
GetTheme()
function imgui.OnDrawFrame()
if main_window_state.v then
imgui.SetNextWindowSize(imgui.ImVec2(410, 230), imgui.Cond.FirstUseEver) --низ по 25
imgui.Begin(u8'[Arizona RP] Тренер капчи | '..version..'##main', main_window_state, imgui.WindowFlags.NoCollapse)
imgui.SetWindowPos(u8'[Arizona RP] Тренер капчи | '..version..'##main', imgui.ImVec2(420, 170), imgui.Cond.FirstUseEver)
if imgui.TreeNode(u8'Тренировка капчи') then
imgui.Text(u8'Кнопка')
if imgui.InputText('##3', keybuff, imgui.SameLine()) then
HLcfg.main.key = string.format('%s', tostring(keybuff.v))
end
ShowHelpMarker(u8'Кнопка по которой будет открыватся капча.', imgui.SameLine())
if imgui.Checkbox(u8'Открывать капчу по кнопке', imgui.ImBool(HLcfg.main.onkey)) then
HLcfg.main.onkey = not HLcfg.main.onkey
end
if imgui.Button(u8'Открыть капчу') then showCaptcha() end
if imgui.Button(u8'Очистить текстдравы', imgui.SameLine()) then for i = 1, 400 do sampTextdrawDelete(i) end end
imgui.TreePop()
end
imgui.Separator()
if imgui.TreeNode(u8'Сменить тему') then
if HLcfg.main.theme ~= 1 then apply_custom_style() end
if imgui.Button(u8'Светлая тема') then HLcfg.main.theme = 1; apply_custom_style() end
GetTheme()
if HLcfg.main.theme ~= 2 then lightBlue() end
if imgui.Button(u8'Светло-синяя тема', imgui.SameLine()) then HLcfg.main.theme = 2; lightBlue() end
GetTheme()
if HLcfg.main.theme ~= 3 then redTheme() end
if imgui.Button(u8'Крутая тема', imgui.SameLine()) then HLcfg.main.theme = 3; redTheme() end
GetTheme()
imgui.TreePop()
end
imgui.End()
end
end
function randomFloat(lower, greater)
return lower + math.random() * (greater - lower);
end
function showCaptcha()
removeTextdraws()
t = t + 1
sampTextdrawCreate(t, "LD_SPAC:white", 220, 120)
sampTextdrawSetLetterSizeAndColor(t, 0, 6.5, 0x80808080)
sampTextdrawSetBoxColorAndSize(t, 1, 0xFF1A2432, 380, 0.000000)
t = t + 1
sampTextdrawCreate(t, "LD_SPAC:white", 225, 125)
sampTextdrawSetLetterSizeAndColor(t, 0, 5.5, 0x80808080)
sampTextdrawSetBoxColorAndSize(t, 1, 0xFF759DA3, 375, 0.000000)
nextPos = -30.0;
math.randomseed(os.time())
for i = 1, 4 do
a = math.random(0, 9)
table.insert(captchaTable, a)
captcha = captcha..a
end
for i = 0, 4 do
nextPos = nextPos + 30
t = t + 1
sampTextdrawCreate(t, "usebox", 240 + nextPos, 130)
sampTextdrawSetLetterSizeAndColor(t, 0, 4.5, 0x80808080)
sampTextdrawSetBoxColorAndSize(t, 1, 0xFF1A2432, 30, 25.000000)
sampTextdrawSetAlign(t, 2)
if i < 4 then GenerateTextDraw(captchaTable[i + 1], 240 + nextPos, 130, 3 + i * 2)
else GenerateTextDraw(0, 240 + nextPos, 130, 3 + i * 10) end
end
captchaTable = {}
sampShowDialog(8812, '{F89168}Проверка на робота', '{FFFFFF}Введите {C6FB4A}5{FFFFFF} символов, которые\nвидно на {C6FB4A}вашем{FFFFFF} экране.', 'Принять', 'Отмена', 1)
captime = os.clock()
end
function removeTextdraws()
if t > 0 then
for i = 1, t do sampTextdrawDelete(i) end
t = 0
captcha = ''
captime = nil
end
end
function GenerateTextDraw(id, PosX, PosY)
if id == 0 then
t = t + 1
sampTextdrawCreate(t, "LD_SPAC:white", PosX - 5, PosY + 7)
sampTextdrawSetLetterSizeAndColor(t, 0, 3, 0x80808080)
sampTextdrawSetBoxColorAndSize(t, 1, 0xFF759DA3, PosX+5, 0.000000)
elseif id == 1 then
for i = 0, 1 do
t = t + 1
if i == 0 then offsetX = 3; offsetBX = 15 else offsetX = -3; offsetBX = -15; end
sampTextdrawCreate(t, "LD_SPAC:white", PosX - offsetX, PosY)
sampTextdrawSetLetterSizeAndColor(t, 0, 4.5, 0x80808080)
sampTextdrawSetBoxColorAndSize(t, 1, 0xFF759DA3, PosX-offsetBX, 0.000000)
end
elseif id == 2 then
for i = 0, 1 do
t = t + 1
if i == 0 then offsetX = -8; offsetY = 7 offsetBX = 15 else offsetX = 6; offsetY = 25 offsetBX = -15; end
sampTextdrawCreate(t, "LD_SPAC:white", PosX - offsetX, PosY + offsetY)
sampTextdrawSetLetterSizeAndColor(t, 0, 0.8, 0x80808080)
sampTextdrawSetBoxColorAndSize(t, 1, 0xFF759DA3, PosX-offsetBX, 0.000000)
end
elseif id == 3 then
for i = 0, 1 do
t = t + 1
if i == 0 then size = 0.8; offsetY = 7 else size = 1; offsetY = 25 end
sampTextdrawCreate(t, "LD_SPAC:white", PosX+10, PosY+offsetY)
sampTextdrawSetLetterSizeAndColor(t, 0, 1, 0x80808080)
sampTextdrawSetBoxColorAndSize(t, 1, 0xFF759DA3, PosX-15, 0.000000)
end
elseif id == 4 then
for i = 0, 1 do
t = t + 1
if i == 0 then size = 1.8; offsetX = -10; offsetY = 0 offsetBX = 10 else size = 2; offsetX = -10; offsetY = 25 offsetBX = 15; end
sampTextdrawCreate(t, "LD_SPAC:white", PosX - offsetX, PosY + offsetY)
sampTextdrawSetLetterSizeAndColor(t, 0, size, 0x80808080)
sampTextdrawSetBoxColorAndSize(t, 1, 0xFF759DA3, PosX-offsetBX, 0.000000)
end
elseif id == 5 then
for i = 0, 1 do
t = t + 1
if i == 0 then size = 0.8; offsetX = 8; offsetY = 7 offsetBX = -15 else size = 1; offsetX = -10; offsetY = 25 offsetBX = 15; end
sampTextdrawCreate(t, "LD_SPAC:white", PosX - offsetX, PosY + offsetY)
sampTextdrawSetLetterSizeAndColor(t, 0, size, 0x80808080)
sampTextdrawSetBoxColorAndSize(t, 1, 0xFF759DA3, PosX-offsetBX, 0.000000)
end
elseif id == 6 then
for i = 0, 1 do
t = t + 1
if i == 0 then size = 0.8; offsetX = 7.5; offsetY = 7 offsetBX = -15 else size = 1; offsetX = -10; offsetY = 25 offsetBX = 10; end
sampTextdrawCreate(t, "LD_SPAC:white", PosX - offsetX, PosY + offsetY)
sampTextdrawSetLetterSizeAndColor(t, 0, size, 0x80808080)
sampTextdrawSetBoxColorAndSize(t, 1, 0xFF759DA3, PosX-offsetBX, 0.000000)
end
elseif id == 7 then
t = t + 1
sampTextdrawCreate(t, "LD_SPAC:white", PosX - 13, PosY + 7)
sampTextdrawSetLetterSizeAndColor(t, 0, 3.75, 0x80808080)
sampTextdrawSetBoxColorAndSize(t, 1, 0xFF759DA3, PosX+5, 0.000000)
elseif id == 8 then
for i = 0, 1 do
t = t + 1
if i == 0 then size = 0.8; offsetY = 7 else size = 1; offsetY = 25 end
sampTextdrawCreate(t, "LD_SPAC:white", PosX+10, PosY+offsetY)
sampTextdrawSetLetterSizeAndColor(t, 0, 1, 0x80808080)
sampTextdrawSetBoxColorAndSize(t, 1, 0xFF759DA3, PosX-10, 0.000000)
end
elseif id == 9 then
for i = 0, 1 do
t = t + 1
if i == 0 then size = 0.8; offsetY = 6; offsetBX = 10; else size = 1; offsetY = 25; offsetBX = 15; end
sampTextdrawCreate(t, "LD_SPAC:white", PosX+10, PosY+offsetY)
sampTextdrawSetLetterSizeAndColor(t, 0, 1, 0x80808080)
sampTextdrawSetBoxColorAndSize(t, 1, 0xFF759DA3, PosX-offsetBX, 0.000000)
end
end
end
function main()
if not isSampfuncsLoaded() or not isSampLoaded() then return end
while not isSampAvailable() do wait(100) end
sampRegisterChatCommand("trener", function() main_window_state.v = not main_window_state.v end)
notf.addNotification('Активация: /trener')
notf.addNotification('Скрипт успешно загружен! Текущая версия: ' ..version, 5, 1)
sampAddChatMessage('{ffff00}[Тренер капчи] {ffffff} Fabregoo {20B2AA}J Family {ffff00}| {ffffff}Версия: '..version, -1)
while true do wait(0)
keybuff.v = string.upper(keybuff.v)
if wasKeyPressed(vkeys.name_to_id(keybuff.v, false)) and HLcfg.main.onkey and not sampIsChatInputActive() and not sampIsDialogActive() then showCaptcha() end
local result, button, list, input = sampHasDialogRespond(8812)
if result then
if button == 1 then
if input == captcha..'0' then sampAddChatMessage(string.format('{ffff00}[Тренер капчи] {ffffff}Код верный [%.3f]', os.clock() - captime), -1)
elseif input ~= captcha..'0' then sampAddChatMessage(string.format('{ffff00}[Тренер капчи] {ffffff}Неверный код! [%.3f] ('..captcha..'0|'..input..')', os.clock() - captime), -1) end
end
removeTextdraws()
end
if sampIsDialogActive() and sampGetDialogCaption():find('Проверка на робота') then
if HLcfg.main.nClear then sampSetCurrentDialogEditboxText(string.gsub(sampGetCurrentDialogEditboxText(), '[^1234567890]','')) end
if HLcfg.main.max5 then
local text = sampGetCurrentDialogEditboxText()
if #text > 5 then sampSetCurrentDialogEditboxText(text:sub(1, 5)) end
end
end
imgui.Process = main_window_state.v
end
wait(-1)
end
function onScriptTerminate(script, quitGame)
if script == thisScript() then
inicfg.save(HLcfg, "Trener")
end
end
function onQuitGame()
inicfg.save(HLcfg, "Trener")
end
function GetRedMarkerCoords() -- snippet by SR_team, slightly modified
for i = 0, 31 do
local markerPtr = 0xC7F168 + i * 56
--local markerPtr = 0xC7DEC8 + i * 160
local x = representIntAsFloat(readMemory(markerPtr + 0, 4, false))
local y = representIntAsFloat(readMemory(markerPtr + 4, 4, false))
local z = representIntAsFloat(readMemory(markerPtr + 8, 4, false))
if x ~= 0.0 or y ~= 0.0 or z ~= 0.0 then
requestCollision(x, y); loadScene(x, y, z);
return x, y, z
end
end
return 0, 0, 0
end
function spairs(t, order)
-- collect the keys
local keys = {}
for k in pairs(t) do keys[#keys+1] = k end
-- if order function given, sort by it by passing the table and keys a, b,
-- otherwise just sort the keys
if order then
table.sort(keys, function(a,b) return order(t, a, b) end)
else
table.sort(keys)
end
-- return the iterator function
local i = 0
return function()
i = i + 1
if keys[i] then
return keys[i], t[keys[i]]
end
end
end