Skip to content

Instantly share code, notes, and snippets.

@X-Raym
Created August 19, 2016 18:51
Show Gist options
  • Select an option

  • Save X-Raym/c63a4fd47117be6427e012e75763e81f to your computer and use it in GitHub Desktop.

Select an option

Save X-Raym/c63a4fd47117be6427e012e75763e81f to your computer and use it in GitHub Desktop.
ComputerCraft Edu Scripts
SURFACE
CODE
-- Trous X Y Z for ComputerCraft 1.74 / Minecraft 1.7.10
-- X-Raym, Friops, Hengry
-- 2015-08-25
-- A script to dig a parallepipedic hole x y z.
-- CUSTOMIZATION
longueur = 4
largeur = 6
hauteur = 5
-- DECLARATIONS ---------------------------------------
function DigInTheBox(x, y, z)
for c = 1, z do
for j = 1, x do
DigForward(y-1)
if j ~= x then
Turn(j-1)
end
end
-- AFTER SURFACE
turtle.turnRight()
for k = 1, x - 1 do
turtle.forward()
end
turtle.turnRight()
turtle.digDown()
turtle.down()
end
end
function Turn(paire)
if paire % 2 == 0 then
turtle.turnRight()
turtle.dig()
turtle.forward()
turtle.turnRight()
else
turtle.turnLeft()
turtle.dig()
turtle.forward()
turtle.turnLeft()
end
end
function DigForward(y)
for i = 1, y do
turtle.dig()
turtle.forward()
end
end
-- RUN -------------------------------------------------------
DigInTheBox(largeur, longueur, hauteur)
--CODE--
-- Trous X Y Z for ComputerCraft 1.74 / Minecraft 1.7.10
-- X-Raym, Friops, Hengry
-- 2015-08-25
-- A script to dig a parallepipedic hole x y z.
while turtle.detectUp == false do
turtle.up()
end
while turtle.detectUp() do
turtle.digUp()
turtle.up()
turtle.placeDown()
end
while turtle.detect() do
turtle.up()
turtle.placeDown()
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment