wuiyang

Copy & Paste

Jan 17th, 2013
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local thing
  2. local function TROLL(name, TorS, name2)
  3. if TorS == "table" or TorS == "t" then
  4. local file = fs.open(name,"r")
  5. local sContents = file.readAll()
  6. file.close()
  7. thing = textutils.unserialize(sContents)
  8. h=fs.open(name2, "a")
  9. h.writeLine(textutils.serialize(thing))
  10. h.close()
  11. elseif TorS == "string" or TorS == "s" then
  12. local file = fs.open(name,"r")
  13. local sContents = file.readAll()
  14. file.close()
  15. thing = sContents
  16. h=fs.open(name2, "a")
  17. h.writeLine(thing)
  18. h.close()
  19. end
  20. end
  21.  
  22. print("File/program name that you want to copy?")
  23. print(">                                         ")
  24. print("Is it a table or a string?")
  25. print("if it is program, then it is string")
  26. print(">                                         ")
  27. print("File/program name that you want to paste?")
  28. print(">                                         ")
  29. term.setCursorPos(2,2)
  30. local name = read()
  31. term.setCursorPos(2,5)
  32. local TorS = read()
  33. term.setCursorPos(2,7)
  34. local name2 = read()
  35. TROLL(name, TorS, name2)
  36. print(thing)
Advertisement
Add Comment
Please, Sign In to add comment