Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- turtle.refuel()
- length=0
- length2=0
- width=0
- torchC=0
- lengthSave=0
- widthSave=0
- print("Enter length")
- length=read()
- lengthSave=length
- print("Enter width")
- width=read()
- widthSave=width
- print("Enter count")
- Grave=tonumber(read())
- print("Yes Boss")
- function dig()
- turtle.dig()
- turtle.forward()
- turtle.digDown()
- turtle.digUp()
- end
- function chest()
- if turtle.getItemCount(16)>0 then
- turtle.down()
- turtle.digDown()
- turtle.select(2)
- turtle.placeDown()
- for i=16,3,-1 do turtle.select(i); turtle.dropDown() end
- turtle.up()
- elseif turtle.getFuelLevel()<1 then exit() end
- end
- function torch()
- if torchC==0 then
- turtle.select(1)
- turtle.placeDown()
- torchC=6
- else
- torchC=torchC-1
- end
- end
- print(type(Grave))
- print(type(width))
- while Grave~=0 do
- length=length-1
- repeat
- length=length-1
- dig()
- torch()
- chest()
- until length==0
- if Grave==1 then exit()
- end
- Grave=Grave-1
- if Grave%2==1 and width~=0 then
- turtle.turnLeft()
- width=width+1
- repeat
- width=width-1
- dig()
- torch()
- chest()
- until width==0
- turtle.turnLeft()
- elseif Grave%2==0 and width~=0 then
- turtle.turnRight()
- width=width+1
- repeat
- width=width-1
- dig()
- torch()
- chest()
- until width==0
- turtle.turnRight()
- elseif width==0 and Grave%2==1 then
- turtle.turnLeft()
- dig()
- torch()
- chest()
- turtle.turnLeft()
- elseif width==0 and Grave%2==0 then
- turtle.turnRight()
- dig()
- torch()
- chest()
- turtle.turnRight()
- end
- width=widthSave
- length=lengthSave
- end
Advertisement
Add Comment
Please, Sign In to add comment