Posted 27 February 2012 - 07:03 PM
Hi, I have a turtle script I'm working on, pretty much begginers stuff. It invovles a turtle digging a nice little mineshaft down to bedrock. The turtle digs happily away but it won't stop when it reaches bedrock. Instead it keeps digging without descening, basically making a tunnel. Another issue I have is I am not that smart with events and I can't get it to stop when told which would help.
Code so far:
print("Creating your mineshaft, Press any key to stop")
while true do
turtle.digDown()
turtle.down()
turtle.turnRight()
turtle.dig()
turtle.forward()
turtle.turnLeft()
turtle.dig()
turtle.forward()
turtle.turnLeft()
turtle.dig()
turtle.forward()
turtle.turnRight()
turtle.dig()
turtle.forward()
turtle.turnRight()
turtle.dig()
turtle.turnLeft()
turtle.back()
sleep(0)
if event == "key" and param1 then
break
end
end
Any help is appreciated, thanks :D/>/>
Code so far:
Spoiler
–Create a mineshaftprint("Creating your mineshaft, Press any key to stop")
while true do
turtle.digDown()
turtle.down()
turtle.turnRight()
turtle.dig()
turtle.forward()
turtle.turnLeft()
turtle.dig()
turtle.forward()
turtle.turnLeft()
turtle.dig()
turtle.forward()
turtle.turnRight()
turtle.dig()
turtle.forward()
turtle.turnRight()
turtle.dig()
turtle.turnLeft()
turtle.back()
sleep(0)
if event == "key" and param1 then
break
end
end
Any help is appreciated, thanks :D/>/>