Advertisement
systox

wirelessSending

Jun 16th, 2018
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. function readFile(path)
  2. file = fs.open(path,"r")
  3. i = file.readAll()
  4. file.close()
  5. return i
  6. end
  7.  
  8. function writeInFile(name,contents)
  9. file = fs.open(name,"w")
  10. file.write(contents)
  11. file.close()
  12. end
  13.  
  14.  
  15. function load()
  16. print(readFile("disk/file"))
  17. end
  18.  
  19. function save(i)
  20. writeInFile("disk/file",i)
  21. end
  22.  
  23. function loadDisk()
  24. rs.setOutput("top",true)
  25. sleep(.5)
  26. end
  27.  
  28. function unloadDisk()
  29. rs.setOutput("top",false)
  30. rs.setOutput("back",true)
  31. sleep(.5)
  32. rs.setOutput("back",false)
  33. end
  34.  
  35.  
  36. while true do
  37. loadDisk()
  38. print(load())
  39. unloadDisk()
  40. sleep(2)
  41. end
  42.  
  43. while true do
  44. i = read()
  45. loadDisk()
  46. save(i)
  47. unloadDisk()
  48. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement