This commit is contained in:
navid.sassan 2021-04-02 15:48:31 +02:00
parent da2b8bd48f
commit ef21e47f7d

View File

@ -50,7 +50,7 @@ function recv()
print("Pong!")
rednet.send(master, "Pong!")
elseif data == 'toggle' then
local output_state = !redstone.getInput("back")
local output_state = not redstone.getInput("back")
redstone.setOutput("back", output_state)
print("Toggled output to: " .. output_state)
rednet.send(master, "Toggled output to: " .. output_state)
@ -66,7 +66,7 @@ function lever_input()
local new_lever_state = redstone.getInput("top")
if new_lever_state != lever_state then
lever_state = new_lever_state
local output_state = !redstone.getInput("back")
local output_state = not redstone.getInput("back")
redstone.setOutput("back", output_state)
print("Toggled output to: " .. output_state)
rednet.send(master, "Toggled output to: " .. output_state)