Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open('back')
- status = nil
- while true do
- if status == nil then
- print("Send status to #148")
- rednet.send(148, "status")
- local res1, res2 = rednet.receive()
- status = res2
- print("Received status: "..tostring(status).."\nReload..")
- sleep(4)
- end
- if status then
- term.clear()
- term.setCursorPos(1, 1)
- print("CLICCA UN TASTO PER PARTIRE!")
- local event, id, msg = os.pullEvent()
- if event == 'rednet_message' then
- if msg == "invertProp" then
- status = false
- end
- elseif event == 'key' then
- rednet.send(148, "down")
- print("\nL'ascensore sta scendendo...")
- rednet.receive()
- status = false
- end
- else
- term.clear()
- term.setCursorPos(1, 1)
- print("CLICCA UN TASTO PER CHIAMARE")
- local event, id, msg = os.pullEvent()
- if event == 'rednet_message' then
- if msg == "invertProp" then
- status = true
- end
- elseif event == 'key' then
- rednet.send(148, "up")
- print("\nL'ascensore sta salendo...")
- rednet.receive()
- status = true
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement