Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local p = peripheral.wrap("top")
- local w = p.getWorld(0)
- local r = 3
- local d = 8
- local b = 0
- local f = 0
- local c = 0
- local s = 0
- function WallN(x, y, z)
- for yy = (y - r), (y + r) do
- for xx = (x - r), (x + r) do
- w.setBlockWithoutNotify(xx, yy, z - r, b, s)
- end
- end
- end
- function WallS(x, y, z)
- for yy = (y - r), (y + r) do
- for xx = (x - r), (x + r) do
- w.setBlockWithoutNotify(xx, yy, z + r, b, s)
- end
- end
- end
- function WallW(x, y, z)
- for yy = (y - r), (y + r) do
- for zz = (z - r), (z + r) do
- w.setBlockWithoutNotify(x - r, yy, zz, b, s)
- end
- end
- end
- function WallE(x, y, z)
- for yy = (y - r), (y + r) do
- for zz = (z - r), (z + r) do
- w.setBlockWithoutNotify(x + r, yy, zz, b, s)
- end
- end
- end
- function Floor(x, y, z)
- for zz = (z - r), (z + r) do
- for xx = (x - r), (x + r) do
- w.setBlockWithoutNotify(xx, y - r, zz, b, f)
- end
- end
- end
- function Ceiling(x, y, z)
- for zz = (z - r), (z + r) do
- for xx = (x - r), (x + r) do
- w.setBlockWithoutNotify(xx, y + r, zz, b, c)
- end
- end
- end
- function DoorN(x, y, z)
- for yy = (y - r + 1), (y - r + 3) do
- for xx = (x - 1), (x + 1) do
- w.setBlockWithoutNotify(xx, yy, z - r, 0, 0)
- end
- end
- end
- function DoorS(x, y, z)
- for yy = (y - r), (y - r + 4) do
- for xx = (x - 2), (x + 2) do
- w.setBlockWithoutNotify(xx, yy, z + r + 1, b, s)
- end
- end
- for yy = (y - r + 1), (y - r + 3) do
- for xx = (x - 1), (x + 1) do
- w.setBlockWithoutNotify(xx, yy, z + r + 1, 0, 0)
- w.setBlockWithoutNotify(xx, yy, z + r, 0, 0)
- end
- end
- end
- function DoorW(x, y, z)
- for yy = (y - r + 1), (y - r + 3) do
- for zz = (z - 1), (z + 1) do
- w.setBlockWithoutNotify(x - r, yy, zz, 0, 0)
- end
- end
- end
- function DoorE(x, y, z)
- for yy = (y - r), (y - r + 4) do
- for zz = (z - 2), (z + 2) do
- w.setBlockWithoutNotify(x + r + 1, yy, zz, b, s)
- end
- end
- for yy = (y - r + 1), (y - r + 3) do
- for zz = (z - 1), (z + 1) do
- w.setBlockWithoutNotify(x + r + 1, yy, zz, 0, 0)
- w.setBlockWithoutNotify(x + r, yy, zz, 0, 0)
- end
- end
- end
- function Floor2(x, y, z)
- w.setBlockWithoutNotify(x, y - r, z, 0, 0)
- end
- function Ceiling2(x, y, z)
- w.setBlockWithoutNotify(x - 1, y + r + 1, z - 1, b, c)
- w.setBlockWithoutNotify(x, y + r + 1, z - 1, b, c)
- w.setBlockWithoutNotify(x + 1, y + r + 1, z - 1, b, c)
- w.setBlockWithoutNotify(x - 1, y + r + 1, z, b, c)
- w.setBlockWithoutNotify(x + 1, y + r + 1, z, b, c)
- w.setBlockWithoutNotify(x - 1, y + r + 1, z + 1, b, c)
- w.setBlockWithoutNotify(x, y + r + 1, z + 1, b, c)
- w.setBlockWithoutNotify(x + 1, y + r + 1, z + 1, b, c)
- w.setBlockWithoutNotify(x, y + r, z, 0, 0)
- end
- function room(x, y, z, data)
- WallN(x, y, z)
- WallS(x, y, z)
- WallW(x, y, z)
- WallE(x, y, z)
- Floor(x, y, z)
- Ceiling(x, y, z)
- w.setBlock(x - 2, y + 2, z - 2, 1717, 0)
- w.setBlock(x + 2, y + 2, z - 2, 1717, 0)
- w.setBlock(x - 2, y + 2, z + 2, 1717, 0)
- w.setBlock(x + 2, y + 2, z + 2, 1717, 0)
- if bit.band(data, 1) ~= 0 then DoorW(x, y, z) end
- if bit.band(data, 2) ~= 0 then DoorE(x, y, z) end
- if bit.band(data, 4) ~= 0 then DoorN(x, y, z) end
- if bit.band(data, 8) ~= 0 then DoorS(x, y, z) end
- if bit.band(data, 16) ~= 0 then Floor2(x, y, z) end
- if bit.band(data, 32) ~= 0 then Ceiling2(x, y, z) end
- end
- local data = fs.open("data", "r")
- function makeRooms()
- for y = 1, 9 do
- for z = 1, 25 do
- for x = 1, 25 do
- room(x * 8, y * 8 + 20, z * 8, tonumber(data.readLine()))
- os.sleep(.05)
- end
- end
- end
- end
- makeRooms()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement