Created
November 7, 2014 23:34
-
-
Save matdombrock/4d595f23a89c63a77278 to your computer and use it in GitHub Desktop.
Meant to be used with turtles in the ComputerCraft mod for MineCraft
This file contains 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
t = turtle | |
n = 1 --item slot | |
function reload() | |
while t.getItemCount(n) <1 do | |
print("reload item slot") | |
sleep(3) | |
end | |
end | |
function buildRow(L) | |
for i = 1,L do | |
t.digDown() | |
reload() | |
t.placeDown() | |
t.dig() | |
t.forward() | |
end | |
t.back() | |
t.turnLeft() | |
end | |
function buildRowDoor(L) | |
L = L -2 | |
L = L /2 | |
for i = 1,L do | |
t.digDown() | |
reload() | |
t.placeDown() | |
t.dig() | |
t.forward() | |
end | |
t.forward() | |
t.forward() | |
L = L -1 | |
for i =1, L do | |
t.digDown() | |
reload() | |
t.placeDown() | |
t.dig() | |
t.forward() | |
end | |
t.turnLeft() | |
end | |
function buildRowWindow(L) | |
t.digDown() | |
reload() | |
t.placeDown() | |
t.dig() | |
t.forward() | |
t.select(2) | |
n = 2 | |
L = L-2 --make sure we place windows only | |
for i = 1,L do | |
t.digDown() | |
reload() | |
t.placeDown() | |
t.dig() | |
t.forward() | |
end | |
t.select(1) | |
n = 1 | |
t.digDown() | |
reload() | |
t.placeDown() | |
t.dig() | |
t.turnLeft() | |
end | |
--example usage | |
t.up() | |
buildRowDoor(10) | |
buildRow(10) | |
buildRow(10) | |
buildRowWindow(10) | |
t.up() | |
buildRowDoor(10) | |
buildRow(10) | |
buildRow(10) | |
buildRowWindow(10) | |
t.up() | |
buildRowWindow(10) | |
buildRow(10) | |
buildRow(10) | |
buildRowWindow(10) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment