Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- programa para contruir los portales de la subestacion electrica
- -- altura de las torres
- htorre = 12
- -- altura de la viga
- hviga = 10
- -- longitud de la viga
- lviga = 15
- -- funcion para colocar bloque
- turtle.select(1)
- function colocarBloque(direccion)
- -- seleccionamos el siguiente slot con materiales
- while (turtle.getItemCount() == 0) and (turtle.getSelectedSlot() < 16) do
- turtle.select(turtle.getSelectedSlot() + 1)
- end
- if (turtle.getItemCount() == 0) and (turtle.getSelectedSlot() == 16) then
- return false
- end
- if direccion == 'delante' then
- turtle.place()
- elseif direccion == 'debajo' then
- turtle.placeDown()
- end
- return true
- end
- -- construimos la primera torre
- for k = 1, htorre do
- turtle.up()
- if not colocarBloque('debajo') then
- return
- end
- end
- -- contruimos la viga
- turtle.forward()
- for k = 1, htorre - hviga do
- turtle.down()
- end
- for k = 1, lviga do
- if not colocarBloque('debajo') then
- return
- end
- turtle.forward()
- end
- -- contruimos la segunda torre (hacia abajo)
- turtle.forward()
- turtle.turnRight()
- turtle.turnRight()
- for k = 1, htorre - hviga - 1 do
- turtle.up()
- end
- for k = 1, htorre do
- if not colocarBloque('delante') then
- return
- end
- turtle.down()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement