Jump to content




how to repeat comand?


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

#1 CzerPL

  • New Members
  • 8 posts

Posted 26 October 2012 - 06:21 PM

HOw to repeat 2 comand in turtle?? :

i writed

while turtle.detect() do
dig...
forward....
end
while not detect do..
turnLeft..
end

what and where i must write to turtle repeat this??

#2 Ditto8353

  • New Members
  • 138 posts

Posted 26 October 2012 - 06:24 PM

If you want a turtle to repeat something 'x' times
for i=1,x do
<code>
end

If you want the turtle to repeat forever
while true do
<code>
end


#3 remiX

  • Members
  • 2,076 posts
  • LocationSouth Africa

Posted 26 October 2012 - 06:24 PM

while true do
  -- code here
end


#4 CzerPL

  • New Members
  • 8 posts

Posted 26 October 2012 - 06:29 PM

?? where write "while true do" ???

i write when detect do

#5 CzerPL

  • New Members
  • 8 posts

Posted 26 October 2012 - 06:31 PM

where i must write " while true do" ??

#6 CzerPL

  • New Members
  • 8 posts

Posted 26 October 2012 - 06:33 PM

this is my program, copy and write where i must write what

when turtle.detect() do
turte.dig()
turtle.forward()
end
when not turtle.detect() do
turtle.turnLeft()
end

#7 Ditto8353

  • New Members
  • 138 posts

Posted 26 October 2012 - 06:36 PM

while true do
   while turtle.detect() do
      turte.dig()
      turtle.forward()
   end
   while not turtle.detect() do
      turtle.turnLeft()
   end
end


#8 CzerPL

  • New Members
  • 8 posts

Posted 26 October 2012 - 06:37 PM

thanks

#9 remiX

  • Members
  • 2,076 posts
  • LocationSouth Africa

Posted 26 October 2012 - 06:38 PM

:D/>

#10 CzerPL

  • New Members
  • 8 posts

Posted 26 October 2012 - 06:39 PM

how to stop turtle?

#11 Ditto8353

  • New Members
  • 138 posts

Posted 26 October 2012 - 06:39 PM

Kill it

#12 CzerPL

  • New Members
  • 8 posts

Posted 26 October 2012 - 06:40 PM

no!!!!

xd

#13 Ditto8353

  • New Members
  • 138 posts

Posted 26 October 2012 - 06:46 PM

Seriously, just pick it up with a pickaxe. He'll be ok.

#14 remiX

  • Members
  • 2,076 posts
  • LocationSouth Africa

Posted 26 October 2012 - 06:46 PM

Open him up again, and hold Ctrl and T

#15 Ditto8353

  • New Members
  • 138 posts

Posted 26 October 2012 - 06:47 PM

View PostsIdEkIcK_, on 26 October 2012 - 06:46 PM, said:

Open him up again, and hold Ctrl and T
Correct, yet gross.

#16 ChunLing

  • Members
  • 2,027 posts

Posted 26 October 2012 - 06:49 PM

Just open the console and hold down Ctrl+t (I think that you may need to use right control button).

Ninjas everywhere!

Edited by ChunLing, 26 October 2012 - 06:49 PM.


#17 remiX

  • Members
  • 2,076 posts
  • LocationSouth Africa

Posted 26 October 2012 - 06:49 PM

View PostDitto8353, on 26 October 2012 - 06:47 PM, said:

Correct, yet gross.

Lol'd xD

#18 darkrising

  • Members
  • 234 posts
  • LocationScotland

Posted 26 October 2012 - 10:18 PM

View PostDitto8353, on 26 October 2012 - 06:46 PM, said:

Seriously, just pick it up with a pickaxe. He'll be ok.

You might hurt his feelings :D/>





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users