【发布时间】:2018-10-15 06:31:13
【问题描述】:
我正在使用一些自定义模块制作保险库,并且正在使用计算机控制门,但我只能打开门而不能关闭。这段代码对吗?
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
【问题讨论】:
标签: lua minecraft computercraft