Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Local
- local miningError = 0 -- 0 = no error, 1 = error
- local torch = turtle.getItemCount(1)
- local fuel = turtle.getItemCount(2)
- --Check
- local function Check()
- if torch == 0 then
- print("Missing torches in slot 1")
- Error = 1
- else
- print("Torches detected")
- end
- if fuel > 0 then
- refuel all
- else
- print("No fuel to add, hope you have enough =P")
- end
- -- Recheck
- local function Recheck()
- torch = turtle.getItemCount(1)
- Error = 0
- end
- --Dig
- local function DigUpDown()
- turtle.digUp()
- turtle.digDown()
- end
- --Forward
- local function Forward()
- turtle.dig()
- turtle.forward()
- end
- --TurnLeft
- local function TurnLeft()
- turtle.turnLeft()
- end
- --TurnRight
- local function TurnRight()
- turtle.turnRight()
- end
- -- Start
- local function Start()
- Forward()
- DigUpDown()
- TurnLeft()
- Forward()
- DigUpDown()
- TurnRight()
- TurnRight()
- Forward()
- Forward()
- Forward()
- DigUpDown()
- TurnLeft()
- TurnLeft()
- turnRight()
- end
- -- Main
- print("Welcome to stairs program place turtle in the bottom middle tile")
- sleep(2)
- print("Place torches in slot 1")
- sleep(10)
- Check()
- if Error == 1 then
- repeat
- sleep(10)
- Recheck()
- Check()
- until Error == 0
- end
- Start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement