Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- momfuellevel = 0
- aufsammeln = 40
- fuellevel = 100
- count = 0
- anzahl1 = 0
- anzahl2 = 0
- treeblock = "minecraft:log"
- steinblock = "minecraft:cobblestone"
- chestdistance = 5
- zaehler = 0
- zaehler1 = 0
- j = 0
- -- (Standart)--
- function forward()
- refuel()
- zaehler1 = zaehler1 +1
- while(turtle.forward()==false) do
- print("WARNUNG Block im Weg !!")
- turtle.attack()
- turtle.dig()
- sleep(2)
- end
- end
- function up()
- refuel()
- while(turtle.up()==false) do
- if turtle.detectUp() then
- turtle.digUp()
- end
- end
- end
- function down()
- refuel()
- while(turtle.down()==false) do
- if turtle.detectDown() then
- turtle.digDown()
- end
- turtle.attackDown()
- end
- end
- function back()
- refuel()
- while(turtle.back()==false) do
- print("WARNUNG Block im Weg !!")
- end
- end
- function refuel()
- if fuellevel > 5000 then
- fuellevel = 3000
- end
- if fuellevel < 11 then
- fuellevel = 60
- end
- fuellevel = fuellevel + 1
- if(turtle.getFuelLevel() < fuellevel) then
- turtle.select(16)
- if turtle.getItemCount(16) > 0 then
- turtle.refuel(1)
- momfuellevel = turtle.getFuelLevel()
- print("Aufgetankt "..momfuellevel.." Fuel im Tank")
- print("Neuer Sollwert "..fuellevel.." Fuel")
- refuel()
- else
- print("WARNUNG KEIN FUEL (Slot 16) ")
- print("Neuer Sollwert "..fuellevel.." Fuel")
- fuellevel = fuellevel - 50
- sleep(1)
- for i=1,4 do
- turtle.turnRight()
- end
- refuel()
- sleep(1)
- end
- turtle.select(1)
- end
- end
- function Stein()
- success, data = turtle.inspect()
- while(success and data.name==steinblock) do
- turtle.dig()
- break
- end
- end
- -- (Programm Start Stein) --
- -- überprüfe ob Cobblegenerator gebaut ist --
- function abbauen()
- if turtle.getItemCount(13) <= 61 then
- turtle.dig()
- sleep(5)
- success, data = turtle.inspect()
- if (success and data.name==steinblock) then
- print("Wasser und Lava vorhanden")
- else
- print("-------------------------------")
- print("kein Cobblegenerator vorhanden !")
- print("Fuege Wasser und Lava hinzu !")
- print("Wasser Links und Rechts")
- print("Lava in der Mitte")
- print("-------------------------------")
- sleep(2)
- print("...")
- sleep(2)
- print("Turtle Startet dann automatisch")
- end
- end
- if turtle.getItemCount(13) <= 62 then
- print("Baue 1 Stack Stein ab")
- while turtle.getItemCount(13) <= 62 do
- turtle.select(13)
- Stein()
- turtle.turnLeft()
- Stein()
- turtle.turnRight()
- end
- turtle.select(1)
- print("habe nun 1 Stack Stein im Invi")
- else
- print("Habe schon genug Steine im Invi")
- print("(Slot 13) ")
- end
- end
- --(Baum)-----------------------------------------------------------
- function fell1()
- count = count + 1
- print("Baum Nr. " ..count.. " wird gefaellt!")
- while(turtle.forward()==false) do
- turtle.dig()
- end
- success, data = turtle.inspectUp()
- while(success and data.name==treeblock) do
- turtle.digUp()
- up()
- success, data = turtle.inspectUp()
- end
- while(turtle.down()) do end
- while(turtle.back()==false) do end
- end
- function place()
- turtle.select(4)
- turtle.place()
- turtle.select(1)
- end
- function collect()
- for i=1,4 do
- turtle.suck()
- turtle.turnRight()
- end
- end
- function fc()
- forward()
- for i=1,4 do
- turtle.suck()
- turtle.turnRight()
- end
- end
- function fell()
- turtle.select(8)
- success, data = turtle.inspect()
- if(success and data.name==treeblock) then
- fell1()
- end
- end
- function weg1()
- for i=1,4 do
- fc()
- fc()
- turtle.turnRight()
- fc()
- turtle.turnRight()
- turtle.turnRight()
- forward()
- fc()
- turtle.turnRight()
- turtle.turnRight()
- forward()
- turtle.turnLeft()
- fc()
- fc()
- turtle.turnRight()
- fc()
- fell()
- place()
- turtle.turnRight()
- turtle.turnRight()
- forward()
- fc()
- fell()
- place()
- turtle.turnRight()
- turtle.turnRight()
- fc()
- turtle.turnLeft()
- end
- end
- function Baumlinie1()
- turtle.turnRight()
- forward()
- weg1()
- forward()
- forward()
- forward()
- forward()
- turtle.turnRight()
- turtle.turnRight()
- weg1()
- forward()
- forward()
- forward()
- forward()
- forward()
- turtle.turnRight()
- end
- function Baumlinie2()
- turtle.turnRight()
- turtle.turnRight()
- forward()
- weg1()
- forward()
- forward()
- forward()
- forward()
- turtle.turnRight()
- turtle.turnRight()
- weg1()
- forward()
- forward()
- forward()
- forward()
- forward()
- end
- --(ofen)----------------------------------------------------------------
- function Steinofenbef()
- if turtle.getItemCount(13) > 20 then
- turtle.select(13)
- turtle.dropDown(19)
- turtle.select(1)
- end
- end
- function Steinofenent()
- if turtle.getItemCount(14) < 50 then
- turtle.select(14)
- turtle.suckUp(10)
- turtle.select(1)
- end
- end
- function ofenbef()
- if turtle.getItemCount(16) > 5 then
- turtle.select(16)
- turtle.drop(4)
- turtle.select(1)
- end
- end
- function Holzofenbef()
- if turtle.getItemCount(8) > 10 then
- turtle.select(8)
- turtle.dropDown(9)
- turtle.select(1)
- end
- end
- function Holzofenent()
- if turtle.getItemCount(16) < 50 then
- turtle.select(16)
- turtle.suckUp(10)
- turtle.select(1)
- end
- end
- --(Sortieren)----------------------------------------------------------------
- function Drop()
- for i=1,16 do
- if turtle.getItemCount(i) > 0 then
- turtle.select(i)
- turtle.dropUp()
- end
- end
- end
- function Suck()
- turtle.select(1)
- for i=1,16 do
- turtle.suckUp()
- end
- end
- function Sortieren1(x,z)
- if turtle.getItemCount(x) > 0 then
- for j=1,16 do
- turtle.select(x)
- turtle.transferTo(j)
- end
- end
- for i=1,16 do
- if turtle.getItemCount(i) > 0 then
- if turtle.getItemDetail(i).name == z then
- turtle.select(i)
- turtle.transferTo(x)
- end
- end
- end
- end
- function Sortieren()
- Sortieren1(13,"minecraft:cobblestone")
- Sortieren1(14,"minecraft:stone")
- Sortieren1(15,"minecraft:stonebrick")
- Sortieren1(16,"minecraft:coal")
- Sortieren1(4,"minecraft:sapling")
- Sortieren1(8,"minecraft:log")
- Sortieren1(12,"minecraft:planks")
- print("Sortiert")
- end
- function Dropa()
- forward()
- forward()
- turtle.select(1)
- turtle.dropUp()
- turtle.select(2)
- turtle.dropUp()
- turtle.select(3)
- turtle.dropUp()
- turtle.select(5)
- turtle.dropUp()
- turtle.select(6)
- turtle.dropUp()
- turtle.select(7)
- turtle.dropUp()
- turtle.select(9)
- turtle.dropUp()
- turtle.select(10)
- turtle.dropUp()
- turtle.select(11)
- turtle.dropUp()
- turtle.select(1)
- back()
- back()
- end
- function Dropb()
- turtle.select(4)
- turtle.dropUp()
- turtle.select(8)
- turtle.dropUp()
- turtle.select(12)
- turtle.dropUp()
- turtle.select(13)
- turtle.dropUp()
- turtle.select(14)
- turtle.dropUp()
- turtle.select(15)
- turtle.dropUp()
- turtle.select(16)
- turtle.dropUp()
- turtle.select(1)
- end
- --(Craft)------------------------------------------------------------------------------------------------
- function CraftStein()
- y = 0
- if turtle.getItemCount(14) > 5 and turtle.getItemCount(15) < 60 then
- turtle.select(14)
- turtle.transferTo(1)
- Dropb()
- turtle.select(1)
- turtle.transferTo(14)
- end
- while turtle.getItemCount(14) > 5 and turtle.getItemCount(15) < 60 do
- y = 1
- turtle.select(14)
- turtle.transferTo(1,1)
- turtle.select(14)
- turtle.transferTo(2,1)
- turtle.select(14)
- turtle.transferTo(5,1)
- turtle.select(14)
- turtle.transferTo(6,1)
- end
- turtle.select(15)
- Dropb()
- turtle.craft()
- turtle.select(1)
- if y > 0 then
- Drop()
- Suck()
- Sortieren()
- Dropa()
- print("Steinziegel hergestellt")
- y = 0
- end
- end
- function CraftBretter()
- z = 0
- if turtle.getItemCount(8) > 5 and turtle.getItemCount(12) < 60 then
- turtle.select(8)
- turtle.transferTo(1)
- Dropb()
- turtle.select(1)
- turtle.transferTo(8)
- end
- while turtle.getItemCount(8) > 5 and turtle.getItemCount(12) < 60 do
- turtle.select(8)
- turtle.transferTo(1,1)
- z = 1
- end
- turtle.select(8)
- Dropb()
- turtle.craft()
- turtle.select(1)
- if z > 0 then
- Drop()
- Suck()
- Sortieren()
- Dropa()
- print("Bretter hergestellt")
- z = 0
- end
- end
- function CraftStoneslab()
- turtle.select(16)
- turtle.refuel(3)
- up()
- up()
- turtle.select(13)
- turtle.transferTo(1)
- Dropb()
- turtle.select(1)
- turtle.transferTo(13)
- turtle.select(13)
- turtle.transferTo(1,3)
- turtle.select(13)
- turtle.transferTo(2,3)
- turtle.select(13)
- turtle.transferTo(3,3)
- turtle.select(5)
- Dropb()
- turtle.craft()
- down()
- down()
- end
- function Invi()
- up()
- up()
- Drop()
- Suck()
- Sortieren()
- Dropa()
- CraftStein()
- CraftBretter()
- Drop()
- Suck()
- Sortieren()
- Dropa()
- down()
- down()
- end
- function Ofen()
- up()
- turtle.turnRight()
- --(Kohle nr1)--
- ofenbef()
- turtle.turnRight()
- --(Kohle nr.2)--
- ofenbef()
- up()
- forward()
- --(Ofen nr1)--
- Steinofenbef()
- turtle.turnRight()
- turtle.turnRight()
- forward()
- turtle.turnRight()
- forward()
- --(Ofen nr2)--
- Holzofenbef()
- turtle.turnRight()
- turtle.turnRight()
- forward()
- turtle.turnRight()
- down()
- down()
- back()
- Steinofenent()
- forward()
- turtle.turnRight()
- forward()
- Holzofenent()
- back()
- turtle.turnLeft()
- end
- function ring()
- turtle.select(13)
- for i= 1,4 do
- turtle.turnRight()
- turtle.place()
- end
- turtle.select(1)
- end
- function baucobble()
- turtle.turnLeft()
- forward()
- forward()
- ring()
- up()
- ring()
- up()
- turtle.turnRight()
- forward()
- forward()
- turtle.turnRight()
- forward()
- forward()
- down()
- down()
- ring()
- up()
- ring()
- up()
- forward()
- turtle.turnRight()
- forward()
- down()
- turtle.select(13)
- turtle.placeDown()
- up()
- forward()
- forward()
- turtle.turnRight()
- down()
- down()
- forward()
- turtle.select(13)
- turtle.place()
- turtle.turnRight()
- forward()
- turtle.select(1)
- print("Cobblegenerator gebaut !!")
- end
- function baukiste()
- Sortieren1(1,"minecraft:chest")
- Sortieren1(2,"minecraft:furnace")
- Sortieren1(13,"minecraft:cobblestone")
- if turtle.getItemCount(1) > 1 and turtle.getItemCount(2) > 1 and turtle.getItemCount(13) > 17 then
- up()
- up()
- turtle.select(1)
- turtle.placeUp()
- forward()
- forward()
- turtle.placeUp()
- back()
- back()
- down()
- turtle.turnRight()
- turtle.select(2)
- turtle.place()
- turtle.turnRight()
- turtle.select(2)
- turtle.place()
- turtle.turnRight()
- turtle.turnRight()
- down()
- else
- print("------------------------------")
- print("WARNUNG")
- print("Fuege 2 Kisten und 2 Ofen hinzu")
- print("Zudem mindistens 18 Cobblestone")
- print("ein paar Setzlinge")
- print("und genug Fuel")
- print("------------------------------")
- sleep(5)
- baukiste()
- end
- end
- function baublockup()
- for i= 1,4 do
- forward()
- forward()
- forward()
- forward()
- turtle.placeUp()
- end
- end
- function baufarm()
- if turtle.getItemCount(13) > 8 then
- CraftStoneslab()
- back()
- back()
- up()
- up()
- up()
- up()
- up()
- turtle.turnRight()
- forward()
- baublockup()
- turtle.turnLeft()
- forward()
- forward()
- forward()
- forward()
- turtle.placeUp()
- turtle.turnLeft()
- for i= 1,3 do
- forward()
- forward()
- forward()
- forward()
- turtle.placeUp()
- end
- forward()
- forward()
- forward()
- turtle.turnLeft()
- forward()
- forward()
- forward()
- baublockup()
- turtle.turnRight()
- forward()
- forward()
- forward()
- forward()
- turtle.turnRight()
- turtle.placeUp()
- for i= 1,3 do
- forward()
- forward()
- forward()
- forward()
- turtle.placeUp()
- end
- forward()
- forward()
- forward()
- down()
- down()
- down()
- down()
- down()
- turtle.turnRight()
- forward()
- forward()
- turtle.turnLeft()
- forward()
- forward()
- else
- Start()
- end
- end
- --(Start)---------------------------------------------------
- function Start()
- turtle.turnRight()
- forward()
- turtle.turnLeft()
- success, data = turtle.inspect()
- if (success and data.name==steinblock) then
- print("Cobblegenerator vorhanden")
- turtle.turnLeft()
- forward()
- turtle.turnRight()
- else
- turtle.turnLeft()
- forward()
- turtle.turnRight()
- baukiste()
- Invi()
- baucobble()
- Invi()
- abbauen()
- Invi()
- baufarm()
- --- bau cobble baum farm usw.
- end
- end
- --(Programm)------------------------------------------
- Start()
- while true do
- Invi()
- abbauen()
- Ofen()
- Invi()
- Baumlinie1()
- Invi()
- abbauen()
- Ofen()
- Invi()
- Baumlinie2()
- zaehler = zaehler +1
- print("-------------------------------")
- print("-------------------------------")
- print("Runde " ..zaehler.. "")
- print("Schritte " ..zaehler1.. "")
- print("-------------------------------")
- print("-------------------------------")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement