Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require "CiderDebugger";
- local cobblenumber = turtle.getItemcount(1)
- local torchnumber = turtle.getItemcount(2)
- local data = turtle.getItemDetail(1)
- local data2 = turtle.getItemDetail(2)
- local dataname = data.name
- local dataneme = data2.name
- local lenght = 0
- local times = 0
- local direction = 2
- local onlight = 0
- function insert1()
- print("length:")
- input = io.read()
- lenght = tonumber(input)
- print("direction:")
- input2 = io.read()
- direction = tonumber(input2)
- print("direciton")
- input3 = io.read()
- times = tonumber(input3)
- end
- function Fuel()
- fuelevel = turtle.getFuelLevel()
- if fuellevel ~= "unlimited" and fuelevel < 1 then
- if turtle.refuel(3) then
- print("refulling")
- else print("No Fuel")
- os.shutdown()
- end
- end
- end
- function check()
- if cobblenumber > 1 then
- print("Please put cobble")
- end
- if torchnumber > 1 then
- print("Please put torches")
- end
- if dataname ~= Cobblestone then
- print("Please put cobble")
- end
- if dataname ~= Torches then
- print("Please put torches")
- end
- end
- function forward()
- for i=lenght, 1
- Fuel()
- while turtle.detect() do
- turtle.dig()
- end
- while turtle.detectUp() do
- turtle.digUp()
- end
- while turtle.detectDown = false do
- turtle.select(1)
- turtle.placeDown()
- end
- turtle.forward()
- onlight = onlight + 1
- if onlight = 7 then
- turtle.placeDown(2)
- onlight = onlight - 7
- end
- end
- end
- function returN()
- turtle.turnLeft
- turtle.turnLeft
- for i=lenght, 1
- turtle.forward()
- end
- end
- function times()
- for i = times, 1
- fuel()
- forward()
- onlight = 0
- returN()
- if direction = 1 then
- turtle.turnLeft()
- end
- if direction = 0 then
- turtle.turnRight()
- end
- while turtle.detect() do
- turtle.dig()
- end
- while turtle.detectUp()
- turtle.digUp()
- end
- turtle.forward()
- turtle.forward()
- if direction = 1 then
- turtle.turnLeft()
- end
- if direction = 0 then
- turtle.turnRight()
- end
- end
- end
- function start()
- insert()
- fuel()
- check()
- times()
- end
- start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement