Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ID=5
- rednet.open("top")
- term.clear()
- term.setCursorPos(1,1)
- rednet.send(ID,"CONNECT")
- term.clear()
- term.setCursorPos(1,1)
- while true do
- x,y=rednet.receive(5)
- if x==ID then
- P=1
- if y=="PASS" then
- local R=read("*")
- P=0
- rednet.send(x,R)
- end
- if y=="PULL" then
- P=0
- print("PRESS ANY KEY TO CONTINUE...")
- os.pullEvent("char")
- rednet.send(x,"PULLED")
- end
- if y=="CLEAR" then
- P=0
- term.clear()
- term.setCursorPos(1,1)
- end
- if y=="WAIT" then
- P=0
- i,o=rednet.receive()
- if i==ID then
- for t=1,o do
- sleep(0.5)
- end
- end
- end
- if y=="INPUT" then
- R=read()
- P=0
- rednet.send(x,R)
- end
- if y=="EXIT" then
- print("REFUSED...")
- sleep(2)
- print("REBOOTING...")
- sleep(1)
- P=0
- return
- end
- if y=="write" then
- P=0
- i,o=rednet.receive()
- if i==ID then
- write(o)
- end
- end
- if P==1 then
- print(y)
- end
- end
- end
- rednet.close("top")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement