Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- obsidian
- -- Generate obsidian blocks from redstone dust
- -- Version: Rev 0.1
- message1 = "Place redstone dust in slot 1"
- message2 = "Place bucket of lava in slot 6"
- usage = "obsidian (No arguments)"
- args = {...}
- nArgs = #args
- function forward(nBlocks)
- for i=1,nBlocks do
- turtle.forward()
- end
- end
- function back(nBlocks)
- for i=1,nBlocks do
- turtle.back()
- end
- end
- function placeRedstone()
- back(3)
- turtle.select(1)
- for i=1,7 do
- turtle.placeDown()
- forward(1)
- end
- back(3)
- end
- function mineObsidian()
- back(3)
- turtle.select(5)
- for i=1,3 do
- turtle.digDown()
- forward(1)
- end
- forward(1)
- for i=1,3 do
- turtle.digDown()
- forward(1)
- end
- back(3)
- end
- function employLava()
- turtle.up()
- turtle.select(16)
- turtle.placeDown()
- sleep(8)
- turtle.placeDown()
- sleep(3)
- turtle.down()
- end
- function offloadObsidian()
- turtle.up()
- turtle.turnLeft()
- if turtle.detect() then
- turtle.select(5)
- turtle.drop()
- end
- turtle.down()
- turtle.turnRight()
- end
- if nArgs > 0 then
- print(message1)
- print(message2)
- print(usage)
- end
- while true do
- if turtle.getItemCount(1) < 6 then
- break
- end
- placeRedstone()
- employLava()
- mineObsidian()
- offloadObsidian()
- end
- print("Redstone count is below 6.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement