Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- turtle.refuel()
- local plantDistance = 4
- local circles = 0
- local circlesDone = 0
- local circlesDinstance = 4
- local startHight = 0
- local endHight = 0
- local chestHight = 0
- local hight = 0
- print("Current Hight:")
- hight = tonumber(read())
- print("")
- print("Start Hight:")
- startHight = tonumber(read())
- print("")
- print("Circles:")
- circles = tonumber(read())
- print("")
- local success, block = nil
- local Ores = {
- "minecraft:coal_ore",
- "minecraft:iron_ore",
- "minecraft:gold_ore",
- "minecraft:diamond_ore",
- "minecraft:lapis_ore",
- "minecraft:lit_redstone_ore",
- "minecraft:emerald_ore",
- "thermalfoundation:ore",
- "thermalfoundation:ore_fluid",
- "ic2:resource",
- "bigreactors:oreyellorite",
- "appliedenergistics2:quartz_ore",
- "appliedenergistics2:charged_quartz_ore",
- "deepresonance:resonating_ore",
- "draconicevolution:draconium_ore",
- "thaumcraft:ore_cinnabar",
- "thaumcraft:ore_amber",
- "thaumcraft:ore_quartz",
- "projectred-exploration:ore",
- "forestry:resources",
- "bigreactors:orebenitoite",
- "bigreactors:oreanglesite",
- "biomesoplenty:gem_ore",
- "astralsorcery:blockcustomore",
- "actuallyadditions:block_misc",
- "minecraft:quartz_ore",
- "rftools:dimensional_shard_ore",
- "quark:biotite_ore",
- "railcraft:ore_metal_poor",
- "railcraft:ore_metal",
- "railcraft:ore_magic",
- "woot:stygianironore",
- }
- local Trash = {"minecraft:cobblestone","minecraft:dirt","minecraft:stone","minecraft:gravel",}
- function forward()
- turtle.attack()
- turtle.forward()
- end
- function up()
- turtle.attackUp()
- turtle.up()
- end
- function down()
- turtle.attackDown()
- turtle.down()
- end
- function digForward()
- while turtle.detect() do
- turtle.dig()
- end
- forward()
- end
- function Ore()
- success, block = turtle.inspectUp()
- for i=1,#Ores do
- if Ores[i] == block.name then
- block = nil
- turtle.digUp()
- up()
- Ore()
- down()
- break
- end
- end
- for i=1,4 do
- success, block = turtle.inspect()
- for i=1,#Ores do
- if Ores[i] == block.name then
- block = nil
- while turtle.detect() do
- turtle.dig()
- end
- forward()
- Ore()
- turtle.turnRight()
- turtle.turnRight()
- forward()
- turtle.turnRight()
- turtle.turnRight()
- break
- end
- end
- turtle.turnRight()
- end
- success, block = turtle.inspectDown()
- for i=1,#Ores do
- if Ores[i] == block.name then
- block = nil
- turtle.digDown()
- down()
- Ore()
- up()
- break
- end
- end
- end
- function placeCheckpoint()
- turtle.digDown()
- turtle.select(1)
- turtle.placeDown()
- end
- function toNextCheckpoint()
- repeat
- forward()
- success, block = turtle.inspectDown()
- until block.name == "minecraft:netherrack"
- end
- function toNextPlant()
- for i = 1, plantDistance do
- up()
- end
- placeCheckpoint()
- end
- function testIfFull()
- local counter = 0
- for i= 1, 16 do
- turtle.select(i)
- if turtle.getItemCount() > 0 then
- counter = counter + 1
- end
- end
- if counter > 12 then
- return true
- else
- return false
- end
- end
- function returnToCenter()
- for i = 1, circlesDone do
- toNextCheckpoint()
- end
- end
- function returnToChest()
- repeat
- up()
- success, block = turtle.inspect()
- until block.name == "minecraft:netherrack"
- end
- function returnToPlant()
- repeat
- down()
- success, block = turtle.inspectDown()
- until block.name == "minecraft:netherrack"
- end
- function returnToWork()
- for i = 1, circlesDone do
- toNextCheckpoint()
- end
- end
- function emptyInventorry()
- returnToCenter()
- turtle.turnRight()
- turtle.turnRight()
- returnToChest()
- chestDropp()
- returnToPlant()
- returnToWork()
- end
- function dumpTrash()
- for i = 1, 16 do
- turtle.select(i)
- if turtle.getItemCount() > 0 then
- local item = turtle.getItemDetail()
- for i = 1, #Trash do
- if item.name == Trash[i] then
- turtle.drop()
- end
- end
- end
- end
- end
- function startUp()
- for i = 1,4 do
- turtle.dig()
- turtle.place()
- turtle.turnRight()
- end
- while hight > startHight do
- turtle.digDown()
- down()
- hight = hight - 1
- end
- placeCheckpoint()
- end
- function doMainStrip()
- for i=1,circlesDinstance do
- digForward()
- Ore()
- end
- placeCheckpoint()
- circlesDone = circlesDone + 1
- turtle.turnRight()
- dumpTrash()
- end
- function doStrip()
- for i=1, circlesDinstance * circlesDone do
- digForward()
- Ore()
- end
- turtle.turnRight()
- turtle.turnRight()
- toNextCheckpoint()
- dumpTrash()
- end
- function doModul()
- doMainStrip()
- dumpTrash()
- doStrip()
- dumpTrash()
- if testIfFull() then
- turtle.turnLeft()
- emptyInventorry()
- turtle.turnLeft()
- end
- doStrip()
- dumpTrash()
- if testIfFull() then
- turtle.turnRight()
- emptyInventorry()
- else
- turtle.turnLeft()
- end
- end
- function doSection()
- for i = 1, circles do
- doModul()
- end
- turtle.turnRight()
- turtle.turnRight()
- returnToCenter()
- circlesDone = 0
- end
- function doPlant()
- for i = 1, 4 do
- doSection()
- turtle.turnRight()
- end
- toNextPlant()
- end
- function fuel()
- if turtle.getFuelLevel() < 7000 then
- turtle.refuel()
- end
- end
- function chestDropp()
- for i=2,16 do
- turtle.select(i)
- fuel()
- turtle.dropUp()
- end
- end
- startUp()
- while true do
- doPlant()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement