Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --varibles
- --local binput = tonumber( read() ) --length of cycle
- --local tinput = tonumber( read() ) --number of cycles
- --local i = 1
- --Opening dialogue
- write("Welcome!")
- sleep(5)
- term.clear()
- sleep(3)
- write("Please place fuel in first slot and torches in second slot.")
- sleep(5)
- term.clear()
- sleep(5)
- --Begin Input Request
- write("How many blocks between torches?")
- local binput = tonumber( read() )
- term.clear()
- write("How many cycles i.e. torches?")
- local tinput = tonumber( read() )
- term.clear()
- write("Thank You!")
- --check fuel and refuel
- function getFuel()
- if turtle.getFuelLevel() < 100 then
- turtle.select(1)
- turtle.refuel()
- else write("Out of Fuel!")
- end
- end
- --dig enough space for steve to step through
- function mine()
- turtle.dig()
- turtle.digUp()
- end
- --Check if required space for steve is available and locomotion.
- function moveCheck()
- turtle.forward()
- turtle.up()
- turtle.down()
- end
- --Place torch.
- function torch() --Place torch.
- turtle.select(2)
- turtle.place()
- end
- --Turn around.
- function turnAround()
- turtle.turnLeft()
- turtle.turnLeft()
- end
- --Place Torch
- function placeTorch()
- turnAround()
- torch()
- turnAround()
- end
- --Begin Program
- --get fuel before we begin
- getFuel()
- --Move until hit block then mine.
- local i = 1
- repeat
- i = 0
- moveCheck()
- until i = binput * tinput
- else mine()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement