0

私はいくつかのカスタム MOD で保管庫を作成しており、コンピューター クラフト コンピューターを使用してドアを制御していますが、ドアを開くことしかできず、閉じることはできません。このコードは正しいですか?

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
4

1 に答える 1