Jharakn

Wireless Carriage Controller

Jul 18th, 2013
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. rednet.open("top")
  2. local engine = peripheral.wrap("bottom")
  3.  
  4. print("computerID is: "..os.getComputerID())
  5. print("ready for wireless instruction..")
  6.  
  7. while true do
  8. local event, senderID, message = os.pullEvent ("rednet_message")
  9. local instruction = {}
  10. instruction = textutils.unserialize(message)
  11. if instruction.direction == nil or instruction.simulate == nil or instruction.anchor == nil then
  12. print("faulty instruction recieved")
  13. else
  14. engine.move(instruction.direction, instruction.simulate, instruction.anchor)
  15. end
  16. end
Advertisement
Add Comment
Please, Sign In to add comment