Posted 06 October 2013 - 05:53 AM
So my problem is that I am building an elevator with a display, buttons, and what floor it's on. It's pretty messy code now, but I am cleaning it up. My problem is, I need to have a display on every floor, and they communicate via rednet. But I can't wait for a button and get hung up on rednet.receive(). I looked at coroutines, but I don't think they will work.
EDIT:
Sorry, I can't pastebin, my world just corrupted. I'll have to rewrite it. Any suggestions on how to implement the above into my code?
EDIT2:
Found it in my computer file inside my saves
Elevator Main http://pastebin.com/9QaWm0bi
Elevator Trigger
EDIT:
Sorry, I can't pastebin, my world just corrupted. I'll have to rewrite it. Any suggestions on how to implement the above into my code?
EDIT2:
Found it in my computer file inside my saves
Elevator Main http://pastebin.com/9QaWm0bi
Elevator Trigger
rednet.open("top")
rednet.send(56, "1on")
rednet.send(61, "1on")
rednet.send(62, "1on")
rednet.send(69, "1on")
rednet.send(70, "1on")
rednet.send(71, "1on")
rednet.send(72, "1on")
rednet.send(73, "1on")
rednet.send(74, "1on")
rednet.send(75, "1on")
rednet.send(76, "1on")
Elevator Base
rednet.open("bottom")
while true do
local id, message = rednet.receive()
if message == "1on" then
redstone.setOutput("back", true)
else
redstone.setOutput("back", false)
end
end