Guest User

test

a guest
Sep 23rd, 2015
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.73 KB | None | 0 0
  1. a = peripheral.wrap("right")
  2.  
  3. function statsToTable()
  4.  seed = a.getSeedInAnalyzer()
  5.  a.analyze()
  6.  growth, gain, strength = a.getSpecimenStats()
  7.  seedTable = {seed, growth, gain, strength}
  8.  for key, value in pairs(seedTable) do
  9.    print("key: "..key.." is "..value)
  10.  end
  11. end
  12.  
  13. function save(table,name)
  14. local file = fs.open(name,"w")
  15. file.write(textutils.serialize(table))
  16. file.close()
  17. end
  18.  
  19. function load(name)
  20. local file = fs.open(name,"r")
  21. local data = file.readAll()
  22. file.close()
  23. print(data)
  24. checkTable = textutils.unserialize(data)
  25. for
  26. end
  27.  
  28. print()
  29. --while true dofile(
  30.  statsToTable()
  31.  save(seedTable, seedTable[1])
  32.  if fs.exists(seedTable[1]) then
  33.  print("jeej")
  34.  print(data)
  35.  end
  36.  load(seedTable[1])
  37. --end
Advertisement
Add Comment
Please, Sign In to add comment