【发布时间】:2019-08-28 14:43:30
【问题描述】:
我正在尝试使用 computercraft 在 minecraft 中制作一个钥匙卡门,但它在第 23 行给我一个错误,说是预期的
rs.setOutput("bottom", true)
while true do
if disk.isPresent("top") then
if fs.exists("disk/.cardauth/authkey") then
f = fs.open("disk/.cardauth/authkey", "r")
p = f.readAll()
if p == "UDoFk6ErYM" then
disk.eject("top")
rs.setOutput("bottom", false)
sleep(4)
rs.setOutput("bottom", true)
elseif p == "QmwZNWQsxFug6SMOYQnh" then
disk.eject("top")
break end
else
disk.eject("top")
end
else
disk.eject("top")
end
end
sleep(0.1)
end
【问题讨论】:
-
你
disk.eject("top")在你逻辑的每个分支中。您可以放心地将它放在disk.isPresent("top")正文的末尾。
标签: lua computercraft