Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --FUNCTIONS
- --This is a set of all of the basic functions added to most programs
- --
- --MOVEMENT
- --
- --Turn turtle 180 Degrees in place ==========
- --
- function turnAround()
- turtle.turnRight()
- turtle.turnRight()
- end
- --
- --Ensure turtle goes up
- --
- function goUp()
- while not turtle.up() do
- upDig()
- end
- end
- --
- --Ensure turtle goes down
- --
- function goDown()
- while not turtle.down() do
- downDig()
- end
- end
- --
- --Ensure turtle moves forward
- --
- function goForward()
- while not turtle.forward() do
- forwardDig()
- end
- end
- --
- --Ensure Back (No)
- --We can't Ensure going back
- --Use 'shell.run("go back")' if needed.
- --
- --ACTION FUNCTIONS
- --
- --Dig forward
- --
- function forwardDig()
- while turtle.detect() do
- turtle.dig()
- end
- end
- --
- --Dig up
- --
- function upDig()
- while turtle.detectUp() do
- turtle.digUp()
- end
- end
- --
- --Dig Down
- --
- function downDig()
- turtle.digDown()
- end
- --
- --Counter for inventer for the PLACE BLOCK DOWN function
- --More is needed here
- --Select next inventory slot if current is empty
- --
- --Counts stacks of items
- --
- function CounterBlock()
- repeat
- if turtle.getItemCount(slot) == 0 and slot ~=16 then
- slot = slot + 1
- turtle.select(slot)
- elseif
- turtle.getItemCount(slot) == 0 and slot ==16 then
- term.clear()
- print("I've run out of Material before finishing. Add more to continue!")
- slot = 1
- turtle.select(slot)
- repeat
- sleep(1)
- until turtle.getItemCount(slot) > 0
- sleep(3)
- print("Starting in 3 seconds")
- end
- until
- turtle.getItemCount(slot) > 0
- end
- --
- --Place Block Down
- --
- function placeDown()
- turtle.select(slot)
- turtle.placeDown()
- CounterBlock()
- end
- --
- --Place Block Forward
- --
- function place()
- turtle.select(slot)
- turtle.place()
- CounterBlock()
- end
- --
- --Place Block Up
- --
- function placeUp()
- turtle.select(slot)
- turtle.placeUp()
- CounterBlock()
- end
- --
- ----------
- ----------
- ----------
- slot=1
- z=0
- while not turtle.detectUp() do
- turtle.up()
- placeDown()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement