Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --My program for computer craft's turtles (Minecraft)
- --Place some torches in the first slot
- function torch()
- turtle.back()
- turtle.down()
- if turtle.detectDown() then
- turtle.up()
- turtle.placeDown()
- else
- turtle.select(2)
- turtle.placeDown()
- turtle.up()
- turtle.select(1)
- turtle.placeDown()
- end
- turtle.forward()
- end
- h = 0
- a = 0
- print("What distance?")
- a = read()
- l = true
- while l do
- p = turtle.getItemCount(1)
- if p == 0 then
- print("Put some torchs in the first slot")
- sleep(1)
- term.clear()
- term.setCursorPos(1, 1)
- sleep(1)
- else
- l = false
- end
- end
- for i = 0, a do
- turtle.dig()
- turtle.digUp()
- turtle.digDown()
- turtle.forward()
- h = h+1
- if h == 10 then
- torch()
- h = 0
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement