Guest User

record

a guest
Oct 14th, 2012
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. op = peripheral.wrap("left")
  2. x1, y1, z1 = op.getPos()
  3. x1 = x1 + 1
  4. temp_x = x1
  5. temp_y = y1
  6. temp_z = z1
  7. blueprint = {}
  8. function getBlock()
  9. blockID = op.getBlockIDAtPos(temp_x,temp_y,temp_z)
  10. blockData = op.getBlockDataAtPos(temp_x,temp_y,temp_z)
  11. coords = {temp_x,temp_y,temp_z,blockID,blockData}
  12. setmetatable(coords, self)
  13. return coords
  14. end
  15.  
  16.  
  17. function recordBlock()
  18. block = getBlock()
  19. table.insert(blueprint,textutils.serialize(block))
  20. end
  21. while temp_y <= y1 + 25 do
  22. temp_x = x1
  23. while temp_x <= x1 + 25 do
  24. temp_z = z1
  25. while temp_z <= z1 + 25 do
  26. recordBlock()
  27. temp_z = temp_z + 1
  28. end
  29. temp_x = temp_x + 1
  30. end
  31. temp_y = temp_y + 1
  32. end
  33. h = fs.open("blueprint","w")
  34. blueprintS = textutils.serialize(blueprint)
  35. h.write(blueprintS)
  36. h.close()
  37. print("done")
Advertisement
Add Comment
Please, Sign In to add comment