Advertisement
Pilgrimager

wT

Sep 3rd, 2013
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.57 KB | None | 0 0
  1. #wT
  2. local self = os.getComputerID()
  3. local m=peripheral.wrap("right")
  4. print("What is the Turtle's ID:")
  5. local droid = tonumber(read())
  6. m.open(self)
  7. m.open(droid)
  8. while true do
  9.     print("command("..droid.."):")
  10.     local cmd = read()
  11.     m.transmit(droid,self,cmd)
  12.     local event, modemSide, sendChannel, replyChannel, message, senderDistance =  os.pullEvent()
  13.     print("event:"..tostring(event))
  14.     if sendChannel==self and replyChannel==droid then
  15.       print(sendChannel..":"..tostring(message))
  16.       if cmd=="exit" then
  17.           exit()
  18.       end
  19.     end
  20. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement