I've created my first automatic housebuilding turtle and i would like to share it with you. Please critisize me and tell me what i could have done different!
Thanks!
Version 1.2.1 now live at pastebin! - 828NMvf5 -
Changelog.
Spoiler
Updated to V1.2.1*Try run the program on a computer NOW if you can!
Updated to V1.2
*Even handsomer menu!!!!!1 (Person 1: How is that possible? Person 2: I DON'T KNOW!!!!! :)/>/>)
*Uploaded code to pastebin –> 828NMvf5 <–
*Shortened the code in some places
Updated to V1.1
Changes:
*Added a "initiated time"
*Made the program look handsomer
The house:
Spoiler
Spoiler
Spoiler
Spoiler
Spoiler
function kv()
turtle.forward()
turtle.digUp()
turtle.digDown()
turtle.dig()
turtle.forward()
turtle.digUp()
turtle.digDown()
turtle.dig()
turtle.forward()
turtle.digUp()
turtle.digDown()
turtle.dig()
end
function ksh()
turtle.forward()
turtle.digUp()
turtle.digDown()
turtle.turnRight()
turtle.dig()
end
function ksv()
turtle.forward()
turtle.digUp()
turtle.digDown()
turtle.turnLeft()
turtle.dig()
end
function kg()
turtle.forward()
turtle.digDown()
turtle.placeDown()
end
function tk()
turtle.forward()
turtle.placeDown()
turtle.forward()
turtle.placeDown()
turtle.forward()
turtle.placeDown()
turtle.forward()
turtle.placeDown()
end
function kallare()
turtle.forward() --start pos
turtle.turnLeft()
turtle.forward()
turtle.forward()
turtle.turnRight() --block 1
turtle.digDown()
turtle.down()
turtle.digDown()
turtle.down()
turtle.digDown()
turtle.dig()
kv() --block 2, 3, 4
ksh() --block 5
ksh() --block 6
kv() --block 7, 8, 9
ksv() --block 10
ksv() --block 11
kv() --block 12, 13, 14
ksh() --block 15
ksh() --block 16
kv() --block 17, 18, 19
ksv() --block 20
ksv() --block 21
kv() --block 22, 23, 24
turtle.forward() --block 25
turtle.digUp()
turtle.digDown()
turtle.turnLeft()
turtle.down()
turtle.forward()
turtle.turnLeft()
turtle.select(1)
kg() --block 1
kg() --block 2
kg() --block 3
turtle.turnRight()
turtle.forward() --block 4
turtle.turnRight()
turtle.digDown()
turtle.placeDown()
kg() --block 5
kg() --block 6
turtle.turnLeft()
turtle.forward() --block 7
turtle.turnLeft()
turtle.digDown()
turtle.placeDown()
kg() --block 8
kg() --block 9
turtle.forward()
turtle.turnRight()
turtle.forward() --block 1
turtle.turnRight()
turtle.up()
turtle.select(9)
turtle.placeDown()
turtle.forward() --block 2
turtle.select(1)
turtle.placeDown()
turtle.forward() --block 3
turtle.placeDown()
turtle.forward() --block 4
turtle.placeDown()
turtle.forward() --block 5
turtle.turnRight()
turtle.select(9)
turtle.placeDown()
turtle.forward() --block 6
turtle.select(1)
turtle.placeDown()
turtle.forward() --block 7
turtle.placeDown()
turtle.forward() --block 8
turtle.placeDown()
turtle.forward() --block 9
turtle.turnRight()
turtle.select(9)
turtle.placeDown()
turtle.forward() --block 10
turtle.select(1)
turtle.placeDown()
turtle.forward() --block 11
turtle.placeDown()
turtle.forward() --block 12
turtle.placeDown()
turtle.forward() --block 13
turtle.turnRight()
turtle.select(9)
turtle.placeDown()
turtle.forward() --block 14
turtle.select(1)
turtle.placeDown()
turtle.forward() --block 15
turtle.placeDown()
turtle.forward() --block 16
turtle.placeDown()
turtle.forward() --block 17
turtle.turnRight()
turtle.select(9)
turtle.up()
turtle.placeDown()
turtle.forward() --block 18
turtle.select(1)
turtle.placeDown()
turtle.forward() --block 19
turtle.placeDown()
turtle.forward() --block 20
turtle.placeDown()
turtle.forward() --block 21
turtle.turnRight()
turtle.select(9)
turtle.placeDown()
turtle.forward() --block 22
turtle.select(1)
turtle.placeDown()
turtle.forward() --block 23
turtle.placeDown()
turtle.forward() --block 24
turtle.placeDown()
turtle.forward() --block 25
turtle.turnRight()
turtle.select(9)
turtle.placeDown()
turtle.forward() --block 26
turtle.select(1)
turtle.placeDown()
turtle.forward() --block 27
turtle.placeDown()
turtle.forward() --block 28
turtle.placeDown()
turtle.forward() --block 29
turtle.turnRight()
turtle.select(9)
turtle.placeDown()
turtle.forward() --block 30
turtle.select(1)
turtle.placeDown()
turtle.forward() --block 31
turtle.placeDown()
turtle.forward() --block 32
turtle.placeDown()
turtle.forward() --block 33
turtle.turnRight()
turtle.select(9)
turtle.up()
turtle.placeDown()
turtle.forward() --block 34
turtle.select(1)
turtle.placeDown()
turtle.forward() --block 35
turtle.placeDown()
turtle.forward() --block 36
turtle.placeDown()
turtle.forward() --block 37
turtle.turnRight()
turtle.select(9)
turtle.placeDown()
turtle.forward() --block 38
turtle.select(1)
turtle.placeDown()
turtle.forward() --block 39
turtle.placeDown()
turtle.forward() --block 40
turtle.placeDown()
turtle.forward() --block 41
turtle.turnRight()
turtle.select(9)
turtle.placeDown()
turtle.forward() --block 42
turtle.select(1)
turtle.placeDown()
turtle.forward() --block 43
turtle.placeDown()
turtle.forward() --block 44
turtle.placeDown()
turtle.forward() --block 45
turtle.turnRight()
turtle.select(9)
turtle.placeDown()
turtle.forward() --block 46
turtle.select(1)
turtle.placeDown()
turtle.forward() --block 47
turtle.placeDown()
turtle.forward() --block 48
turtle.select(2)
turtle.placeDown()
turtle.turnRight()
turtle.forward()
turtle.down()
turtle.down()
turtle.down()
turtle.forward()
turtle.turnRight()
turtle.forward()
turtle.turnLeft()
turtle.turnLeft()
turtle.select(5)
turtle.place()
turtle.turnRight()
turtle.turnRight()
turtle.select(8)
turtle.place()
turtle.up()
turtle.place()
turtle.turnLeft()
turtle.turnLeft()
turtle.select(4)
turtle.place()
turtle.turnRight()
turtle.turnRight()
turtle.up()
turtle.select(8)
turtle.place()
turtle.up()
turtle.turnRight()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.turnLeft()
turtle.turnLeft()
end
function golv1()
turtle.forward()
turtle.forward()
turtle.turnLeft()
turtle.forward() --block 1
turtle.turnRight()
turtle.select(2)
turtle.placeDown()
turtle.forward() --block 2
turtle.placeDown()
turtle.forward() --block 3
turtle.placeDown()
turtle.turnRight()
turtle.forward() --block 4
turtle.turnRight()
turtle.placeDown()
turtle.forward() --block 5
turtle.placeDown()
turtle.forward() --block 6
turtle.placeDown()
turtle.turnLeft()
turtle.forward() --block 7
turtle.turnLeft()
turtle.placeDown()
turtle.forward() --block 8
turtle.forward() --block 9
turtle.placeDown()
turtle.turnLeft()
turtle.forward()
turtle.turnLeft()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.turnRight()
turtle.turnRight()
end
function golv2()
turtle.forward()
turtle.turnLeft()
turtle.select(2)
kg() --block 1
turtle.turnRight()
kg() --block 2
kg() --block 3
kg() --block 4
turtle.turnRight()
kg() --block 5
turtle.turnRight()
kg() --block 6
kg() --block 7
turtle.turnLeft()
kg() --block 8
turtle.turnLeft()
kg() --block 9
kg() --block 10
turtle.turnLeft()
turtle.forward()
turtle.turnLeft()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.turnRight()
turtle.turnRight()
end
function veggar()
turtle.forward()
turtle.turnLeft()
turtle.forward()
turtle.forward() --block 1
turtle.turnRight()
turtle.up()
turtle.select(1)
turtle.placeDown()
turtle.forward() --block 2
turtle.select(7)
turtle.placeDown()
turtle.forward() --block 3
turtle.placeDown()
turtle.forward() --block 4
turtle.placeDown()
turtle.forward() --block 5
turtle.select(1)
turtle.placeDown()
turtle.turnRight()
turtle.forward() --block 6
turtle.select(7)
turtle.placeDown()
turtle.forward() --block 7
turtle.placeDown()
turtle.forward() --block 8
turtle.placeDown()
turtle.forward() --block 9
turtle.select(1)
turtle.placeDown()
turtle.turnRight()
turtle.forward() --block 10
turtle.select(7)
turtle.placeDown()
turtle.forward() --block 11
turtle.placeDown()
turtle.forward() --block 12
turtle.placeDown()
turtle.forward() --block 13
turtle.select(1)
turtle.placeDown()
turtle.turnRight()
turtle.forward() --block 14
turtle.select(7)
turtle.placeDown()
turtle.forward() --block 15
turtle.placeDown()
turtle.forward() --block 16
turtle.forward() --block 1
turtle.turnRight()
turtle.up()
turtle.select(1)
turtle.placeDown()
turtle.forward() --block 2
turtle.select(7)
turtle.placeDown()
turtle.forward() --block 3
turtle.select(3)
turtle.placeDown()
turtle.forward() --block 4
turtle.select(7)
turtle.placeDown()
turtle.forward() --block 5
turtle.select(1)
turtle.placeDown()
turtle.turnRight()
turtle.forward() --block 6
turtle.select(7)
turtle.placeDown()
turtle.forward() --block 7
turtle.select(3)
turtle.placeDown()
turtle.forward() --block 8
turtle.select(7)
turtle.placeDown()
turtle.forward() --block 9
turtle.select(1)
turtle.placeDown()
turtle.turnRight()
turtle.forward() --block 10
turtle.select(7)
turtle.placeDown()
turtle.forward() --block 11
turtle.select(3)
turtle.placeDown()
turtle.forward() --block 12
turtle.select(7)
turtle.placeDown()
turtle.forward() --block 13
turtle.select(1)
turtle.placeDown()
turtle.turnRight()
turtle.forward() --block 14
turtle.select(7)
turtle.placeDown()
turtle.forward() --block 15
turtle.select(3)
turtle.placeDown()
turtle.forward() --block 16
turtle.forward() --block 1
turtle.turnRight()
turtle.up()
turtle.select(1)
turtle.placeDown()
turtle.forward() --block 2
turtle.select(7)
turtle.placeDown()
turtle.forward() --block 3
turtle.placeDown()
turtle.forward() --block 4
turtle.placeDown()
turtle.forward() --block 5
turtle.select(1)
turtle.placeDown()
turtle.turnRight()
turtle.forward() --block 6
turtle.select(7)
turtle.placeDown()
turtle.forward() --block 7
turtle.placeDown()
turtle.forward() --block 8
turtle.placeDown()
turtle.forward() --block 9
turtle.select(1)
turtle.placeDown()
turtle.turnRight()
turtle.forward() --block 10
turtle.select(7)
turtle.placeDown()
turtle.forward() --block 11
turtle.placeDown()
turtle.forward() --block 12
turtle.placeDown()
turtle.forward() --block 13
turtle.select(1)
turtle.placeDown()
turtle.turnRight()
turtle.forward() --block 14
turtle.select(7)
turtle.placeDown()
turtle.forward() --block 15
turtle.placeDown()
turtle.forward() --block 16
turtle.placeDown()
turtle.back()
turtle.turnRight()
turtle.back()
turtle.down()
turtle.down()
turtle.down()
end
function tak()
turtle.up()
turtle.up()
turtle.up()
turtle.forward()
turtle.turnLeft()
turtle.forward()
turtle.forward()
turtle.turnRight()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.forward() --brick 1
turtle.turnRight()
turtle.up()
turtle.turnRight()
turtle.select(6)
turtle.placeDown()
tk() --brick 2, 3, 4, 5
turtle.turnLeft()
turtle.forward() --brick 6
turtle.select(2)
turtle.placeDown()
turtle.turnLeft()
tk() --brick 7, 8, 9, 10
turtle.turnRight()
turtle.forward() --brick 11
turtle.placeDown()
turtle.turnRight()
tk() --brick 12, 13, 14, 15
turtle.turnLeft()
turtle.forward() --brick 16
turtle.placeDown()
turtle.turnLeft()
tk() --brick 17, 18, 19, 20
turtle.turnRight()
turtle.forward() --brick 21
turtle.select(6)
turtle.placeDown()
turtle.turnRight()
tk() --brick 22, 23, 24, 25
turtle.turnRight()
turtle.forward()
turtle.forward()
turtle.turnRight()
turtle.back()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
end
function inter()
turtle.turnLeft()
turtle.forward()
turtle.turnRight()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.turnRight()
turtle.forward()
turtle.select(5)
turtle.place()
turtle.turnRight()
turtle.forward()
turtle.up()
turtle.up()
turtle.up()
turtle.select(4)
turtle.turnLeft()
turtle.place()
turtle.turnLeft()
turtle.place()
turtle.turnLeft()
turtle.place()
turtle.turnLeft()
turtle.place()
turtle.down()
turtle.down()
turtle.down()
turtle.forward()
turtle.turnRight()
turtle.back()
end
local time = os.time()
time = textutils.formatTime(time, false)
os.pullEvent = os.pullEventRaw
term.clear()
term.setCursorPos(4,1)
print("AUTOMATIC HOUSE PROCESS (AHP)")
term.setCursorPos(8,2)
print("VICTOR ANDERSON 2012")
term.setCursorPos(1,11)
print("v1.1")
sleep(3)
term.setCursorPos(2,4)
print("YOU CAN EITHER BUILD A HOUSE WITH")
term.setCursorPos(4,5)
print("OR A HOUSE WITHOUT A BASEMENT")
term.setCursorPos(13,7)
print("WITH (1)")
term.setCursorPos(13,8)
print("WITHOUT (2)")
local event, inp = os.pullEvent("char")
if inp == "1" then
term.clear()
term.setCursorPos(1,1)
print("BEFORE START MAKE SURE YOU HAVE")
print("56 COBBLESTONE YOU HAVE "..turtle.getItemCount(1))
print("40 WOODEN PLANKS YOU HAVE "..turtle.getItemCount(2))
print("4 GLASS YOU HAVE "..turtle.getItemCount(3))
print("5 TORCHES YOU HAVE "..turtle.getItemCount(4))
print("2 CHESTS YOU HAVE "..turtle.getItemCount(5))
print("10 WOODEN SLABS YOU HAVE "..turtle.getItemCount(6))
print("30 BRICKS YOU HAVE "..turtle.getItemCount(7))
print("3 LADDERS YOU HAVE "..turtle.getItemCount(8))
term.setCursorPos(1,11)
print("PRESS ANY KEY TO CONTINUE")
local event, key = os.pullEvent("key")
if key ~= 1 then
term.clear()
term.setCursorPos(1,1)
print("HOUSE WITH BASEMENT INITIATED")
print("TIME INITIATED: "..time)
print("TIME FINISHED: ")
term.setCursorPos(1,5)
print("BASEMENT STATUS: QUEUED")
print("FLOOR STATUS: QUEUED")
print("WALLS STATUS: QUEUED")
print("ROOF STATUS: QUEUED")
print("INTERIOUR STATUS: QUEUED")
term.setCursorPos(19,5)
print("BUILDING")
kallare()
term.setCursorPos(19,5)
print("FINISHED")
sleep(1)
term.setCursorPos(19,6)
print("BUILDING")
golv1()
term.setCursorPos(19,6)
print("FINISHED")
sleep(1)
term.setCursorPos(19,7)
print("BUILDING")
veggar()
term.setCursorPos(19,7)
print("FINISHED")
sleep(1)
term.setCursorPos(19,8)
print("BUILDING")
tak()
term.setCursorPos(19,8)
print("FINISHED")
sleep(1)
term.setCursorPos(19,9)
print("BUILDING")
inter()
term.setCursorPos(19,9)
print("FINISHED")
term.setCursorPos(17,3)
local time = os.time()
time = textutils.formatTime(time, false)
print(time)
turtle.select(1)
sleep(5)
term.clear()
term.setCursorPos(1,1)
print("ENJOY YOUR NEW HOUSE!")
sleep(10)
os.reboot()
end
elseif inp == "2" then
term.clear()
term.setCursorPos(1,1)
print("BEFORE START MAKE SURE YOU HAVE")
print("12 COBBLESTONE YOU HAVE "..turtle.getItemCount(1))
print("25 WOODEN PLANKS YOU HAVE "..turtle.getItemCount(2))
print("4 GLASS YOU HAVE "..turtle.getItemCount(3))
print("4 TORCHES YOU HAVE "..turtle.getItemCount(4))
print("1 CHEST YOU HAVE "..turtle.getItemCount(5))
print("10 WOODEN SLABS YOU HAVE "..turtle.getItemCount(6))
print("30 BRICKS YOU HAVE "..turtle.getItemCount(7))
term.setCursorPos(1,11)
print("PRESS ANY KEY TO CONTINUE")
local event, key = os.pullEvent("key")
if key ~= 1 then
term.clear()
term.setCursorPos(1,1)
print("HOUSE WITHOUT BASEMENT INITIATED")
print("TIME INITIATED: "..time)
print("TIME FINISHED: ")
term.setCursorPos(1,5)
print("FLOOR STATUS: QUEUED")
print("WALLS STATUS: QUEUED")
print("ROOF STATUS: QUEUED")
print("INTERIOUR STATUS: QUEUED")
term.setCursorPos(19,5)
print("BUILDING")
golv2()
term.setCursorPos(19,5)
print("FINISHED")
sleep(1)
term.setCursorPos(19,6)
print("BUILDING")
veggar()
term.setCursorPos(19,6)
print("FINISHED")
sleep(1)
term.setCursorPos(19,7)
print("BUILDING")
tak()
term.setCursorPos(19,7)
print("FINISHED")
sleep(1)
term.setCursorPos(19,8)
print("BUILDING")
inter()
term.setCursorPos(19,8)
print("FINISHED")
term.setCursorPos(17,3)
local time = os.time()
time = textutils.formatTime(time, false)
print(time)
turtle.select(1)
sleep(5)
term.clear()
term.setCursorPos(1,1)
print("ENJOY YOUR NEW HOUSE!")
sleep(10)
os.reboot()
end
else
term.clear()
term.setCursorPos(1,1)
print("INCORRECT INPUT, SHUTTING DOWN")
sleep(3)
os.reboot()
end
--Victor Anderson 2012-08-05
Spoiler
function kv()
turtle.forward()
turtle.digUp()
turtle.digDown()
turtle.dig()
turtle.forward()
turtle.digUp()
turtle.digDown()
turtle.dig()
turtle.forward()
turtle.digUp()
turtle.digDown()
turtle.dig()
end
function ksh()
turtle.forward()
turtle.digUp()
turtle.digDown()
turtle.turnRight()
turtle.dig()
end
function ksv()
turtle.forward()
turtle.digUp()
turtle.digDown()
turtle.turnLeft()
turtle.dig()
end
function kg()
turtle.forward()
turtle.digDown()
turtle.placeDown()
end
function tk()
turtle.forward()
turtle.placeDown()
turtle.forward()
turtle.placeDown()
turtle.forward()
turtle.placeDown()
turtle.forward()
turtle.placeDown()
end
function kallare()
turtle.forward() --start pos
turtle.turnLeft()
turtle.forward()
turtle.forward()
turtle.turnRight() --block 1
turtle.digDown()
turtle.down()
turtle.digDown()
turtle.down()
turtle.digDown()
turtle.dig()
kv() --block 2, 3, 4
ksh() --block 5
ksh() --block 6
kv() --block 7, 8, 9
ksv() --block 10
ksv() --block 11
kv() --block 12, 13, 14
ksh() --block 15
ksh() --block 16
kv() --block 17, 18, 19
ksv() --block 20
ksv() --block 21
kv() --block 22, 23, 24
turtle.forward() --block 25
turtle.digUp()
turtle.digDown()
turtle.turnLeft()
turtle.down()
turtle.forward()
turtle.turnLeft()
turtle.select(1)
kg() --block 1
kg() --block 2
kg() --block 3
turtle.turnRight()
turtle.forward() --block 4
turtle.turnRight()
turtle.digDown()
turtle.placeDown()
kg() --block 5
kg() --block 6
turtle.turnLeft()
turtle.forward() --block 7
turtle.turnLeft()
turtle.digDown()
turtle.placeDown()
kg() --block 8
kg() --block 9
turtle.forward()
turtle.turnRight()
turtle.forward() --block 1
turtle.turnRight()
turtle.up()
turtle.select(9)
turtle.placeDown()
turtle.forward() --block 2
turtle.select(1)
turtle.placeDown()
turtle.forward() --block 3
turtle.placeDown()
turtle.forward() --block 4
turtle.placeDown()
turtle.forward() --block 5
turtle.turnRight()
turtle.select(9)
turtle.placeDown()
turtle.forward() --block 6
turtle.select(1)
turtle.placeDown()
turtle.forward() --block 7
turtle.placeDown()
turtle.forward() --block 8
turtle.placeDown()
turtle.forward() --block 9
turtle.turnRight()
turtle.select(9)
turtle.placeDown()
turtle.forward() --block 10
turtle.select(1)
turtle.placeDown()
turtle.forward() --block 11
turtle.placeDown()
turtle.forward() --block 12
turtle.placeDown()
turtle.forward() --block 13
turtle.turnRight()
turtle.select(9)
turtle.placeDown()
turtle.forward() --block 14
turtle.select(1)
turtle.placeDown()
turtle.forward() --block 15
turtle.placeDown()
turtle.forward() --block 16
turtle.placeDown()
turtle.forward() --block 17
turtle.turnRight()
turtle.select(9)
turtle.up()
turtle.placeDown()
turtle.forward() --block 18
turtle.select(1)
turtle.placeDown()
turtle.forward() --block 19
turtle.placeDown()
turtle.forward() --block 20
turtle.placeDown()
turtle.forward() --block 21
turtle.turnRight()
turtle.select(9)
turtle.placeDown()
turtle.forward() --block 22
turtle.select(1)
turtle.placeDown()
turtle.forward() --block 23
turtle.placeDown()
turtle.forward() --block 24
turtle.placeDown()
turtle.forward() --block 25
turtle.turnRight()
turtle.select(9)
turtle.placeDown()
turtle.forward() --block 26
turtle.select(1)
turtle.placeDown()
turtle.forward() --block 27
turtle.placeDown()
turtle.forward() --block 28
turtle.placeDown()
turtle.forward() --block 29
turtle.turnRight()
turtle.select(9)
turtle.placeDown()
turtle.forward() --block 30
turtle.select(1)
turtle.placeDown()
turtle.forward() --block 31
turtle.placeDown()
turtle.forward() --block 32
turtle.placeDown()
turtle.forward() --block 33
turtle.turnRight()
turtle.select(9)
turtle.up()
turtle.placeDown()
turtle.forward() --block 34
turtle.select(1)
turtle.placeDown()
turtle.forward() --block 35
turtle.placeDown()
turtle.forward() --block 36
turtle.placeDown()
turtle.forward() --block 37
turtle.turnRight()
turtle.select(9)
turtle.placeDown()
turtle.forward() --block 38
turtle.select(1)
turtle.placeDown()
turtle.forward() --block 39
turtle.placeDown()
turtle.forward() --block 40
turtle.placeDown()
turtle.forward() --block 41
turtle.turnRight()
turtle.select(9)
turtle.placeDown()
turtle.forward() --block 42
turtle.select(1)
turtle.placeDown()
turtle.forward() --block 43
turtle.placeDown()
turtle.forward() --block 44
turtle.placeDown()
turtle.forward() --block 45
turtle.turnRight()
turtle.select(9)
turtle.placeDown()
turtle.forward() --block 46
turtle.select(1)
turtle.placeDown()
turtle.forward() --block 47
turtle.placeDown()
turtle.forward() --block 48
turtle.select(2)
turtle.placeDown()
turtle.turnRight()
turtle.forward()
turtle.down()
turtle.down()
turtle.down()
turtle.forward()
turtle.turnRight()
turtle.forward()
turtle.turnLeft()
turtle.turnLeft()
turtle.select(5)
turtle.place()
turtle.turnRight()
turtle.turnRight()
turtle.select(8)
turtle.place()
turtle.up()
turtle.place()
turtle.turnLeft()
turtle.turnLeft()
turtle.select(4)
turtle.place()
turtle.turnRight()
turtle.turnRight()
turtle.up()
turtle.select(8)
turtle.place()
turtle.up()
turtle.turnRight()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.turnLeft()
turtle.turnLeft()
end
function golv1()
turtle.forward()
turtle.forward()
turtle.turnLeft()
turtle.forward() --block 1
turtle.turnRight()
turtle.select(2)
turtle.placeDown()
turtle.forward() --block 2
turtle.placeDown()
turtle.forward() --block 3
turtle.placeDown()
turtle.turnRight()
turtle.forward() --block 4
turtle.turnRight()
turtle.placeDown()
turtle.forward() --block 5
turtle.placeDown()
turtle.forward() --block 6
turtle.placeDown()
turtle.turnLeft()
turtle.forward() --block 7
turtle.turnLeft()
turtle.placeDown()
turtle.forward() --block 8
turtle.forward() --block 9
turtle.placeDown()
turtle.turnLeft()
turtle.forward()
turtle.turnLeft()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.turnRight()
turtle.turnRight()
end
function golv2()
turtle.forward()
turtle.turnLeft()
turtle.select(2)
kg() --block 1
turtle.turnRight()
kg() --block 2
kg() --block 3
kg() --block 4
turtle.turnRight()
kg() --block 5
turtle.turnRight()
kg() --block 6
kg() --block 7
turtle.turnLeft()
kg() --block 8
turtle.turnLeft()
kg() --block 9
kg() --block 10
turtle.turnLeft()
turtle.forward()
turtle.turnLeft()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.turnRight()
turtle.turnRight()
end
function veggar()
turtle.forward()
turtle.turnLeft()
turtle.forward()
turtle.forward() --block 1
turtle.turnRight()
turtle.up()
turtle.select(1)
turtle.placeDown()
turtle.forward() --block 2
turtle.select(7)
turtle.placeDown()
turtle.forward() --block 3
turtle.placeDown()
turtle.forward() --block 4
turtle.placeDown()
turtle.forward() --block 5
turtle.select(1)
turtle.placeDown()
turtle.turnRight()
turtle.forward() --block 6
turtle.select(7)
turtle.placeDown()
turtle.forward() --block 7
turtle.placeDown()
turtle.forward() --block 8
turtle.placeDown()
turtle.forward() --block 9
turtle.select(1)
turtle.placeDown()
turtle.turnRight()
turtle.forward() --block 10
turtle.select(7)
turtle.placeDown()
turtle.forward() --block 11
turtle.placeDown()
turtle.forward() --block 12
turtle.placeDown()
turtle.forward() --block 13
turtle.select(1)
turtle.placeDown()
turtle.turnRight()
turtle.forward() --block 14
turtle.select(7)
turtle.placeDown()
turtle.forward() --block 15
turtle.placeDown()
turtle.forward() --block 16
turtle.forward() --block 1
turtle.turnRight()
turtle.up()
turtle.select(1)
turtle.placeDown()
turtle.forward() --block 2
turtle.select(7)
turtle.placeDown()
turtle.forward() --block 3
turtle.select(3)
turtle.placeDown()
turtle.forward() --block 4
turtle.select(7)
turtle.placeDown()
turtle.forward() --block 5
turtle.select(1)
turtle.placeDown()
turtle.turnRight()
turtle.forward() --block 6
turtle.select(7)
turtle.placeDown()
turtle.forward() --block 7
turtle.select(3)
turtle.placeDown()
turtle.forward() --block 8
turtle.select(7)
turtle.placeDown()
turtle.forward() --block 9
turtle.select(1)
turtle.placeDown()
turtle.turnRight()
turtle.forward() --block 10
turtle.select(7)
turtle.placeDown()
turtle.forward() --block 11
turtle.select(3)
turtle.placeDown()
turtle.forward() --block 12
turtle.select(7)
turtle.placeDown()
turtle.forward() --block 13
turtle.select(1)
turtle.placeDown()
turtle.turnRight()
turtle.forward() --block 14
turtle.select(7)
turtle.placeDown()
turtle.forward() --block 15
turtle.select(3)
turtle.placeDown()
turtle.forward() --block 16
turtle.forward() --block 1
turtle.turnRight()
turtle.up()
turtle.select(1)
turtle.placeDown()
turtle.forward() --block 2
turtle.select(7)
turtle.placeDown()
turtle.forward() --block 3
turtle.placeDown()
turtle.forward() --block 4
turtle.placeDown()
turtle.forward() --block 5
turtle.select(1)
turtle.placeDown()
turtle.turnRight()
turtle.forward() --block 6
turtle.select(7)
turtle.placeDown()
turtle.forward() --block 7
turtle.placeDown()
turtle.forward() --block 8
turtle.placeDown()
turtle.forward() --block 9
turtle.select(1)
turtle.placeDown()
turtle.turnRight()
turtle.forward() --block 10
turtle.select(7)
turtle.placeDown()
turtle.forward() --block 11
turtle.placeDown()
turtle.forward() --block 12
turtle.placeDown()
turtle.forward() --block 13
turtle.select(1)
turtle.placeDown()
turtle.turnRight()
turtle.forward() --block 14
turtle.select(7)
turtle.placeDown()
turtle.forward() --block 15
turtle.placeDown()
turtle.forward() --block 16
turtle.placeDown()
turtle.back()
turtle.turnRight()
turtle.back()
turtle.down()
turtle.down()
turtle.down()
end
function tak()
turtle.up()
turtle.up()
turtle.up()
turtle.forward()
turtle.turnLeft()
turtle.forward()
turtle.forward()
turtle.turnRight()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.forward() --brick 1
turtle.turnRight()
turtle.up()
turtle.turnRight()
turtle.select(6)
turtle.placeDown()
tk() --brick 2, 3, 4, 5
turtle.turnLeft()
turtle.forward() --brick 6
turtle.select(2)
turtle.placeDown()
turtle.turnLeft()
tk() --brick 7, 8, 9, 10
turtle.turnRight()
turtle.forward() --brick 11
turtle.placeDown()
turtle.turnRight()
tk() --brick 12, 13, 14, 15
turtle.turnLeft()
turtle.forward() --brick 16
turtle.placeDown()
turtle.turnLeft()
tk() --brick 17, 18, 19, 20
turtle.turnRight()
turtle.forward() --brick 21
turtle.select(6)
turtle.placeDown()
turtle.turnRight()
tk() --brick 22, 23, 24, 25
turtle.turnRight()
turtle.forward()
turtle.forward()
turtle.turnRight()
turtle.back()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
end
function inter()
turtle.turnLeft()
turtle.forward()
turtle.turnRight()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.turnRight()
turtle.forward()
turtle.select(5)
turtle.place()
turtle.turnRight()
turtle.forward()
turtle.up()
turtle.up()
turtle.up()
turtle.select(4)
turtle.turnLeft()
turtle.place()
turtle.turnLeft()
turtle.place()
turtle.turnLeft()
turtle.place()
turtle.turnLeft()
turtle.place()
turtle.down()
turtle.down()
turtle.down()
turtle.forward()
turtle.turnRight()
turtle.back()
end
os.pullEvent = os.pullEventRaw
term.clear()
term.setCursorPos(1,1)
print("AUTOMATIC HOUSE PROCESS (AHP)")
term.setCursorPos(5,2)
print("VICTOR ANDERSON 2012")
term.setCursorPos(1,12)
print("v1.0")
sleep(3)
term.setCursorPos(1,4)
print("YOU CAN BUILD A HOUSE WITH OR WITHOUT A BASEMENT")
term.setCursorPos(1,7)
print("WITH BASEMENT PRESS (1)")
print("WITHOUT BASEMENT PRESS (2)")
t = io.read()
if t == "1" then
term.clear()
term.setCursorPos(1,1)
print("BEFORE START MAKE SURE YOU HAVE")
print("56 COBBLESTONE YOU HAVE "..turtle.getItemCount(1))
print("40 WOODEN PLANKS YOU HAVE "..turtle.getItemCount(2))
print("4 GLASS YOU HAVE "..turtle.getItemCount(3))
print("5 TORCHES YOU HAVE "..turtle.getItemCount(4))
print("2 CHESTS YOU HAVE "..turtle.getItemCount(5))
print("10 WOODEN SLABS YOU HAVE "..turtle.getItemCount(6))
print("30 BRICKS YOU HAVE "..turtle.getItemCount(7))
print("3 LADDERS YOU HAVE "..turtle.getItemCount(8))
term.setCursorPos(1,11)
print("PRESS ANY KEY TO CONTINUE")
local event, key = os.pullEvent("key")
if key ~= 1 then
term.clear()
term.setCursorPos(1,1)
print("HOUSE WITH BASEMENT INITIATED")
term.setCursorPos(1,3)
print("BASEMENT STATUS: QUEUED")
print("FLOOR STATUS: QUEUED")
print("WALLS STATUS: QUEUED")
print("ROOF STATUS: QUEUED")
print("INTERIOUR STATUS: QUEUED")
term.setCursorPos(19,3)
print("BUILDING")
kallare()
term.setCursorPos(19,3)
print("FINISHED")
sleep(1)
term.setCursorPos(19,4)
print("BUILDING")
golv1()
term.setCursorPos(19,4)
print("FINISHED")
sleep(1)
term.setCursorPos(19,5)
print("BUILDING")
veggar()
term.setCursorPos(19,5)
print("FINISHED")
sleep(1)
term.setCursorPos(19,6)
print("BUILDING")
tak()
term.setCursorPos(19,6)
print("FINISHED")
sleep(1)
term.setCursorPos(19,7)
print("BUILDING")
inter()
term.setCursorPos(19,7)
print("FINISHED")
sleep(1)
term.clear()
term.setCursorPos(1,1)
print("ENJOY YOUR NEW HOUSE!")
sleep(10)
os.reboot()
end
elseif t == "2" then
term.clear()
term.setCursorPos(1,1)
print("BEFORE START MAKE SURE YOU HAVE")
print("12 COBBLESTONE YOU HAVE "..turtle.getItemCount(1))
print("25 WOODEN PLANKS YOU HAVE "..turtle.getItemCount(2))
print("4 GLASS YOU HAVE "..turtle.getItemCount(3))
print("4 TORCHES YOU HAVE "..turtle.getItemCount(4))
print("1 CHEST YOU HAVE "..turtle.getItemCount(5))
print("10 WOODEN SLABS YOU HAVE "..turtle.getItemCount(6))
print("30 BRICKS YOU HAVE "..turtle.getItemCount(7))
term.setCursorPos(1,11)
print("PRESS ANY KEY TO CONTINUE")
local event, key = os.pullEvent("key")
if key ~= 1 then
term.clear()
term.setCursorPos(1,1)
print("HOUSE WITHOUT BASEMENT INITIATED")
term.setCursorPos(1,3)
print("FLOOR STATUS: QUEUED")
print("WALLS STATUS: QUEUED")
print("ROOF STATUS: QUEUED")
print("INTERIOUR STATUS: QUEUED")
term.setCursorPos(19,3)
print("BUILDING")
golv2()
term.setCursorPos(19,3)
print("FINISHED")
sleep(1)
term.setCursorPos(19,4)
print("BUILDING")
veggar()
term.setCursorPos(19,4)
print("FINISHED")
sleep(1)
term.setCursorPos(19,5)
print("BUILDING")
tak()
term.setCursorPos(19,5)
print("FINISHED")
sleep(1)
term.setCursorPos(19,6)
print("BUILDING")
inter()
term.setCursorPos(19,6)
print("FINISHED")
term.clear()
term.setCursorPos(1,1)
print("ENJOY YOUR NEW HOUSE!")
sleep(10)
os.reboot()
end
else
term.clear()
term.setCursorPos(1,1)
print("INCORRECT INPUT, SHUTTING DOWN")
sleep(3)
os.reboot()
end
--Victor Anderson 2012-07-21