Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ Blaze spawner builder for Minecraft mod: Computercraft ]]--
- --[[ Made by Punchin ]]--
- local invCount = 0
- local function cls() --Clears the screen
- term.clear()
- term.setCursorPos(1,1)
- end
- local function iCount() --Counts total inventory items
- invCount = 0
- for i=1,16 do
- invCount = invCount + turtle.getItemCount(i)
- end
- end
- local function inv() --Keeps items in slot 1
- if (turtle.getItemCount(1) == 1) then
- for z=2,16 do
- if (turtle.getItemCount(z) > 0) then
- turtle.select(z)
- if turtle.compareTo(1) then
- turtle.transferTo(1)
- turtle.select(1)
- break
- end
- end
- end
- end
- iCount()
- term.setCursorPos(1,3)
- print(" ")
- term.setCursorPos(1,3)
- print("Items in inventory: " .. invCount)
- end
- --Movement functions
- local function mf() while not turtle.forward() do turtle.attack() turtle.dig() end end
- local function mu() while not turtle.up() do turtle.digUp() turtle.attackUp() end end
- local function md() while not turtle.down() do turtle.digDown() turtle.attackDown() end end
- local function du() turtle.digUp() end
- local function dd() turtle.digDown() end
- local function dig() turtle.dig() end
- local function tr() turtle.turnRight() end
- local function tl() turtle.turnLeft() end
- local function mb() while not turtle.back() do tr() tr() mf() tr() tr() end end
- local function pu() while not turtle.placeUp() do du() turtle.attackUp() end inv() end
- local function pd() while not turtle.placeDown() do dd() turtle.attackDown() end inv() end
- iCount()
- while (invCount < 343) do --Initial check for item count.
- cls()
- print("Not enough items.")
- print("Please add " .. (343 - invCount) .. " items.")
- sleep(1)
- iCount()
- end
- cls()
- print("All items accounted for.") --Beginning build
- print("Beginning build.")
- --Moving into position for bottom platform
- tl()
- for i=1,4 do mf() end
- tl()
- for i=1,3 do mf() end
- tl()
- md()
- md()
- --Building bottom platform and clearing 2 below spawner
- du() dd() pd()
- for j=1,4 do
- for i=1,8 do mf() du() dd() pd() end
- tl() mf() du() dd() tl() pd()
- for i=1,8 do mf() du() dd() pd() end
- tr() mf() du() dd() tr() pd()
- end
- for i=1,8 do mf() du() dd() pd() end
- --Moving to top platform and clearing 2 above spawner
- mu() mu() mu() mu() tr() tr() pu()
- for j=1,4 do
- for i=1,8 do mf() du() dd() pu() end
- tl() mf() du() dd() tl() pu()
- for i=1,8 do mf() du() dd() pu() end
- tr() mf() du() dd() tr() pu()
- end
- for i=1,8 do mf() du() dd() pu() end
- mf() tr()
- --Building walls
- for s=1,4 do
- for r=1,4 do
- for i=1,5 do md() pu() end
- mf() mu()
- for i=1,5 do mu() pd() end
- mf() md()
- end
- for i=1,5 do md() pu() end
- mf() for i=1,5 do mu() end
- tr() mf()
- end
- --Repairing hole used to enter spawner area
- tl() mb() turtle.place()
- md() md() tr()
- --Clearing leftover blocks inside spawner room
- for i=1,4 do
- for j=1,8 do
- mf()
- end
- tr()
- end
- mf() tr() mf() tl()
- for i=1,4 do
- for j=1,6 do
- mf()
- end
- tr()
- end
- mf() tr() mf() tl()
- for i=1,4 do
- for j=1,4 do
- mf()
- end
- tr()
- end
- --creating doorway and exiting spawner room
- tr() tr() mf() mf()
- tl() mf() mf() tr()
- md() mf() md() pd()
- mf() md()
- cls()
- print("Spawner complete. Enjoy!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement