Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --startup
- term.write("Insert Length: ")
- Length = tonumber(read())
- print(" ")
- term.write("Insert - times 3 - Width: ")
- Width = tonumber(read())
- print(" ")
- local Length = Length
- local Width = Width
- local goRight = 0
- local torchSlot = 1
- local chestSlot = 2
- local counter = 0
- local torchCounter = 0
- local secondCounter = 0
- local firstStartup = 0
- function torchesslotcheck()
- if turtle.getItemCount(torchslot) < 1 then
- print("put torches in slot 1!")
- repeat
- sleep (1.1)
- until turtle.getItemCount(torchslot) > 1
- end
- if turtle.getItemCount(chestSlot) < 1 then
- print("put chestes in slot 2!")
- repeat
- sleep (1.1)
- until turtle.getItemCount(chestSlot) >= 1
- end
- end
- function mineForward()
- turtle.select(1)
- print(counter)
- -- dig vooruit, dig boven, dig onder
- repeat
- turtle.dig()
- until not turtle.detect() == true
- repeat
- turtle.digUp()
- until turtle.up() == true
- turtle.down()
- turtle.digDown()
- if firstStartup == 0 then
- turtle.select(2)
- turtle.placeDown()
- firstStartup = 1
- select(1)
- end
- -- ga naar links, dig, naar voren, dig up
- turtle.turnLeft()
- repeat
- turtle.dig()
- until not turtle.detect() == true
- turtle.forward()
- repeat
- turtle.digUp()
- until turtle.up() == true
- turtle.down()
- turtle.digDown()
- -- ga naar rechts, vooren, dig up dig down
- turtle.turnRight()
- turtle.turnRight()
- turtle.forward()
- repeat
- turtle.dig()
- until not turtle.detect() == true
- turtle.forward()
- repeat
- turtle.digUp()
- until turtle.up() == true
- turtle.down()
- turtle.digDown()
- -- ga weer terug naar midden positie
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.forward()
- turtle.turnRight()
- turtle.forward()
- print(counter)
- repeat
- turtle.dig()
- until not turtle.detect() == true
- counter = counter + 1
- secondCounter = secondCounter + 1
- if Length > 8 then
- if secondCounter == 8 then
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.forward()
- turtle.select(1)
- turtle.placeDown()
- torchCounter = torchCounter + 1
- secondCounter = 0
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.forward()
- end
- end
- if Length < 8 then
- if secondCounter == Length then
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.forward()
- turtle.select(1)
- turtle.placeDown()
- torchCounter = torchCounter + 1
- secondCounter = 0
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.forward()
- end
- end
- checkSlots()
- endCheck()
- end
- function checkSlots()
- turtle.getItemCount(16)
- if turtle.getItemCount(16) > 0 then
- print("gotte go clean my inventory!")
- turtle.turnLeft()
- turtle.turnLeft()
- for i=1,counter do
- turtle.forward()
- end
- if goRight == 0 then
- for q=3,16 do
- turtle.select(q)
- turtle.dropDown()
- end
- turtle.turnLeft()
- turtle.turnLeft()
- for i=1,counter do
- turtle.forward()
- end
- end
- if goRight > 0 then
- turtle.turnLeft()
- x = 0
- repeat
- turtle.forward()
- turtle.forward()
- turtle.forward()
- x = x + 1
- until x == goRight
- for q=3,16 do
- turtle.select(q)
- turtle.dropDown()
- end
- x = 0
- repeat
- turtle.forward()
- turtle.forward()
- turtle.forward()
- x = x + 1
- until x == goRight
- turtle.turnRight()
- for i=1,counter do
- turtle.forward()
- end
- end
- end
- end
- function endCheck()
- turtle.getItemCount(1)
- if turtle.getItemCount(1) == 1 then
- turtle.placeDown()
- turtle.turnLeft()
- turtle.turnLeft()
- for i=1,counter do
- turtle.forward()
- end
- end
- end
- function goBack()
- print("gotte go back!")
- turtle.turnLeft()
- turtle.turnLeft()
- for i=1,counter do
- turtle.forward()
- end
- for q=3,16 do
- turtle.select(q)
- turtle.dropDown()
- end
- turtle.turnRight()
- repeat
- turtle.dig()
- until not turtle.detect() == true
- i = 0
- repeat
- turtle.forward()
- repeat
- turtle.dig()
- until not turtle.detect() == true
- turtle.forward()
- repeat
- turtle.digUp()
- until turtle.up() == true
- turtle.down()
- turtle.digDown()
- i = i + 1
- until i == 1
- turtle.turnRight()
- end
- print("Lets GO!")
- torchesslotcheck()
- repeat
- repeat
- mineForward()
- until counter == Length
- goBack()
- goRight = goRight + 1
- counter = 0
- until goRight == Width
- print ("DONE?")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement