Posted 18 May 2015 - 04:25 AM
Hello everyone. I just wrote a program that is supposed to harvest obsidian that I make in two 2x18 areas side by side separtated by a wall of dirt. It is now stuck in an infinate loop on the first row. It is supposed to go 18 blocks forward and then turn right. However it never turns right, it keeps going straight mining away. I have included the code below. Any help you guys could give me would be appreciated. Also any tips to make the code cleaner are always welcome.
Thank you,
Ferrwolf
–This program is designed for user to place lava in two 2x18 areas
–connected by one block removed in the center on the end where the user started digging.
–Pour water on lava and run turtle program. Instant obsidian. :)/>
– this is an example ==================
– ==================
– =
– ==================
– ==================
– each equal sign is where the blocks should be removed and lava placed.
for i=0,18 do
turtle.dig()
turtle.forward()
while turtle.forward() == false do
turtle.dig()
turtle.forward()
end
end
turtle.turnRight()
turtle.dig()
turtle.forward()
while turtle.forward() == false do
turtle.dig()
turtle.forward()
end
turtle.turnRight()
for i=0,17 do
turtle.dig()
turtle.forward()
while turtle.forward() == false do
turtle.dig()
turtle.forward()
end
end
turtle.turnLeft()
turtle.dig()
turtle.forward()
while turtle.forward() == false do
turtle.dig()
turtle.forward()
end
turtle.dig()
turtle.forward()
while turtle.forward() == false do
turtle.dig()
turtle.forward()
end
turtle.turnLeft()
for i=0,17 do
turtle.dig()
turtle.forward()
while turtle.forward() – false do
turtle.dig()
turtle.forward()
end
end
turtle.turnRight()
turtle.dig()
turtle.forward()
while turtle.forward() == false do
turtle.dig()
turtle.forward()
end
turtle.turnRight()
for i=0,17 do
turtle.dig()
turtle.forward()
while turtle.forward() == false do
turtle.dig()
turtle.forward()
end
end
Thank you,
Ferrwolf
Spoiler
–Author: Ferrwolf–This program is designed for user to place lava in two 2x18 areas
–connected by one block removed in the center on the end where the user started digging.
–Pour water on lava and run turtle program. Instant obsidian. :)/>
– this is an example ==================
– ==================
– =
– ==================
– ==================
– each equal sign is where the blocks should be removed and lava placed.
for i=0,18 do
turtle.dig()
turtle.forward()
while turtle.forward() == false do
turtle.dig()
turtle.forward()
end
end
turtle.turnRight()
turtle.dig()
turtle.forward()
while turtle.forward() == false do
turtle.dig()
turtle.forward()
end
turtle.turnRight()
for i=0,17 do
turtle.dig()
turtle.forward()
while turtle.forward() == false do
turtle.dig()
turtle.forward()
end
end
turtle.turnLeft()
turtle.dig()
turtle.forward()
while turtle.forward() == false do
turtle.dig()
turtle.forward()
end
turtle.dig()
turtle.forward()
while turtle.forward() == false do
turtle.dig()
turtle.forward()
end
turtle.turnLeft()
for i=0,17 do
turtle.dig()
turtle.forward()
while turtle.forward() – false do
turtle.dig()
turtle.forward()
end
end
turtle.turnRight()
turtle.dig()
turtle.forward()
while turtle.forward() == false do
turtle.dig()
turtle.forward()
end
turtle.turnRight()
for i=0,17 do
turtle.dig()
turtle.forward()
while turtle.forward() == false do
turtle.dig()
turtle.forward()
end
end
Edited on 18 May 2015 - 06:05 PM