From 7a12ea8557631b8e75477ea3712dc106796ad422 Mon Sep 17 00:00:00 2001 From: HKXluo Date: Sun, 4 May 2025 19:49:46 +0800 Subject: [PATCH] 1 --- Demo/SanjuuniApi-Demo/demo1.lua | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Demo/SanjuuniApi-Demo/demo1.lua b/Demo/SanjuuniApi-Demo/demo1.lua index 3cd3af4..01ab628 100644 --- a/Demo/SanjuuniApi-Demo/demo1.lua +++ b/Demo/SanjuuniApi-Demo/demo1.lua @@ -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