Maksim_McDale |
Дата: Вторник, 07.01.2020, 14:13 | Сообщение # 3
|
Боец
Сообщений: 112
Статус: Offline
|
Цитата BazanovBlyat ( ) Новорег и сразу скрипт, подозрительно блинб
Лучше бы проверил, а не сообщения набивал...
Открытый код
Код require "lib.moonloader" local encoding = require "encoding" local inicfg = require "inicfg" local directIni = "moonloader\\Spamer.ini" local sampev = require "lib.samp.events" local imgui = require "imgui" local fa = require 'fAwesome5' imgui.ToggleButton = require('imgui_addons').ToggleButton encoding.default = 'CP1251' u8 = encoding.UTF8
if not doesFileExist("moonloader\\Spamer.ini") then file = io.open("moonloader\\Spamer.ini", "a") file:write("[vr]\ntext=\ntime=1\nsave=\n[fam]\ntext=\ntime=1\nsave=\n[ad]\ntext=\ntime=1\nsave=\ntype=0\n[s]\ntext=\ntime=1\nsave=") file:close() end local mainIni = inicfg.load(nil, directIni)
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.29, 0.48, 0.54) colors[clr.FrameBgHovered] = ImVec4(0.26, 0.59, 0.98, 0.40) colors[clr.FrameBgActive] = ImVec4(0.26, 0.59, 0.98, 0.67) colors[clr.TitleBg] = ImVec4(0.04, 0.04, 0.04, 1.00) colors[clr.TitleBgActive] = ImVec4(0.16, 0.29, 0.48, 1.00) colors[clr.TitleBgCollapsed] = ImVec4(0.00, 0.00, 0.00, 0.51) colors[clr.CheckMark] = ImVec4(0.26, 0.59, 0.98, 1.00) colors[clr.SliderGrab] = ImVec4(0.24, 0.52, 0.88, 1.00) colors[clr.SliderGrabActive] = ImVec4(0.26, 0.59, 0.98, 1.00) colors[clr.Button] = ImVec4(0.26, 0.59, 0.98, 0.40) colors[clr.ButtonHovered] = ImVec4(0.26, 0.59, 0.98, 1.00) colors[clr.ButtonActive] = ImVec4(0.06, 0.53, 0.98, 1.00) colors[clr.Header] = ImVec4(0.26, 0.59, 0.98, 0.31) colors[clr.HeaderHovered] = ImVec4(0.26, 0.59, 0.98, 0.80) colors[clr.HeaderActive] = ImVec4(0.26, 0.59, 0.98, 1.00) colors[clr.Separator] = colors[clr.Border] colors[clr.SeparatorHovered] = ImVec4(0.26, 0.59, 0.98, 0.78) colors[clr.SeparatorActive] = ImVec4(0.26, 0.59, 0.98, 1.00) colors[clr.ResizeGrip] = ImVec4(0.26, 0.59, 0.98, 0.25) colors[clr.ResizeGripHovered] = ImVec4(0.26, 0.59, 0.98, 0.67) colors[clr.ResizeGripActive] = ImVec4(0.26, 0.59, 0.98, 0.95) colors[clr.TextSelectedBg] = ImVec4(0.26, 0.59, 0.98, 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.PlotLines] = ImVec4(0.61, 0.61, 0.61, 1.00) colors[clr.PlotLinesHovered] = ImVec4(1.00, 0.43, 0.35, 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 apply_custom_style()
imgui.Process = true --local w, h = getScreenResolution() imgui_active = imgui.ImBool(false) local spam = {{"vr", imgui.ImBool(false), imgui.ImBuffer(96), imgui.ImInt(mainIni.vr.time)}, {"fam", imgui.ImBool(false), imgui.ImBuffer(95), imgui.ImInt(mainIni.fam.time)}, {"ad", imgui.ImBool(false), imgui.ImBuffer(94), imgui.ImInt(mainIni.ad.time), imgui.ImInt(mainIni.ad.type)}, {"s", imgui.ImBool(false), imgui.ImBuffer(95), imgui.ImInt(mainIni.s.time)}} local spam_slot = 0
for i = 1, 4 do spam[i][3].v = tostring(mainIni[spam[i][1]].text) end
sampRegisterChatCommand("spam", function() imgui_active.v = not imgui_active.v imgui.Process = imgui_active.v end)
local fa_font = nil local fa_glyph_ranges = imgui.ImGlyphRanges({ fa.min_range, fa.max_range }) function imgui.BeforeDrawFrame() if fa_font == nil then local font_config = imgui.ImFontConfig() font_config.MergeMode = true fa_font = imgui.GetIO().Fonts:AddFontFromFileTTF('moonloader/lib/fa-solid-900.ttf', 13.0, font_config, fa_glyph_ranges) end end
function main() if not isSampLoaded() or not isSampfuncsLoaded() then return end while not isSampAvailable() do wait(100) end sampAddChatMessage("[Spamer] {FFFFFF}Загружен Автор: {FF9933}Artem_Williams", 0x3399FF) lua_thread.create(function() while true do wait(0) if spam[1][2].v then sampSendChat("/vr " .. u8:decode(spam[1][3].v)) wait(spam[1][4].v*1000) end end end) lua_thread.create(function() while true do wait(0) if spam[2][2].v then sampSendChat("/fam " .. u8:decode(spam[2][3].v)) wait(spam[2][4].v*1000) end end end) lua_thread.create(function() while true do wait(0) if spam[3][2].v then sampSendChat("/ad " .. spam[3][5].v .. " " .. u8:decode(spam[3][3].v)) wait(spam[3][4].v*1000) end end end) lua_thread.create(function() while true do wait(0) if spam[4][2].v then sampSendChat("/s " .. u8:decode(spam[4][3].v)) wait(spam[4][4].v*1000) end end end) end
function imgui.OnDrawFrame() if imgui_active.v then imgui.SetNextWindowSize(imgui.ImVec2(377, 221), imgui.Cond.FirstUseEver) imgui.SetNextWindowPos(imgui.ImVec2(42, 482), imgui.Cond.FirstUseEver) imgui.Begin(fa.ICON_FA_BULLHORN .. u8" Спамер", imgui_active, imgui.WindowFlags.NoResize) imgui.BeginChild("", imgui.ImVec2(40, 185), true) for i = 1, 4 do if imgui.Selectable("/" .. spam[i][1]) then spam_slot = i end end imgui.EndChild() imgui.SameLine() imgui.BeginChild(" ", imgui.ImVec2(316, 185), true) if spam_slot ~= 0 then if imgui.ToggleButton(" ", spam[spam_slot][2]) then if spam[spam_slot][3].v == "" then spam[spam_slot][2].v = false sampAddChatMessage("[Spamer] {FFFFFF}Введите текст.", 0x3399FF) elseif spam[spam_slot][2].v then sampAddChatMessage("[Spamer] {FFFFFF}Спам в {FF9933}/" .. spam[spam_slot][1] .. " {FFFFFF}чат включён.", 0x3399FF) else sampAddChatMessage("[Spamer] {FFFFFF}Спам в {FF9933}/" .. spam[spam_slot][1] .. " {FFFFFF}чат отключён.", 0x3399FF) end end imgui.SameLine() imgui.Text(u8"Включить спам в") imgui.SameLine() imgui.TextColored(imgui.ImVec4(1, 0.6, 0.2, 1), "/" .. spam[spam_slot][1]) imgui.SameLine() imgui.Text(u8"чат") imgui.Text(u8"Введите текст:") imgui.PushItemWidth(300) if imgui.InputText(" ", spam[spam_slot][3]) then if spam[spam_slot][3].v == "" and spam[spam_slot][2].v then spam[spam_slot][2].v = false sampAddChatMessage("[Spamer] {FFFFFF}Спам в {FF9933}/" .. spam[spam_slot][1] .. " {FFFFFF}чат отключён.", 0x3399FF) sampAddChatMessage("[Spamer] {FFFFFF}Введите текст.", 0x3399FF) end mainIni[spam[spam_slot][1]].text = spam[spam_slot][3].v inicfg.save(mainIni, directIni) end imgui.PopItemWidth() if imgui.Button(fa.ICON_FA_DOWNLOAD .. u8" Сохранить", imgui.ImVec2(148, 20)) then mainIni[spam[spam_slot][1]].save = spam[spam_slot][3].v inicfg.save(mainIni, directIni) end imgui.SameLine() if imgui.Button(fa.ICON_FA_UPLOAD .. u8" Загрузить", imgui.ImVec2(147, 20)) then spam[spam_slot][3].v = mainIni[spam[spam_slot][1]].save end if spam_slot == 3 then imgui.Text(u8"Выберите тип объявления:") imgui.PushItemWidth(300) if imgui.Combo(" ", spam[3][5], {u8"Обычное объявление", u8"VIP объявление"}) then mainIni.ad.type = spam[3][5].v inicfg.save(mainIni, directIni) end imgui.PopItemWidth() end imgui.Text(u8"Выберете задежку: (в секундах)") imgui.PushItemWidth(300) if imgui.SliderInt(" ", spam[spam_slot][4], 1, 60) then mainIni[spam[spam_slot][1]].time = spam[spam_slot][4].v inicfg.save(mainIni, directIni) end imgui.PopItemWidth() end imgui.EndChild() imgui.End() else imgui.Process = false end end
|
|
|
|