我一直在学习 LUA,想清除控制台



我一直很累地清理控制台以使其更整洁,我尝试了os.execute("clear")(类似于我在python中使用的(这就是整个程序:

while( true )
do
local opacity
print("What do you want the opacity to be? (invisible is 1, solid is 0)")
opacity = io.read()
opacity = tonumber(opacity)
if opacity >1 then
print("Thats not correct, try again")
os.execute("clear")
elseif opacity <=1 then
print(opacity)
end
end

已找到解决方案:要求=操作系统命令需要添加操作系统才能工作

在Windows上:

os.execute("cls")

在Unix上:

os.execute("clear")

最新更新