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
- j = 0
- -- (Standart)--
- function forward()
- refuel()
- while(turtle.forward()==false) do
- print("WARNUNG Block im Weg !!")
- turtle.attack()
- 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(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")
- refuel()
- else
- print("WARNUNG KEIN FUEL (Slot 16) ")
- 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()
- success, data = turtle.inspect()
- if (success and data.name==steinblock) then
- print("Cobblegenerator Vorhanden")
- else
- print("kein Cobblegenerator vorhanden !")
- 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(Slot 13) ")
- end
- end
- function fell()
- 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()
- if turtle.getItemCount(4) > 1 then
- turtle.select(4)
- turtle.place()
- turtle.select(1)
- end
- end
- function collect()
- for i=1,4 do
- turtle.suck()
- turtle.turnRight()
- end
- 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()
- 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)
- 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 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()
- Holzofenent()
- back()
- turtle.turnLeft()
- end
- Invi()
- abbauen()
- Ofen()
- Invi()
Advertisement
Add Comment
Please, Sign In to add comment