Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- x = 0
- y = 0
- z = 0
- o = 1
- function dejotodo()
- tempx = x
- tempy = y
- tempz = z
- tempo = o
- if z > 1 then
- if o == 4 then
- turtle.turnLeft()
- o = 3
- else
- repeat
- turtle.turnRight()
- o = o + 1
- until o == 3
- end
- repeat
- repeat
- turtle.dig()
- until turtle.forward() == true
- z = z - 1
- until z == 1
- end
- if y > 0 then
- repeat
- repeat
- turtle.digDown()
- until turtle.down() == true
- y = y - 1
- until y == 0
- end
- turtle.turnRight()
- o = 4
- if x > 0 then
- repeat
- repeat
- turtle.dig()
- until turtle.forward() == true
- x = x - 1
- until x == 0
- end
- turtle.turnLeft()
- o = 3
- turtle.forward()
- z = 0
- for i=1,14 do
- turtle.select(i)
- turtle.drop()
- end
- turtle.turnLeft()
- turtle.turnLeft()
- o = 1
- turtle.forward()
- z = 1
- turtle.turnRight()
- o = o + 1
- if x < tempx then
- repeat
- repeat
- turtle.dig()
- until turtle.forward() == true
- x = x + 1
- until x == tempx
- end
- if y < tempy then
- repeat
- repeat
- turtle.digUp()
- until turtle.up() == true
- y = y + 1
- until y == tempy
- end
- turtle.turnLeft()
- o = o - 1
- if z < tempz then
- repeat
- repeat
- turtle.dig()
- until turtle.forward() == true
- z = z + 1
- until z == tempz
- end
- if tempo == 4 then
- turtle.turnLeft()
- o = 4
- else
- repeat
- turtle.turnRight()
- o = o + 1
- until o == tempo
- end
- end
- function paraarriba ()
- for o=1,arriba do
- repeat
- turtle.digUp()
- until turtle.up() == true
- y = y + 1
- turtle.select(15)
- if turtle.compareTo(14) == false then
- dejotodo()
- end
- end
- end
- function paraabajo ()
- for p=1,arriba do
- repeat
- turtle.digDown()
- until turtle.down() == true
- y = y - 1
- end
- end
- function pasada (derecha, arriba)
- b = false
- for j=1,derecha do
- if b == true then
- paraabajo(arriba)
- b = false
- else
- paraarriba(arriba)
- b = true
- end
- if derecha ~= j then
- repeat
- turtle.dig()
- until turtle.forward() == true
- if o == 2 then
- x = x + 1
- else
- x = x - 1
- end
- end
- end
- end
- term.clear()
- term.setCursorPos(1,3)
- write("Cuanto va a picar hacia la derecha? ")
- derecha = tonumber(read())
- term.clear()
- term.setCursorPos(1,3)
- write("Cuanto va a picar hacia arriba? ")
- arriba = tonumber(read())
- arriba = arriba - 1
- term.clear()
- term.setCursorPos(1,3)
- write("Cuanto va a picar de profundo? ")
- profundo = tonumber(read())
- if derecha%2 == 1 then
- impar = true
- else
- impar = false
- end
- side = false
- for i=1,profundo do
- turtle.dig()
- turtle.forward()
- z = z + 1
- if side == false then
- turtle.turnRight()
- o = o + 1
- if o > 4 then 0 = 1 end
- else
- turtle.turnLeft()
- o = o - 1
- if o < 1 then 0 = 4 end
- end
- pasada(derecha, arriba)
- if impar == true then
- for i=1,arriba do
- repeat
- turtle.digDown()
- until turtle.down() == true
- end
- end
- if side == false then
- turtle.turnLeft()
- o = o - 1
- if o < 1 then 0 = 4 end
- side = true
- else
- turtle.turnRight()
- o = o + 1
- if o > 4 then 0 = 1 end
- side = false
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement