Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- miningPlot = {6,6,4}
- -- NO NEGATIVES PLEASE ^
- pos = {0,0,0}
- -- +for/back- , -left/Right+ , +Up/Down-
- --Preconditon: chest behind area to min in front
- direction = 0
- -- 0 = ^ , 1 = > , 2 = v , 3 = <,4 = up ,5 down
- function increment(dir)--dir is where going
- if dir == 0 then
- pos[0] = post[0] + 1
- elseif dir == 1 then
- pos[1] = pos[1] + 1
- elseif dir == 2 then
- pos[0] = pos[0] - 1
- elseif dir == 3 then
- pos[1] = pos[1] - 1
- elseif dir == 4 then
- pos[2] = pos[2] + 1
- elseif dir == 5 then
- pos[2] = pos[2] - 1
- end
- end
- function left(x)
- turtle.turnLeft()
- forward(x)
- turtle.turnRight()
- end
- function right(x)
- turtle.turnRight()
- forward(x)
- turtle.turnLeft()
- end
- function back(z)
- for i=0,z do
- turtle.back()
- end
- end
- function forward(y)
- for i=0, y do
- turtle.dig()
- turtle.suck()
- turtle.forward()
- end
- end
- --precondition: turtle within left lowest corner facing towards to be mined space
- --postcondition: back in positon & direction
- function plane()
- for x=0, miningPlot[1] do
- if x%2 ~= 0 then
- forward(miningPlot[0])
- else
- back(miningPlot[0])
- end
- right(1)
- end
- --going back to positon
- if pos[0] >0 then
- back(pos[0])
- end
- if pos[1] > 0 then
- left(pos[1])
- end
- end
- plane()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement