Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("STRIPMINE STARTEN")
- print("PN Creep4Play fuer mehr Info.")
- os.sleep(4)
- term.clear()
- term.setCursorPos(1,1)
- function digU()
- while turtle.detectUp() do
- turtle.digUp()
- end
- end
- function digF()
- while turtle.detect() do
- turtle.dig()
- end
- end
- function digD()
- while turtle.detectDown() do
- turtle.digDown()
- end
- end
- function goU(proof)
- repeat
- digU()
- if proof then
- if not proofFuel(false) then
- return false
- end
- end
- until turtle.up()
- return true
- end
- function goF(proof)
- repeat
- digF()
- if proof then
- if not proofFuel(false) then
- return false
- end
- end
- until turtle.forward()
- return true
- end
- function goD(proof)
- repeat
- digD()
- if proof then
- if not proofFuel(false) then
- return false
- end
- end
- until turtle.down()
- return true
- end
- function proofFuel(wait)
- while turtle.getFuelLevel()<(mainGone+subGone+2) do
- local broken=false
- for i=16,1,-1 do
- if turtle.getItemCount(i)>0 then
- turtle.select(i)
- if turtle.refuel(1) then
- broken=true
- break
- end
- end
- end
- if not broken then
- if wait then
- os.sleep(1)
- else
- return false
- end
- end
- turtle.select(1)
- end
- return true
- end
- function goBack()
- turtle.turnRight()
- turtle.turnRight()
- if inSub then
- for i=1,subGone do
- goF(false)
- end
- if (thisSub%2)==0 then
- turtle.turnLeft()
- else
- turtle.turnRight()
- end
- end
- for i=1,mainGone do
- goF(false)
- end
- local fuel=false
- for i=3,16 do
- if turtle.getItemCount(i)>0 then
- turtle.select(i)
- if not turtle.refuel(0) then
- turtle.drop()
- elseif fuel then
- turtle.drop()
- else
- fuel=true
- end
- end
- end
- turtle.select(1)
- turtle.turnRight()
- turtle.turnRight()
- end
- function invFull()
- for i=1,16 do
- if turtle.getItemCount(i)==0 then
- return false
- end
- end
- return true
- end
- function awaitFuel()
- term.clear()
- term.setCursorPos(1,1)
- print("Stripmining:")
- print("")
- print("Add more fuel to continue.")
- goBack()
- proofFuel(true)
- term.clear()
- term.setCursorPos(1,1)
- print("Stripmining:")
- print("")
- print("Put some cobblestones on slot 1.")
- print("Put torches on slot 2.")
- print("Put fuel on any slot.")
- print("Number of strips: "..subNumber)
- print("Length of strips: "..subLength)
- end
- function place()
- if not turtle.detectDown() then
- if turtle.getItemCount(1)>1 then
- turtle.placeDown()
- return
- end
- for i=3,16 do
- if turtle.compareTo(i) then
- turtle.select(i)
- turtle.placeDown()
- turtle.select(1)
- break
- end
- end
- end
- end
- term.clear()
- term.setCursorPos(1,1)
- print("Stripmining:")
- print("")
- print("Put some cobblestones on slot 1.")
- print("Put torches on slot 2.")
- print("Put fuel on any slot.")
- print("Number of strips:")
- repeat
- term.setCursorPos(19,6)
- print(" ")
- term.setCursorPos(19,6)
- subNumber=tonumber(read())
- until subNumber>0
- term.setCursorPos(1,7)
- print("Length of strips:")
- repeat
- term.setCursorPos(19,7)
- print(" ")
- term.setCursorPos(19,7)
- subLength=tonumber(read())
- until subLength>0
- thisSub=0
- for i1=1,subNumber do
- local broken=false
- thisSub=thisSub+1
- inSub=false
- subGone=0
- repeat
- broken=false
- mainGone=0
- for i2=1,(thisSub+(thisSub%2))*2 do
- if not goF(true) then
- awaitFuel()
- broken=true
- break
- end
- mainGone=mainGone+1
- place()
- if (thisSub%2)==1 then
- if i2>(thisSub-1)*2 then
- digU()
- end
- else
- if i2==(thisSub-1)*2 then
- turtle.select(2)
- turtle.placeUp()
- turtle.select(1)
- end
- end
- end
- until not broken
- if (thisSub%2)==0 then
- turtle.turnRight()
- else
- turtle.turnLeft()
- end
- inSub=true
- for iS=1,subLength do
- if not goF(true) then
- awaitFuel()
- broken=true
- break
- end
- subGone=subGone+1
- place()
- digU()
- if invFull() then
- break
- end
- end
- if not broken then
- goBack()
- end
- end
- term.clear()
- term.setCursorPos(1,1)
- print("STRIPMINE FERTIG")
- print("PN Creep4Play fuer mehr Info.")
Advertisement
Add Comment
Please, Sign In to add comment