This commit is contained in:
HKXluo 2025-05-04 19:49:46 +08:00
parent 4c7296ac84
commit 7a12ea8557
No known key found for this signature in database
GPG Key ID: 498DD8DAE5261F38

View File

@ -38,16 +38,21 @@ local width, height = term.getSize() -- 获取终端尺寸width=宽度hei
local width = width * 2 -- 宽度×2
local height = height * 3 -- 高度×3
local download_url = Get_image_url(INPUT_URL,API_URL,width,height)
-- ===== 显示图片 / Display image =====
print("\nConversion successful! Download URL:")
print(download_url)
luafile = http.get(download_url)
if luafile then
-- 保存Lua文件 / Save Lua file
print("\nLua file downloaded successfully.")
local data = luafile.readAll()
print("\nExecuting Lua code...")
load(data)()
f = fs.open("demo.lua", "w")
f.write(luafile.readAll())
f.close()
print("\nLua file saved as demo.lua.")
else
print("\nFailed to download Lua file.")
end