This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Xhisor's profile picture

Nice little house [Updated]

Started by Xhisor, 28 July 2012 - 01:30 PM
Xhisor #1
Posted 28 July 2012 - 03:30 PM
Hello!
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.
SpoilerUpdated 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
Inside (with basement):
Spoiler
Inside (without basement):
Spoiler
Basement:
Spoiler
Code for V1.1
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
Code for v1.0:
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
Teraminer #2
Posted 28 July 2012 - 03:42 PM
WOW nice job dude.
PS use a spoiler cause you code is toooooooooo big (wich is natural :)/>/>)
Xhisor #3
Posted 28 July 2012 - 03:45 PM
WOW nice job dude.
PS use a spoiler cause you code is toooooooooo big (wich is natural :)/>/>)
Thank you!
Yeah, i tried to upload a LUA file but the site wouldn't let me… But i'm gonna put it in spoilers now :D/>/>
Klausar #4
Posted 28 July 2012 - 06:25 PM
Could you make a screenshot of the house?
Xhisor #5
Posted 04 August 2012 - 12:40 PM
Could you make a screenshot of the house?
Done!
Cruor #6
Posted 04 August 2012 - 04:57 PM
Just a tip, when you are doing something repetive(like going forward say 2 times and place down a block when you move) you can use a for loop for compacting the code and also making it easier to read.

IE:

for i=1,2 do
    turtle.forward()
    turtle.placeDown()
end
is the same as:


turtle.forward()
turtle.placeDown()
turtle.forward()
turtle.placeDown()
acters124 #7
Posted 04 August 2012 - 07:27 PM
Nice little house.;)/>/>
I might make it bigger. xD
Just a tip, when you are doing something repetive(like going forward say 2 times and place down a block when you move) you can use a for loop for compacting the code and also making it easier to read.

IE:

for i=1,2 do
	turtle.forward()
	turtle.placeDown()
end
is the same as:


turtle.forward()
turtle.placeDown()
turtle.forward()
turtle.placeDown()
I have been looking around for a piece of code that had a for loop because all the for loops didn't work for me. :P/>/>
Xhisor #8
Posted 04 August 2012 - 09:26 PM
Nice little house. :P/>/>
Touché!
acters124 #9
Posted 05 August 2012 - 01:15 AM
I actualy fell in love with the house but I like to be able to make it as big as I want. :P/>/>
maybe some for loops. xD
you have inspired me to make a house building program. than you. ;)/>/>
Xhisor #10
Posted 05 August 2012 - 11:04 AM
I actualy fell in love with the house but I like to be able to make it as big as I want. :P/>/>
maybe some for loops. xD
Well, in the next mayor update I might add some more user friendly customization!
you have inspired me to make a house building program. than you. :(/>/>
Im honored! ;)/>/>
acters124 #11
Posted 05 August 2012 - 12:44 PM
I actualy fell in love with the house but I like to be able to make it as big as I want. :P/>/>
maybe some for loops. xD
Well, in the next mayor update I might add some more user friendly customization!
you have inspired me to make a house building program. than you. :)/>/>
Im honored! :(/>/>
mine is much complicated and and simple at the same time. xD(the roof is the complicated part ;)/>/> (nah I decide against it xD make it simple so users can modify the size))
includes a bed a basement 2 large chests and on top of it all it'll be mah first program! :D/>/>
Xhisor #12
Posted 05 August 2012 - 01:00 PM
includes a bed a basement 2 large chests and on top of it all it'll be mah first program! :P/>/>
Huh, when I first did the code you couldn't place beds or doors with the turtle, I've got to check it out!
acters124 #13
Posted 05 August 2012 - 01:16 PM
includes a bed a basement 2 large chests and on top of it all it'll be mah first program! :P/>/>
Huh, when I first did the code you couldn't place beds or doors with the turtle, I've got to check it out!
oh yeah a door too!
thanks for reminding. xD
use turtle.place and the door will be facing the turtle.(same as beds I think)
Xhisor #14
Posted 05 August 2012 - 01:18 PM
oh yeah a door too!
thanks for reminding. xD
use turtle.place and the door will be facing the turtle.(same as beds I think)
Damn it! Since I use CC in tekkit I have to wait for the next patch (the current version in tekkit is 1.3)…
acters124 #15
Posted 05 August 2012 - 01:39 PM
oh yeah a door too!
thanks for reminding. xD
use turtle.place and the door will be facing the turtle.(same as beds I think)
Damn it! Since I use CC in tekkit I have to wait for the next patch (the current version in tekkit is 1.3)…
you sure you cant use turtle.Placeblock()? or similar?
Xhisor #16
Posted 05 August 2012 - 01:53 PM
you sure you cant use turtle.Placeblock()? or similar?
I tried to use both turtle.place() and turtle.placeDown() (when i was one block high) but it just returned false.
acters124 #17
Posted 05 August 2012 - 03:07 PM
you sure you cant use turtle.Placeblock()? or similar?
I tried to use both turtle.place() and turtle.placeDown() (when i was one block high) but it just returned false.
uhh
I never said it had to be 1 block high. @_@
look:

and me spamming with spawners:
Xhisor #18
Posted 05 August 2012 - 04:33 PM
I never said it had to be 1 block high. @_@
No, but when you use the turte.placeDown() you have to be (atleast) one block high! :P/>/>
But what version of CC are you using?
acters124 #19
Posted 05 August 2012 - 09:09 PM
I never said it had to be 1 block high. @_@
No, but when you use the turte.placeDown() you have to be (atleast) one block high! ;)/>/>
But what version of CC are you using?
1.4.1?
I click adfly link that had the biggest version number! xD

had to stop making the code because I ran into many bugs and it became midnight way to easily. xD

dang roof. xD
well I hit yet another bug. :P/>/>
easy fix though and then I will move on to the floor with the home stuff(eg chests, torches, door, pie(joke),bed )
Xhisor #20
Posted 05 August 2012 - 10:20 PM
Well , as I said I'm stuck on version 1.3 so I am not able to do that… Yet!
Xhisor #21
Posted 15 September 2012 - 09:37 PM
*bump*