Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require "component"
- local holo = component.hologram
- local geo = component.geolyzer
- if not (holo and geo) then
- print("Requires hologram projector and Geolyzer.")
- return
- end
- local CENTER, ORE, OBSIDIAN = 1, 2, 3
- holo.setPaletteColor(CENTER, 0xFFFF00)
- holo.setPaletteColor(ORE, 0xa8a8a8)
- holo.setPaletteColor(OBSIDIAN, 0x380474)
- function setPixel(x, z, y, density)
- local color = OBSIDIAN
- if ((x == 24) and (z == 24) and (y == 16)) then
- color = CENTER
- elseif (density <= 2) then
- color = false
- elseif (density <= 4) then
- color = ORE
- end
- holo.set(x, y, z, color)
- end
- function scanCol(x, z, times)
- local col, value
- local result = {}
- for round = 1,times do
- col = geo.scan(x - 24, z - 24)
- for i = 1,#col do
- value = col[i]
- if (value < 0) then
- value = 0
- elseif (value > 5) then
- value = 5
- end
- result[i] = (result[i] or 0) + value
- end
- end
- for i = 1,#result do
- result[i] = result[i] / times
- end
- return result
- end
- function scanArea()
- local col
- for x = 8,40 do
- for z = 8,40 do
- col = scanCol(x, z, 10)
- for y = 1,32 do
- setPixel(x, z, y, col[y+16])
- end
- end
- end
- end
- holo.clear()
- holo.setScale(1)
- scanArea()
Advertisement
Add Comment
Please, Sign In to add comment