Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Follow the instructions below in order
- --You will need, 1 advanced mining turtle, 1 bc factory mining well, 1 tesseract from thermal expansion, 1 ender chest from ender storage, 2 chicken chunks chunk loaders, and some fuel for your turtle
- --Place down an advanced mining turtle high in the air away from obstacles facing some direction in a location of choice
- --Place a mining well from bc factory in front of the turtle
- --Place an ender chest from ender storage on top
- --Place a thermal expansion tesseract on top of the mining well and let the turtle collect items
- --Additionally put a fuel source inside of the turtles inventory like coal
- --Put 1 chunk loader from chicken chunks in the turtles inventory and now place down a chunk loader behide the turtle
- --Now run this program on the turtle
- --If all of the above steps are followed correctly then the turtle should automatically move itself forward along with all its items
- --It will also refuel itself constantly when its fuel level is below 50000 and also keep chunks loaded
- function refuel()
- fuel = turtle.getFuelLevel()
- --Checks if fuel level has dropped below 50000, note the advanced turtles hold 100000 so this is 50%
- print("Checking fuel level...")
- print("Current fuel level is " .. fuel)
- if fuel < 50000 then
- position = 1
- print("Fuel level " .. fuel .. " is below 50000")
- print("Refueling...")
- while position < 17 do
- turtle.select(position)
- turtle.refuel()
- position = position+1
- end
- fuel = turtle.getFuelLevel()
- end
- if fuel < 10 then
- print("Fuel level too low to operate. Going to wait 10 seconds then check for fuel.")
- os.sleep(10)
- refuel()
- end
- print("Done refueling. Final fuel level is " .. fuel)
- end
- function clean()
- --Removes the mining well, the ender chest and the tesseract and then moves forward
- print("Cleaning up...")
- turtle.digUp()
- turtle.dig()
- turtle.up()
- turtle.dig()
- turtle.down()
- print("Done cleaning. Now juggling chunk loaders...")
- notFound = true
- while notFound do
- position = 1
- print("Looking for chunk loader...")
- while position < 17 do
- turtle.select(position)
- if turtle.getItemCount(position) > 0 then
- --Nil check
- item = turtle.getItemDetail()
- if item ~= nil then
- if item.name == "ChickenChunks:chickenChunkLoader" then
- print("Chunk loader found!")
- notFound = false
- print("Placing and recyling old chunk loader...")
- turtle.placeUp()
- turtle.turnRight()
- turtle.turnRight()
- turtle.dig()
- turtle.back()
- notFoundTwo = true
- while notFoundTwo do
- positiontwo = 1
- print("Looking for chunk loader...")
- while positiontwo < 17 do
- turtle.select(position)
- if turtle.getItemCount(positiontwo) > 0 then
- --Nil check
- itemtwo = turtle.getItemDetail()
- if itemtwo ~= nil then
- if itemtwo.name == "ChickenChunks:chickenChunkLoader" then
- print("Chunk loader found!")
- notFoundTwo = false
- print("Placing and recyling old chunk loader...")
- turtle.place()
- turtle.up()
- turtle.dig()
- turtle.turnRight()
- turtle.turnRight()
- print("Done recyling chunk loader!")
- positiontwo = 16
- end
- end
- end
- positiontwo = positiontwo+1
- end
- if notFoundTwo then
- print("Could not find chunk loader. Going to wait 10 seconds and then search again.")
- os.sleep(10)
- end
- end
- print("Done recyling chunk loader!")
- position = 16
- end
- end
- end
- position = position+1
- end
- if notFound then
- print("Could not find chunk loader. Going to wait 10 seconds and then search again.")
- os.sleep(10)
- end
- end
- print("Done juggling chunk loaders!")
- end
- function setup()
- --Self explanitory
- print("Setting up...")
- notFound = true
- while notFound do
- position = 1
- print("Looking for tesseract...")
- while position < 17 do
- turtle.select(position)
- if turtle.getItemCount(position) > 0 then
- --Nil check
- item = turtle.getItemDetail()
- if item ~= nil then
- if item.name == "ThermalExpansion:Tesseract" then
- turtle.place()
- position = 16
- print("Tesseract found!")
- notFound = false
- end
- end
- end
- position = position+1
- end
- if notFound then
- print("Could not find tesseract. Going to wait 10 seconds and then search again.")
- os.sleep(10)
- end
- end
- turtle.down()
- notFound = true
- while notFound do
- position = 1
- print("Looking for ender chest...")
- while position < 17 do
- turtle.select(position)
- if turtle.getItemCount(position) > 0 then
- --Nil check
- item = turtle.getItemDetail()
- if item ~= nil then
- if item.name == "EnderStorage:enderChest" then
- turtle.placeUp()
- position = 16
- print("Ender chest found!")
- notFound = false
- end
- end
- end
- position = position+1
- end
- if notFound then
- print("Could not find ender chest. Going to wait 10 seconds and then search again.")
- os.sleep(10)
- end
- end
- notFound = true
- while notFound do
- position = 1
- print("Looking for mining well...")
- while position < 17 do
- turtle.select(position)
- if turtle.getItemCount(position) > 0 then
- --Nil check
- item = turtle.getItemDetail()
- if item ~= nil then
- if item.name == "BuildCraft|Factory:miningWellBlock" then
- turtle.place()
- position = 16
- print("Mining well found!")
- notFound = false
- end
- end
- end
- position = position+1
- end
- if notFound then
- print("Could not find mining well. Going to wait 10 seconds and then search again.")
- os.sleep(10)
- end
- end
- print("Done setting up!")
- end
- function clearItems()
- position = 1
- --Clears all items except for the chunk loader
- print("Clearing items...")
- while position < 17 do
- turtle.select(position)
- if turtle.getItemCount(position) > 0 then
- --Nil check
- item = turtle.getItemDetail()
- if item ~= nil then
- if item.name ~= "ChickenChunks:chickenChunkLoader" then
- turtle.dropUp()
- end
- end
- end
- position = position+1
- end
- print("Done clearing items!")
- end
- function main()
- refuel()
- clearItems()
- clean()
- setup()
- --Feel free to change this time for different heights
- --When provided full power the mining well could dig roughly 10-12 blocks per second
- --On the safe side do height/10 or if you want to cut it close and possibly clean up before the mining well is done then do height/12
- --Tested at a height just below the clouds and a sleep time of 12 seems to work fine
- print("Waiting for mining well to finish...")
- os.sleep(12)
- print("Done waiting!")
- end
- while true do
- main()
- end
- --Changes in revision 1.3
- --Added an additional nil check due to nil values somehow getting past the first nil check
- --In game the turtle might find a few items that cause a nil index error thus the addition of the extra nil check
- --Now if the turtle can't find an item it will continue to search for it and will not do anything until the item is provided
- --Now if there is not enough fuel to operate the turtle will wait until enough fuel is provided
- --End changes in revision 1.3
- --Changes in revision 1.2
- --Fixed typo in program causing the turtle not to turn
- --The turtle will now work in a line and will not move outside of the line and will not place blocks outside this line
- --End changes in revision 1.2
- --Changes in revision 1.1
- --Fixed memory issue caused by infinite recursion
- --The chunk loader chould now be placed behind turtle rather than to the right
- --End changes in revision 1.1
- --Program created by TechOFreak
- --Current program revision is 1.1
- --Feedback is welcomed
- --Visit my youtube channel at https://www.youtube.com/c/techofreak128
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement