Posted 03 February 2014 - 09:15 AM
Hi guys,
I want to program a tool to build easy structures in minecraft since i wanna build a tower with repeating floors.
I started to set up some functions and and wanted to test them by just using one of them at the end of the program but it doesnt work.
I want the turtle to build with 2 materials f.e. stone and glass.
Stone is in slots 1-8 and glass in slots 9-12.
Slot 13, 15 and 16 each got a enderchest in it, filled with fuel, stone and glass.
Here is my program:
if i run the programm nothing happens. No error no placing of stone (i got slot 1 selected and its allready filled with stone).
I dont know why this is not working can you tell me my mistake?
My plans for improvements are to addd some return values to test if the functions worked and to edit the function place with a variable to use it multiple times in a row and seperately for stone and glass.
Also feel free to suggest improvements to my code or any helpfull tips.
I want to program a tool to build easy structures in minecraft since i wanna build a tower with repeating floors.
I started to set up some functions and and wanted to test them by just using one of them at the end of the program but it doesnt work.
I want the turtle to build with 2 materials f.e. stone and glass.
Stone is in slots 1-8 and glass in slots 9-12.
Slot 13, 15 and 16 each got a enderchest in it, filled with fuel, stone and glass.
Here is my program:
function refuel()
turtle.select(13)
turtle.placeUp()
turtle.suckUp()
turtle.refuel()
turtle.digUp()
end
function refill(x)
if x == 1 then
turtle.select(15)
turtle.placeUp()
for i = 1,8 do
turtle.select(i)
while turtle.getItemCount(i) == 0 do
turtle.suckUp()
end
end
turtle.select(15)
turtle.digUp()
else do
turtle.select(16)
turtle.placeUp()
for i = 9,12 do
turtle.select(i)
while turtle.getItemCount(i) == 0 do
turtle.suckUp()
end
end
turtle.select(16)
turtle.digUp()
end
end
function place()
turtle.placeDown()
turtle.forward()
end
place()
end
if i run the programm nothing happens. No error no placing of stone (i got slot 1 selected and its allready filled with stone).
I dont know why this is not working can you tell me my mistake?
My plans for improvements are to addd some return values to test if the functions worked and to edit the function place with a variable to use it multiple times in a row and seperately for stone and glass.
Also feel free to suggest improvements to my code or any helpfull tips.