script_name('MeatbagAFK')
script_author('Marcus_Devil')
script_version('1.1')
require "lib.moonloader"
require "lib.sampfuncs"
local sampev = require 'lib.samp.events'
local inicfg = require 'inicfg'
local tag = "{1faee9}[MeatbagAFK]: "
an = 0
function sampev.onShowDialog(dialogId,style,title,button1,button2,text)
if dialogId == 0 and text:find("голодны") and an == 1 then
sampSendChat("/cheeps")
lua_thread.create(function()
wait(4663)
setVirtualKeyDown(13, true)
setVirtualKeyDown(13, false)
wait(8783)
sampSendChat("/anims 78")
end)
endм
end
function main()
if not isSampLoaded() or not isSampfuncsLoaded() then return end
while not isSampAvailable() do wait(100) end
sampAddChatMessage(tag.."Успешно загружен! Команда для включения - /aon",-1)
sampRegisterChatCommand("aon",aond)
while true do
if an == 1 then
sampSendChat("/satiety")
wait(1000)
if sampIsDialogActive() then
setVirtualKeyDown(13, true)
setVirtualKeyDown(13, false)
end
wait(900000) -- 15 минут, 30 минут = 1800000
end
wait(0)
end
end
function aond()
if an == 0 then an = 1 else an = 0 end
if an == 0 then aa = "{FF0000}Выключен" else aa = "{00FF00}Включен" end
sampAddChatMessage("Скрипт "..aa, -1)
end