SkyFlash21

geo

Jul 13th, 2021 (edited)
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. local component = require("component")
  2. local geolyzer = component.geolyzer
  3.  
  4. local offsetx = 0
  5. local offsetz = 0
  6. local offsety = 0
  7.  
  8. local sizex = 4
  9. local sizez = 4
  10. local sizey = 4
  11.  
  12. local map = {}
  13. local scanData = geolyzer.scan(offsetx, offsetz, offsety, sizex, sizez, sizey)
  14. local i = 1
  15. for y = 0, sizey - 1 do
  16. for z = 0, sizez - 1 do
  17. for x = 0, sizex - 1 do
  18. -- alternatively when thinking in terms of 3-dimensional table: map[offsety + y][offsetz + z][offsetx + x] = scanData[i]
  19. map[i] = {posx = offsetx + x, posy = offsety + y, posz = offsetz + z, hardness = scanData[i]}
  20. i = i + 1
  21. end
  22. end
  23. end
  24.  
  25. for i = 1, sizex*sizez*sizey do
  26. print(map[i].posx, map[i].posy, map[i].posz, map[i].hardness)
  27. end
Add Comment
Please, Sign In to add comment