assasin172

download

Jun 4th, 2013
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.45 KB | None | 0 0
  1. print 'Waiting for data...'
  2.  
  3. while true do
  4.   local _, data = textutils.unserialize(rednet.receive())
  5.  
  6.   -- we have to be SUPER EXTRA CAREFUL so that we dont crash
  7.   -- on bad data.
  8.   if data and data.cmd and data.cmd == 'getfile' then
  9.     -- write our received program! :P/>/>
  10.     print 'Data received. Writing program.'
  11.     local file = fs.open(data.program, 'w')
  12.     file:write(data.content)
  13.     file:close()
  14.     print 'Done.'
  15.     break
  16.   end
  17. end
Add Comment
Please, Sign In to add comment