Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- test
- -- 0.1
- -- Wireless RedNet Test (reciever)
- local senderID = 0
- local startMessage = "<<start>>"
- local isStarted = false
- local modemSide = "back"
- function startup()
- modem = peripheral.wrap(modemSide)
- rednet.open(modemSide)
- end
- function recieveMessage()
- senderID,message = rednet.recieve()
- if message == startMessage then
- isStarted = true
- elseif not message == startMessage then
- isStarted = false
- end
- print("Message recieved...")
- end
- function startThread()
- if isStarted == true then
- while isStarted == true do
- rs.setOutput("right", true)
- sleep(0.5)
- rs.setOutput("right", false)
- end
- else
- print("Invalid start code")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment