Advertisement
subzero22

Aspects

Apr 20th, 2014
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.80 KB | None | 0 0
  1.  
  2. p = peripheral.wrap("bottom")
  3.  
  4. --for i,v in pairs(p) do print(i) end
  5.  
  6. local oldWrite = term.write
  7.  
  8. local storage = {}
  9.  
  10. term.write = function(input)
  11. table.insert(storage, input)
  12. oldWrite(input)
  13. end
  14.  
  15. print(p.getAspects())
  16.  
  17. local function save()
  18. local File = fs.open("Aspects", "w")
  19. File.write(storage)
  20. File.close()
  21. end
  22.  
  23. save()
  24.  
  25. local function load()
  26. local lFile = fs.open("Aspects","r")
  27. Data = textutils.unserialize(lFile.readAll())
  28. lFile.close()
  29. end
  30.  
  31. load()
  32.  
  33. --tData = textutils.unserialize(Data)
  34. --print(tData)
  35.  
  36. term.write = oldWrite
  37.  
  38. term.clear()
  39. term.setCursorPos(1,1)
  40.  
  41. local function FTU(str)
  42. return (str:gsub("^%1", string.upper))
  43. end
  44.  
  45. print("Aspects of the item is:")
  46. print(" ")
  47. for i,v in pairs(storage) do
  48.  
  49. v = v:gsub("%a", string.upper, 1)
  50.  
  51. print(v)
  52. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement