Advertisement
Guest User

Computercraft: UBUNOS file: wifi

a guest
Jul 31st, 2015
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.58 KB | None | 0 0
  1. print('Do you want execute receiving message or print message ?\n{1} Execute\n{2} Print')
  2. local choice=read()
  3. if choice=="2" then
  4. while true do
  5. local id, command, pos=rednet.receive()
  6. print('Receiving true !\nThe message is from the computer:')
  7. print(id)
  8. print('Optional message:')
  9. print(pos)
  10. print('Message: ')
  11. print(command)
  12. end
  13. elseif choice=='1' then
  14. while tonumber(label) > 0 do
  15. local label=label-1
  16. local id, command, pos=rednet.receive()
  17. shell.run(command)
  18. print('Command executed:')
  19. print(command)
  20. print('Optional message:')
  21. print(pos)
  22. print('From:')
  23. print(id)
  24. end
  25. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement