这是我的代码。我在玩tekkit,想控制水流。棕色线上有红石电源,但黑色没有,但它仍然会出现ERROR!
任何人知道我的问题是什么吗?
在 Lua 代码中:
shell.run("clear")
brown = rs.testBundledInput("back", colors.brown)
black = rs.testBundledInput("back", colors.black)
t = true
f = nil
if brown == t and black == f then
redstone.setBundledOutput("back", restone.getBundledOutput("back") -colors.brown)
print("All water is flowing.")
sleep(3)
shell.run("2")
elseif brown == f and black == t then
redstone.setBundledOutput("back", restone.getBundledOutput("back") -colors.black)
print("All water is flowing.")
sleep(3)
shell.run("2")
elseif brown == t and black == t then
redstone.setBundledOutput("back", restone.getBundledOutput("back") -colors.brown)
redstone.setBundledOutput("back", restone.getBundledOutput("back") -colors.black)
print("All water is flowing.")
sleep(3)
shell.run("2")
elseif brown == f and black == f then
print("All water is flowing.")
sleep(3)
shell.run("2")
else
print("ERROR!")
end