Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Pastebin: "5CUaFcqL"
- --A=Alpha, B=Beta, F=Finished
- --This version is: A1
- shell.run("clear")
- rednet.close("right")
- rednet.close("left")
- rednet.close("top")
- rednet.close("bottom")
- rednet.close("front")
- rednet.close("back")
- if peripheral.isPresent("right") then
- rednet.open("right")
- end
- if peripheral.isPresent("left") then
- rednet.open("left")
- end
- if peripheral.isPresent("top") then
- rednet.open("top")
- end
- if peripheral.isPresent("bottom") then
- rednet.open("bottom")
- end
- if peripheral.isPresent("front") then
- rednet.open("front")
- end
- if peripheral.isPresent("back") then
- rednet.open("back")
- end
- local Checking = 0
- function Send()
- term.write("Which message?>")
- A = read()
- rednet.broadcast(A)
- end
- function Receive()
- Pas = 0
- term.write("How many times? <once> or <forever>")
- A12 = read()
- if A12 == "once" then
- x,y,z=rednet.receive()
- print(y)
- end
- if A12 == "forever" then
- while Pas == 0 do
- x,y,z=rednet.receive()
- print(y)
- end
- end
- end
- function AndersMail()
- term.write("Which mode? <receive> or <send>")
- Amail = read()
- if Amail == "receive" then
- Receive()
- Checking = Checking+1
- end
- if Amail == "send" then
- Send()
- Checking = Checking+1
- end
- if Checking == 0 then
- print("Error: Invalid mode...")
- end
- end
- AndersMail()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement