Advertisement
Parlocameon

SFTP Client(ComputerCraft)

Jun 26th, 2016
649
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.42 KB | None | 0 0
  1. rednet.open("top")
  2. --HASH MUST MATCH RECEIVER HASH, OTHERWISE FILES WILL FAIL TO SEND
  3. hash = "HASH"
  4. tArgs = {...}
  5. id = tonumber(tArgs[1])
  6.  
  7. if fs.exists(tArgs[2]) then
  8. term.clear()
  9. term.setCursorPos(1,1)
  10.     textutils.slowPrint("Sending File "..tArgs[2].."...")
  11.     rednet.send(id, hash)
  12.     rednet.send(id, tArgs[2])
  13.     file = fs.open(tArgs[2], "r")
  14.     rednet.send(id, file.readAll())
  15.     else
  16. print(tArgs[2].." does not exist.")
  17. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement