Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.clear()
- term.setCursorPos(1,1)
- print("**Platform Depositor**")
- print("Fill inventory!")
- print()
- print("Select distance forward:")
- distForward = read(input)
- term.clear()
- term.setCursorPos(1,1)
- print("**Platform Depositor**")
- print("Fill inventory!")
- print()
- print("Select distance right:")
- distRight = read(input)
- term.clear()
- term.setCursorPos(1,1)
- print("**Platform Depositor**")
- print("Running...")
- -- Functions
- local function fuel()
- if turtle.getFuelLevel() < 1000 then
- turtle.refuel(1)
- end
- end
- local function tMove(distance)
- fuel()
- for i=1,distance do
- while turtle.forward() == false do
- turtle.dig()
- turtle.attack()
- sleep(0.5)
- end
- end
- end
- local function tDescend(distance)
- for i=1,distance do
- while turtle.down() == false do
- turtle.digDown()
- turtle.attackDown()
- sleep(0.5)
- end
- end
- end
- local function tAscend(distance)
- for i=1,distance do
- while turtle.up() == false do
- turtle.digUp()
- turtle.attackUp()
- sleep(0.5)
- end
- end
- end
- local function turnaround()
- turtle.turnRight()
- turtle.turnRight()
- end
- local function tPlace()
- if turtle.getItemCount(1) == 0 then
- for i=2,15 do
- turtle.select(i)
- turtle.transferTo(1)
- end
- end
- if turtle.getItemCount(1) == 0 then
- term.clear()
- term.setCursorPos(1,1)
- print()
- print()
- print("Please refill inventory")
- print()
- print()
- print("Press [ENTER] when ready")
- end
- turtle.select(1)
- while turtle.placeDown() == false do
- turtle.digDown()
- turtle.attackDown()
- end
- end
- --Main Loop
- for i=1,distRight do
- for j=1,distForward-1 do
- tPlace()
- tMove(1)
- end
- tPlace()
- turnaround()
- tMove(distForward-1)
- turtle.turnLeft()
- if i ~= distRight then
- tMove(1)
- end
- turtle.turnLeft()
- end
Advertisement
Add Comment
Please, Sign In to add comment