Advertisement
Doob

[ComputerCraft] remotecommander

May 24th, 2015
302
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.47 KB | None | 0 0
  1. if pocket then
  2.   rednet.open('back')
  3.   while true do
  4.     term.clear()
  5.     term.setCursorPos(1, 1)
  6.     write('enter command: ')
  7.     local cmd = read()
  8.     rednet.broadcast(cmd)
  9.   end
  10. else
  11.   if peripheral.getType('left') == 'modem' then
  12.     rednet.open('left')
  13.   elseif peripheral.getType('right') == 'modem' then
  14.     rednet.open('right')
  15.   else print('modem not found')
  16.   end
  17.     while true do
  18.       id, msg = rednet.receive()
  19.       shell.run(msg)
  20.     end
  21. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement