Jump to content




I need help with Minestrip Programm

turtle

  • You cannot reply to this topic
7 replies to this topic

#1 ProXeloHdx

  • New Members
  • 3 posts

Posted 24 October 2012 - 07: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:)

#2 Ditto8353

  • New Members
  • 138 posts

Posted 24 October 2012 - 08:26 PM

while turtle.detect()==true do
os.sleep(0.5)
end
No turtle.dig()

#3 faubiguy

  • Members
  • 213 posts

Posted 24 October 2012 - 08:43 PM

Also, on line seven turtle.detectUP() should be turtle.detectUp()

#4 ProXeloHdx

  • New Members
  • 3 posts

Posted 25 October 2012 - 08: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


#5 ProXeloHdx

  • New Members
  • 3 posts

Posted 25 October 2012 - 08: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


#6 ChunLing

  • Members
  • 2,027 posts

Posted 25 October 2012 - 08: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.

#7 remiX

  • Members
  • 2,076 posts
  • LocationSouth Africa

Posted 25 October 2012 - 10:19 AM

View PostChunLing, on 25 October 2012 - 08:54 AM, said:

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.

#8 ChunLing

  • Members
  • 2,027 posts

Posted 25 October 2012 - 11:02 AM

He better edit it...oh wait, he's got two posts there. Yeah, it's looking a lot more worky now.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users