3 posts
Posted 24 October 2012 - 08:36 PM
Hello,
first i'm German and i can't speak so good english, also sorry for mistake.
I need help with my MineStripCode. My Miningturtle don't work:
for i=1,100 do
for i=1,3 do
while turtle.detect()==true do
os.sleep(0.5)
end
turtle.forward()
while turtle.detectUP()==true do
turtle.digUp()
os.sleep(0.5)
end
end
turtle.turnRight()
for i=1,5 do
while turtle.detect()==true do
turtle.dig()
os.sleep(0.5)
end
turtle.forward()
while turtle.detectUp()==true do
os.sleep(0.5)
end
end
turtle.turnRight()
turtle.turnRight()
for i=1,5 do
turtle.forward()
end
for i=1,5 do
while turtle.detect()==true do
turtle.dig()
os.sleep(0.5)
end
turtle.forward()
while turtle.detectUp()==true do
turtle.digUp()
os.sleep(0.5)
end
end
turtle.turnRight()
turtle.turnRight()
for i=1,5 do
turtle.forward()
end
turtle.turnLeft()
end
ProXeloHdx:)
136 posts
Posted 24 October 2012 - 09:26 PM
while turtle.detect()==true do
os.sleep(0.5)
end
No turtle.dig()
231 posts
Posted 24 October 2012 - 09:43 PM
Also, on line seven turtle.detectUP() should be turtle.detectUp()
3 posts
Posted 25 October 2012 - 09:42 AM
It dosn't work.. Can you find a wrong part? Or did I forgot a part?
Here the code now:
for i=1,100 do
for i=1,3 do
while turtle.detect()==true do
os.sleep(0.5)
end
turtle.forward()
while turtle.detectUp()==true do
os.sleep(0.5)
end
end
turtle.turnRight()
for i=1,5 do
while turtle.detect()==true do
os.sleep(0.5)
end
turtle.forward()
while turtle.detectUp()==true do
os.sleep(0.5)
end
end
turtle.turnRight()
turtle.turnRight()
for i=1,5 do
turtle.forward()
end
for i=1,5 do
while turtle.detect()==true do
os.sleep(0.5)
end
turtle.forward()
while turtle.detectUp()==true do
os.sleep(0.5)
end
end
turtle.turnRight()
turtle.turnRight()
for i=1,5 do
turtle.forward()
end
turtle.turnLeft()
end
3 posts
Posted 25 October 2012 - 09:49 AM
It's work now:
for i=1,3 do
while turtle.detect()==true do
turtle.dig()
os.sleep(0.5)
end
turtle.forward()
while turtle.detectUp()==true do
turtle.digUp()
os.sleep(0.5)
end
end
turtle.turnRight()
for i=1,5 do
while turtle.detect()==true do
turtle.dig()
os.sleep(0.5)
end
turtle.forward()
while turtle.detectUp()==true do
turtle.digUp()
os.sleep(0.5)
end
end
turtle.turnRight()
turtle.turnRight()
for i=1,5 do
turtle.forward()
end
for i=1,5 do
while turtle.detect()==true do
turtle.dig()
os.sleep(0.5)
end
turtle.forward()
while turtle.detectUp()==true do
turtle.digUp()
os.sleep(0.5)
end
end
turtle.turnRight()
turtle.turnRight()
for i=1,5 do
turtle.forward()
end
turtle.turnLeft()
end
2005 posts
Posted 25 October 2012 - 09:54 AM
This is supposed to be a mining program, right? You don't have a single dig command (i.e turtle.dig[Up/Down]()), just a heck of a lot of "while turtle.detect[Up]()==true do os.sleep(0.5) end" commands.
I'm not sure what you expect to happen, but the first time your turtle detects a block in front of it, it just sits there and detects it till the end of time. You can detect a block forever, that won't break it.
What I do for mining is replace the standard move commands with functions that attempt to move, and if that fails they detect/dig or attack.
2088 posts
Location
South Africa
Posted 25 October 2012 - 11:19 AM
This is supposed to be a mining program, right? You don't have a single dig command (i.e turtle.dig[Up/Down]()), just a heck of a lot of "while turtle.detect[Up]()==true do os.sleep(0.5) end" commands.
I'm not sure what you expect to happen, but the first time your turtle detects a block in front of it, it just sits there and detects it till the end of time. You can detect a block forever, that won't break it.
What I do for mining is replace the standard move commands with functions that attempt to move, and if that fails they detect/dig or attack.
He does have dig commands :? Unless he edited them after you said this.
2005 posts
Posted 25 October 2012 - 12:02 PM
He better edit it…oh wait, he's got two posts there. Yeah, it's looking a lot more worky now.