Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #wT
- local self = os.getComputerID()
- local m=peripheral.wrap("right")
- print("What is the Turtle's ID:")
- local droid = tonumber(read())
- m.open(self)
- m.open(droid)
- while true do
- print("command("..droid.."):")
- local cmd = read()
- m.transmit(droid,self,cmd)
- local event, modemSide, sendChannel, replyChannel, message, senderDistance = os.pullEvent()
- print("event:"..tostring(event))
- if sendChannel==self and replyChannel==droid then
- print(sendChannel..":"..tostring(message))
- if cmd=="exit" then
- exit()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement