Advertisement
maxsar

nanoswarm

Dec 20th, 2020 (edited)
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. antena = peripheral.wrap("top")
  2. infected = antena.getInfectedEntities()
  3.  
  4. playerID = {}
  5. playerName = {}
  6.  
  7. --tworzenie pliku jak nie istnieje
  8. if not fs.exists("save") then
  9. file = fs.open("save", "w")
  10. file.close()
  11. end
  12.  
  13. --wczytywanie
  14. file = fs.open("save", "r")
  15. switch = true
  16.  
  17. line = file.readLine()
  18. while line ~= nil do
  19.  
  20.  
  21. if switch then
  22. table.insert(playerID,line)
  23. print("wczytano: " ..line .." do playerID")
  24. switch = false
  25. else
  26. table.insert(playerName,line)
  27. print("wczytano: " ..line .." do playerName")
  28. switch = true
  29. end
  30. line = file.readLine()
  31. end
  32.  
  33.  
  34. file.close()
  35.  
  36.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement