Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- This programme is developed by MrReps. You can use it as you want --
- -- Thanks to MinoCraft ( youTube chanel https://www.youtube.com/channel/UCt1I1rEBRLYRE0sUhSTI_Tg) --
- -- for his help and tutorial --
- -- If they are any problem contact me on pastebin, and i will fixe it --
- -- Working --
- -- the Turtle moves forward and puts block under it or it will be replace by a new block, if it has changed by --
- -- a botania flower (stone into livingstone, stone into ores....). When it meets a block, it TURN RIGHT, --
- -- if it's a chest, the turtle take coal, block (stone, wood, netherrack...) and drop into the chest what it --
- -- has mine. If they are a redstone signal on the turtle, the turtle is stop until it be off --
- -- The slot 1 is for the block, which will be placed by the turtle (stone, wood...) --
- -- The slot 2 is for the chest (it's can be all chest vanilla or not) --
- -- The slot 16 is for the coal, you can also use things can burn but you need ajust "coalMin" if you use thing, --
- -- which have a poor burn value or if the turtle have a long travel between each chest. --
- -- Don't forget to active Waitingflower when you use pure daisy, to have a breaktime at each chest, like that --
- -- you reduce lag on your serveur. The waiting time can be configure in the "waitTime" (in seconde) --
- -- Use blockmin to have a minimal block into the turtle, if it don't have enought block, it will be stop at a --
- -- chest to wait enought block to restart. Thanks --
- local FuelMin = 5 -- level minimal of fuel for the turtle
- local coalMin = 4 -- level minimal of coal in the turtle
- local blockmin = 0 -- level of minimal block in the turtle, if 0 the fonction is disabled
- local Waitingflower = false -- if true wait before moving, if false no waiting
- local waitTime = 100 -- waiting time when Waitinflower is active
- local rsSide = "left" -- side where you apply a redstone signal on the turtle
- --Programme
- local i = 0 --don't care about this
- function redstone() --fonction pour stopper la turtle avec de la redstone
- local reds = false
- reds = rs.getInput(rsSide)
- while reds == true do
- sleep(5)
- reds = rs.getInput(rsSide)
- end
- end
- function pause() --fonction d'attente de block
- local stock = 0
- local prendre = 0
- local resultat = false
- if blockmin ~= 0 then
- turtle.select(1)
- stock = turtle.getItemCount()
- if stock < blockmin then
- resultat = true
- end
- while resultat == true do
- sleep(10)
- turtle.select(1)
- prendre = 64 - stock
- turtle.suck(prendre)
- for i=1,13 do
- turtle.select(i+2)
- turtle.drop()
- i = i+1
- end
- stock = turtle.getItemCount()
- if stock < blockmin then
- resultat = true
- end
- end
- end
- end
- function wait() -- fonction pour attente
- if Waitingflower == true then
- sleep(waitTime)
- end
- end
- function compareblock()--fonction pour verifier les blocks miner si identique et replacer
- local block = false
- turtle.select(1)
- block = turtle.compareDown()
- if block == false then
- turtle.digDown()
- turtle.placeDown()
- end
- end
- function checkchest() --verifie si c'est un chest, si ou ce vide, se reremplie et se rufuel si besoin
- local block = false
- local prendre = 0
- local stock = 0
- turtle.select(2)
- block = turtle.compare()
- if block == true then
- turtle.select(1)
- stock = turtle.getItemCount()
- prendre = 64 - stock
- turtle.suck(prendre)
- for i=1,13 do
- turtle.select(i+2)
- turtle.drop()
- i = i+1
- end
- Takefuel()
- pause()
- wait()
- end
- end
- function checkFuel() -- se refuel si besoin
- local niveauFuel = turtle.getFuelLevel()
- if (niveauFuel ~= "unlimited") then
- if (niveauFuel < FuelMin) then
- turtle.select(16)
- turtle.refuel(1)
- end
- end
- end
- function Takefuel() --Recupere le fuel dans le chest
- local NBcharbon = 0
- turtle.select(16)
- NBcharbon = turtle.getItemCount()
- if (NBcharbon < coalMin) == true then
- turtle.suck(coalMin)
- end
- end
- while true do -- boucle
- checkFuel()
- checkchest()
- redstone()
- if turtle.detect() == true then
- turtle.turnRight()
- end
- compareblock()
- turtle.forward()
- end
Add Comment
Please, Sign In to add comment