Description
This component is provided by the geolyzer block.
Component name: geolyzer
.
This component is provided by the geolyzer block.
Component name: geolyzer
.
scan(x:number, z:number[, y:number, w:number, d:number, h:number][, ignoreReplaceable:boolean|options:table]):table
Analyzes the density of an area at the specified relative coordinates x, z and y.analyze(side:number[, options:table]):table
Get some information on a directly adjacent block. store(side:number, dbAddress:string, dbSlot:number):boolean
Stores an item stack representation of the block on the specified side of the geolyzer to the specified slot of a database component with the specified address.detect(side:number):boolean, string
Same as robot.detect (from the robot component). Detects the block on the given side, relative to the robot, and returns whether or not the robot can move into the block, as well as a general description of the block.canSeeSky():boolean
Returns whether there is a clear line of sight to the sky directly above. Transparent blocks, e.g. glass don't affect the line of sight.
isSunVisible():boolean
Returns whether the sun is currently visible directly above. The result is affected by possible blocks blocking the line of sight directly above (which can be checked with canSeeSky()) and whether it's night or day.
-- https://ocdoc.cil.li/component:generator
local component = require("component")
local geolyzer = component.geolyzer
local offsetx = 4
local offsetz = -3
local offsety = -5
local sizex = 3
local sizez = 4
local sizey = 5
local map = {}
local scanData = geolyzer.scan(offsetx, offsetz, offsety, sizex, sizez, sizey)
local i = 1
for y = 0, sizey - 1 do
for z = 0, sizez - 1 do
for x = 0, sizex - 1 do
-- alternatively when thinking in terms of 3-dimensional table: map[offsety + y][offsetz + z][offsetx + x] = scanData[i]
map[i] = {posx = offsetx + x, posy = offsety + y, posz = offsetz + z, hardness = scanData[i]}
i = i + 1
end
end
end
for i = 1, sizex*sizez*sizey do
print(map[i].posx, map[i].posy, map[i].posz, map[i].hardness)
end