Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local deep
- local far
- print("How deep per tunnel?")
- deep = tonumber(io.read())
- print("How many do you want?")
- far = tonumber(io.read())
- print("pls give me Torches into inv.2 and chests in inv.3")
- io.read()
- function Check()
- if(turtle.getItemCount(2)>=far) then
- textutils.slowPrint("You have given me enough torches thx <3")
- else
- textutils.slowPrint("I NEED MORE TORCHES")
- os.shutdown()
- end
- if(turtle.getItemCount(2)>=2) then
- textutils.slowPrint("THX for the chests")
- else
- textutils.slowPrint("I NEED CHESTS inv 3")
- end
- end
- function Strip(dep)
- if turtle.getFuelLevel() <= 2 then
- write("Fuel low")
- Refuel()
- end
- turtle.turnLeft()
- for i=1,dep do
- Dig()
- DigUp()
- Forward()
- end
- DigUp()
- turtle.turnLeft()
- turtle.turnLeft()
- for i=2,dep do
- Forward()
- end
- for i=1,dep do
- Dig()
- DigUp()
- Forward()
- end
- DigUp()
- end
- function Refuel()
- turtle.select(1)
- turtle.refuel(20)
- for i=4,16 do
- turtle.select(i)
- turtle.refuel()
- end
- turtle.select(1)
- end
- function InvFull()
- if(turtle.getItemCount(16)>=1) then
- print("Invetory DUMP")
- turtle.select(3)
- turtle.digDown()
- turtle.placeDown()
- os.sleep(1)
- for inv=4,16 do
- turtle.select(inv)
- turtle.dropDown()
- end
- end
- turtle.select(1)
- end
- function Dig()
- while(turtle.detect()) do
- turtle.dig()
- end
- end
- function DigUp()
- while(turtle.detectUp()) do
- turtle.digUp()
- end
- end
- function Forward()
- if(turtle.detectDown()) then
- turtle.forward()
- else
- turtle.select(4)
- turtle.placeDown(4)
- turtle.select(1)
- turtle.forward()
- end
- end
- function fackel()
- turtle.up()
- turtle.select(2)
- turtle.placeDown()
- turtle.select(1)
- Dig()
- Forward()
- turtle.digDown()
- turtle.down()
- end
- function Gang()
- Strip(deep)
- turtle.turnLeft()
- turtle.turnLeft()
- for i=2,deep do
- Forward()
- end
- turtle.turnRight()
- fackel()
- InvFull()
- Dig()
- DigUp()
- Forward()
- Dig()
- DigUp()
- Forward()
- end
- Check()
- for i=1,far do
- print("FUEL: "..turtle.getFuelLevel())
- write("Gang: "..i)
- Gang()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement