Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local id = 57
- rednet.open('back')
- while true do
- os.pullEvent('mouse_click')
- rednet.send(id,'','door')
- local errorT=0
- local retValue=false
- repeat
- errorT=errorT+1
- local pid,newValue,tag = rednet.receive(1)
- retValue=newValue
- until (pid==id and tag=='return') or errorT > 10
- if errorT < 10 then
- if retValue then
- term.setTextColor(colors.yellow)
- print('Door Open')
- else
- term.setTextColor(colors.green)
- print('Door Closed')
- end
- else
- term.setTextColor(colors.red)
- print('Failed Response')
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment