Created
August 19, 2016 18:51
-
-
Save X-Raym/c63a4fd47117be6427e012e75763e81f to your computer and use it in GitHub Desktop.
ComputerCraft Edu Scripts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --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