我正在用一些自定义模块制作一个保险库,我正在使用计算机控制门,但我只能打开门而不能关闭。这段代码对吗?
term.setTextColor(colors.yellow)
print("Vault-Tec Door Computer")
term.setTextColor(colors.white)
print("What Command Would You Like To Do?")
term.setTextColor(colors.blue)
print("Vault.Open")
print("Vault.Close")
print("")
term.setTextColor(colors.white)
io.write("Vault-Tec:")
io.close()
if io.read()=="Vault.Open" then
term.setTextColor(colors.red)
print("VAULT DOOR OPENING, PLEASE STAND BACK")
term.setTextColor(colors.white)
redstone.setAnalogOutput("bottom", 0)
sleep(5)
end
if io.read()=="Vault.Close" then
term.setTextColor(colors.red)
print("SHUTTING VAULT DOOR, PLEASE STAND BACK")
term.setTextColor(colors.white)
redstone.setAnalogOutput("bottom", 15)
sleep(5)
end