Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Variabili
- n1=0
- -- Torce
- function torce(a,b)
- x=a
- i=b
- if x==3 and i==13 then
- turtle.select(1)
- turtle.placeDown()
- elseif x==4 and i==14 then
- turtle.select(1)
- turtle.placeDown()
- elseif x==8 and i==4 then
- turtle.select(1)
- turtle.placeDown()
- elseif x==8 and i==8 then
- turtle.select(1)
- turtle.placeDown()
- elseif x==8 and i==14 then
- turtle.select(1)
- turtle.placeDown()
- elseif x==12 and i==3 then
- turtle.select(1)
- turtle.placeDown()
- elseif x==12 and i==6 then
- turtle.select(1)
- turtle.placeDown()
- elseif x==12 and i==9 then
- turtle.select(1)
- turtle.placeDown()
- elseif x==12 and i==14 then
- turtle.select(1)
- turtle.placeDown()
- end
- end
- -- Interfaccia
- function text()
- shell.run("clear")
- print("Carburante Necessario: 257")
- end
- function endtext()
- shell.run("clear")
- print("blocchi scavati: ".. n1)
- print("Grazie per aver scelto la Clemente Company")
- end
- -- Svuota
- function svuota()
- turtle.select(4)
- turtle.placeDown()
- for i=5, 16 do
- turtle.select(i)
- turtle.dropDown(64)
- end
- turtle.select(1)
- end
- -- Distruggi Cobble
- function discobble()
- for i=5,16 do
- turtle.select(2)
- if turtle.compareTo(i) then
- turtle.select(i)
- turtle.dropDown(64)
- end
- end
- turtle.select(3)
- turtle.placeDown()
- sleep(0.5)
- turtle.placeDown()
- end
- -- Scavo senza controllo fuel
- function giulio()
- if turtle.detect() == true then
- turtle.dig()
- n1=n1+1
- end
- if turtle.detectUp() == true then
- turtle.digUp()
- n1=n1+1
- end
- if turtle.detectDown() == true then
- turtle.select(4)
- if turtle.compareDown() == false then
- turtle.digDown()
- n1=n1+1
- end
- end
- for x=1, 16 do
- for i=1,16 do
- if turtle.detect() == true then
- turtle.dig()
- n1=n1+1
- end
- turtle.forward()
- if turtle.detectDown() == true then
- turtle.digDown()
- n1=n1+1
- end
- torce(x,i)
- if turtle.detectUp() == true then
- turtle.digUp()
- n1=n1+1
- end
- end
- if x%2 == 0 then
- turtle.turnRight()
- if turtle.detect() == true then
- turtle.dig()
- n1=n1+1
- end
- turtle.forward()
- turtle.turnRight()
- if turtle.detectUp() == true then
- turtle.digUp()
- end
- if turtle.detectDown() == true then
- turtle.digDown()
- end
- else
- turtle.turnLeft()
- if turtle.detect() == true then
- turtle.dig()
- n1=n1+1
- end
- turtle.forward()
- if turtle.detectUp() == true then
- turtle.digUp()
- end
- if turtle.detectDown() == true then
- turtle.digDown()
- end
- turtle.turnLeft()
- end
- discobble()
- end
- end
- -- Input dati
- -- Programma Principale
- text()
- giulio()
- endtext()
- svuota()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement