Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --place turtle at bottom left side of the expected layout
- --place logs or stone in slot 1
- --place result in slot 16
- -- Main program will automatically places blocks in a 3x3 square and leave out the middle then returns to start position and will mine up the new block once transformed
- function placeBlocks()
- for p=1,2 do
- turtle.forward()
- turtle.placeDown()
- end
- end
- function destroyBlocks()
- for p=1,2 do
- turtle.forward()
- turtle.digDown()
- end
- end
- function square(x)
- turtle.select(x)
- turtle.up()
- turtle.forward()
- for s=1,4 do
- if x==1 then
- placeBlocks()
- else
- destroyBlocks()
- end
- turtle.turnRight()
- end
- turtle.back()
- turtle.down()
- end
- --Main Program
- while true do
- if turtle.getFuelLevel() <12 then
- print "I need fuel. Refuel then restart program."
- turtle.reboot()
- elseif turtle.getItemCount(1)<7 then
- print "I need more placement material in Slot 1."
- else
- if turtle.detect()==false and turtle.getItemCount(1)>7 then
- square(1)
- else
- turtle.select(16)
- if turtle.compare() then
- square(16)
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement