script_name("{27DFBE}Eater")
script_author("MEHANIK")
script_version("1.0")
require "lib.moonloader"
local imgui = require('mimgui')
local fa = require('fAwesome6_solid')
local u8 = require 'encoding'.UTF8
local ffi = require 'ffi'
local LOGO ="[Eater]";
local author = "MEHANIK"
local version = "version 1.0";
local window = imgui.new.bool();
local script_color = "{27DFBE}"
local color_white = "{ffffff}"
function main()
if not isSampLoaded() or not isSampfuncsLoaded() then return end
while not isSampAvailable() do wait(0) end
sampAddChatMessage('{27DFBE}'..LOGO..' {ffffff}Загрузка прошла успешно!',-1)
sampAddChatMessage('{27DFBE}'..LOGO..' {ffffff}['..version..'] Ожидайте новых доработок',-1)
sampAddChatMessage('' ..script_color..LOGO .. color_white ..' Автор скрипта ' .. author,-1)
-- sampRegisterChatCommand("za",go)
--sampRegisterChatCommand("mb", function() sampSendChat("/members") end)
sampRegisterChatCommand("eater", eater())
while true do
wait(0)
if isKeyDown(VK_ESCAPE) then
window = false;
end
end
end
function onReceivePacket(id, bs)
if id == 220 then
raknetBitStreamReadInt8(bs);
if raknetBitStreamReadInt8(bs) == 17 then
raknetBitStreamReadInt32(bs);
local len, text = raknetBitStreamReadInt32(bs), '';
if len > 0 then
text = raknetBitStreamReadString(bs, len)
local event, data = text:match('window%.executeEvent%(\'([%w.]+)\',%s*\'(.+)\'%)');
if event == 'event.arizonahud.playerSatiety' then
local satiety = data:match('%[(%d+)%]')
if tonumber(satiety) <= 50 then
sampSendChat('/jmeat')
end
end
end
end
end
end
imgui.OnFrame(function ()
return true end,
function (this)
local size, res = imgui.ImVec2(450,250), imgui.ImVec2(getScreenResolution());
imgui.SetNextWindowSize(size, imgui.Cond.FirstUseEver);
imgui.SetNextWindowPos(imgui.ImVec2(res.x /2, res.y / 2), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5,0.5));
if (window) then
if(imgui.Begin("Eater",window, imgui.WindowFlags.NoResize + imgui.WindowFlags.NoCollapse))then
if imgui.Button("Press me") then
-- body
end
end
end
imgui.End();
end
);
function eater( ... )
window[0] = not window[0]
end