Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require("component")
- if not component.isAvailable("geolyzer") then
- io.stderr:write("This program requires a Geolyzer to run.")
- return
- end
- if not component.isAvailable("hologram") then
- io.stderr:write("This program requires a Hologram Projector to run.")
- return
- end
- hologram.clear()
- local seed = math.random(0xFFFFFFFF)
- for x = 1, 16 * 3 do
- for z = 1, 16 * 3 do
- component.hologram.fill(x, z, 15 + noise.fbm(x/(16*3) + seed, 1, z/(16*3) + seed) * 28,1)
- end
- end
- local sx, sz = 48, 48
- local ox, oz = -24, -24
- for true do
- for x=ox,sx+ox do
- for z=oz,sz+oz do
- local hx, hz = 1 + x - ox, 1 + z - oz
- local column = component.geolyzer.scan(x, z)
- for y=1,32 do
- local hardness = column[y + 27]
- local color
- if hardness == 0 or not hardness then
- color = 0
- elseif hardness < 3 then
- color = 2
- elseif hardness < 100 then
- color = 1
- else
- color = 3
- end
- if component.hologram.maxDepth() > 1 then
- component.hologram.set(hx, y, hz, color)
- else
- component.hologram.set(hx, y, hz, math.min(color, 1))
- end
- end
- os.sleep(0)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement