Posted 01 November 2017 - 02:39 PM
Hello everyone,
I've been trying to make a loop in a program, I want it to wait that my main computer sends the message "true" on protocol "tickets" and if it's the case, power up some redstone.
Here's the code :
Thank you for your help! :D/>
I've been trying to make a loop in a program, I want it to wait that my main computer sends the message "true" on protocol "tickets" and if it's the case, power up some redstone.
Here's the code :
while true do
if rednet.isOpen() == false then
rednet.open("top")
end
local senderId, message, protocol = rednet.receive("tickets")
if message == "true" then
redstone.setOutput("back", true)
os.sleep(0.5)
redstone.setOutput("back", false)
end
end
Thank you for your help! :D/>