- 73
- 5
- Версия MoonLoader
- .026-beta
Lua:
require 'lib.moonloader'
local dlstatus = require('moonloader').download_status
local vk = require 'vkeys'
function download_handler(id, status, p1, p2)
if stop_downloading then
stop_downloading = false
download_id = nil
return false -- прервать загрузку
end
if status == dlstatus.STATUS_DOWNLOADINGDATA then
print(string.format(' %d/%d.', p1, p2))
elseif status == dlstatus.STATUS_ENDDOWNLOADDATA then
print('Stop')
end
end
function main()
while not isSampAvailable() do wait(0) end
print('Press J')
while true do
wait(0)
if wasKeyPressed(VK_J) and not download_id then
local url = 'https://raw.githubusercontent.com/DeDsEk0/settings_gh/main/toast_notf.lua'
local file_path = getWorkingDirectory() .. '/lib/toast_notf.lua'
download_id = downloadUrlToFile(url, file_path, download_handler)
print('Press F2')
elseif wasKeyPressed(VK_F2) and download_id then
stop_downloading = true
end
end
end
Почему не работает?