Created
September 13, 2015 13:28
-
-
Save witchica/62e0707f672ad237a9b7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local component = require("component") | |
local hologram = component.hologram | |
function setVoxel(x, y, z, value) | |
local current = hologram.get(x, z) | |
local positiveMask = bit32.lshift(1, y - 1) | |
if value then | |
hologram.set(x, z, bit32.bor(current, positiveMask)) | |
else | |
local negativeMask = bit32.bnot(positiveMask) | |
hologram.set(x, z, bit32.band(current, negativeMask)) | |
end | |
end | |
local args = {...} | |
setVoxel(tonumber(args[1]), tonumber(args[2]), tonumber(args[3]), args[4] == "true" or args[4] == "on") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment