Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- GRIEF PROGRAM
- -- by Taking1n1
- -- // Slot definitions \\
- -- 1: TNT blocks
- -- 2: Redstone
- -- 3: Any block, only used if there are holes
- -- Goes forward and finds the building
- steps = 0
- goDown = 0
- while true do
- turtle.forward()
- steps = steps + 1
- if not turtle.detectDown() then -- If there are no blocks below
- turtle.select(3)
- turtle.placeDown()
- turtle.select(1)
- end
- if turtle.detect() then
- break
- end
- end
- -- Found the building, prepare
- turtle.back()
- turtle.select(1)
- -- Sets up TNT
- while true do
- turtle.forward()
- if turtle.detect() then -- If there is a block in front of you
- turtle.back()
- turtle.place()
- if turtle.detectUp() then -- If there is a block above us
- break
- end
- turtle.up()
- goDown = goDown + 1
- else
- turtle.back()
- break
- end
- if turtle.getItemCount(1) == 0 then -- If we've ran out of TNT
- break
- end
- end
- -- Goes back down
- while goDown ~= 0 do
- turtle.down()
- goDown = goDown - 1
- end
- -- Offset the steps
- steps = steps - 1
- -- Gos back and places redstone along
- turtle.select(2)
- while steps ~= 0 do
- turtle.back()
- steps = steps - 1
- turtle.place()
- if turtle.getItemCount(2) == 0 then -- If we've ran out of redstone
- redstone.setOutput("front", true)
- redstone.setOutput("front", false)
- end
- end
- -- Detonates the bomb
- redstone.setOutput("front", true)
- sleep(1)
- redstone.setOutput("front", false)
- -- We are finished
- print("The deed is done.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement