Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while true do
- -- cyklus pro kopani 64x dolu
- -- turtla bude kopat dolů a posílat itemy do EnderChest
- -- před startem je třeba provést ošetření/kontrolu, zda turtla nemá nad sebou Ender Chest, pokud ano, vcucni ji a dej do slotu 3
- -- kontrola je nutná kvůli odhlášení, či restartu serveru
- turtle.select(3)
- local success, data = turtle.inspectUp()
- if success then
- print("Block name: ", data.name)
- dataEnder = data.name
- print("Block metadata: ", data.metadata)
- if dataEnder == "EnderStorage:enderChest" then
- print("Nalezena Ender Chest")
- turtle.digUp()
- end
- end
- --provedeme prvotni refuel, aby Turtla mohla dělat posun
- turtle.select(1)
- turtle.refuel()
- print("Proveden refuel...")
- for a=1,64,1 do
- turtle.select(1)
- turtle.digDown()
- turtle.select(2)
- turtle.dig()
- turtle.down()
- --provedeme kontrolu, zda neni natezen Coal v sl. 1,2
- --pokud je natezen Coal, proved Refuel
- local data1 = turtle.getItemDetail()
- if data1 then
- print("Item name: ", data1.name)
- dataX1 = data1.name
- if dataX1 == "minecraft:coal" then
- print("Nalezen coal. Provedu refuel.")
- turtle.refuel()
- end
- print("Item damage value: ", data1.damage)
- print("Item count: ", data1.count)
- end
- local data2 = turtle.getItemDetail()
- turtle.select(2)
- if data2 then
- print("Item name: ", data2.name)
- dataX2 = data2.name
- if dataX2 == "minecraft:coal" then
- print("Nalezen coal. Provedu refuel.")
- turtle.refuel()
- end
- print("Item damage value: ", data2.damage)
- print("Item count: ", data2.count)
- end
- turtle.select(3)
- -- Enderchest musi byt umistena ve slotu 3
- --poloz Ender Chest a Slot 1,2 vyprazdni do Ender Chest
- turtle.placeUp()
- turtle.select(1)
- turtle.dropUp()
- turtle.select(2)
- turtle.dropUp()
- --vrat Ender Chest do slotu 3
- turtle.select(3)
- turtle.digUp()
- a=a+1
- print(a)
- end
- turtle.forward()
- --vyjedeme pro jistotu o 5 výše kvuli bedrocku
- turtle.up()
- turtle.up()
- turtle.up()
- turtle.up()
- turtle.up()
- --otocime Turtlu doprava a dig, a popojedeme dopredu,aby nejela nahoru naprazdno
- --turtle.turnRight()
- turtle.dig()
- turtle.forward()
- a=0
- print("Jedu nahoru")
- -- cyklus pro vraceni
- for a=1,59,1 do
- turtle.select(1)
- turtle.digUp()
- turtle.select(2)
- turtle.dig()
- --provedeme kontrolu, zda neni natezen Coal v sl. 1,2
- --pokud je natezen Coal, proved Refuel
- local data1b = turtle.getItemDetail()
- turtle.select(1)
- if data1b then
- print("Item name: ", data1b.name)
- dataX1b = data1b.name
- if dataX1b == "minecraft:coal" then
- print("Nalezen coal. Provedu refuel.")
- turtle.refuel()
- end
- print("Item damage value: ", data1b.damage)
- print("Item count: ", data1b.count)
- end
- local data2b = turtle.getItemDetail()
- turtle.select(2)
- if data2b then
- print("Item name: ", data2b.name)
- dataX2b = data2b.name
- if dataX2b == "minecraft:coal" then
- print("Nalezen coal. Provedu refuel.")
- turtle.refuel()
- end
- print("Item damage value: ", data2b.damage)
- print("Item count: ", data2b.count)
- end
- turtle.select(3)
- -- Enderchest musi byt umistena ve slotu 3
- --poloz Ender Chest a Slot 1,2 vyprazdni do Ender Chest
- turtle.placeUp()
- turtle.select(1)
- turtle.dropUp()
- turtle.select(2)
- turtle.dropUp()
- --vrat Ender Chest do slotu 3
- turtle.select(3)
- turtle.digUp()
- turtle.up()
- a=a+1
- print(a)
- end
- --opakujeme tezbu v dalsim sloupci
- turtle.dig()
- turtle.forward()
- turtle.dig()
- turtle.forward()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement