Mikee251

RedTechReceiver

Feb 3rd, 2013
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.36 KB | None | 0 0
  1.  
  2. rednet.open("right")
  3. function receive()
  4. while true do
  5. id,msg = rednet.receive()
  6. if msg == ("file") then
  7. print("readying to transfer...")
  8. id,msg = rednet.receive()
  9. filename = msg
  10.  id,msg = rednet.receive()
  11. print("received file.. copying...")
  12. time = os.time()
  13. file = fs.open(filename, "w")
  14.    file.write(msg)
  15.   file.close()
  16. print("copyied")
  17.  end
  18. end
  19. end
Advertisement
Add Comment
Please, Sign In to add comment