Guest User

Untitled

a guest
Jun 13th, 2014
349
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.56 KB | None | 0 0
  1.  
  2. function setup()
  3.     ae = peripheral.wrap("back")
  4.     cust = {}
  5. end
  6. function main()
  7.     setup()
  8. end
  9.    
  10.  
  11. function getComponents()
  12.     for i = 1, #spells do
  13.         cust["id"] = spells[i]
  14.         cust["qty"] = 1
  15.         cust["dmg"] = 0
  16.         print(textutils.serialize(cust))                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
  17.         ret = ae.extractItem(cust, "west")
  18.     end
  19. end
  20.  
  21.  
  22. function save(table,name)
  23.     local file = fs.open(name,"a")
  24.     file.writeLine((textutils.serialize(table)))
  25.     file.close()                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
  26. end
  27.  
  28. function load(name)
  29.     local file = fs.open(name,"r")
  30.     data = file.readAll()
  31.     file.close()
  32.     spells = textutils.unserialize(data)
  33. end
  34.  
  35. load("spells")
  36. getComponents()
  37. main()
Advertisement
Add Comment
Please, Sign In to add comment