Кому не сложно, можете пожалуйста максимально подробно объяснить что за что отвечает каждая строка кода?
вот:
local text = '123456'
local step = text:len() + 1
function main()
repeat wait(0) until isSampAvailable()
while true do
wait(0)
if wasKeyPressed(220) and not sampIsDialogActive() and not sampIsChatInputActive() and not isSampfuncsConsoleActive() then
textLength = string.len(text)
step = 0
end
if step <= text:len() then
sampSetChatInputEnabled(true)
sampSetChatInputText(text:sub(1, step))
if textLength == 5 and text ~= ""..text then
lua_thread.create(function ()
sampSetChatInputText(""..text)
wait(100)
sampProcessChatInput(""..text)
end)
end
end
if sampIsDialogActive() then
local id = sampGetCurrentDialogId()
if (id == 1997 or id == 8869 or id == 8868 or id == 27746) then
local t = sampGetCurrentDialogEditboxText()
text = tostring(t)
step = text:len() + 1
end
end
end
end
function onWindowMessage(msg, wparam, lparam)
if msg == 0x100 then
if step < text:len() then
step = step + 1
elseif step == text:len() then
step = step + 1
sampSetChatInputEnabled(false)
sampSetChatInputText("")
sampSendChat(text)
end
end
end