This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
CzerPL's profile picture

how to repeat comand?

Started by CzerPL, 26 October 2012 - 05:21 PM
CzerPL #1
Posted 26 October 2012 - 07: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??
Ditto8353 #2
Posted 26 October 2012 - 07: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
remiX #3
Posted 26 October 2012 - 07:24 PM

while true do
  -- code here
end
CzerPL #4
Posted 26 October 2012 - 07:29 PM
?? where write "while true do" ???

i write when detect do
CzerPL #5
Posted 26 October 2012 - 07:31 PM
where i must write " while true do" ??
CzerPL #6
Posted 26 October 2012 - 07: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
Ditto8353 #7
Posted 26 October 2012 - 07:36 PM
while true do
   while turtle.detect() do
      turte.dig()
      turtle.forward()
   end
   while not turtle.detect() do
      turtle.turnLeft()
   end
end
CzerPL #8
Posted 26 October 2012 - 07:37 PM
thanks
remiX #9
Posted 26 October 2012 - 07:38 PM
:D/>/>
CzerPL #10
Posted 26 October 2012 - 07:39 PM
how to stop turtle?
Ditto8353 #11
Posted 26 October 2012 - 07:39 PM
Kill it
CzerPL #12
Posted 26 October 2012 - 07:40 PM
no!!!!

xd
Ditto8353 #13
Posted 26 October 2012 - 07:46 PM
Seriously, just pick it up with a pickaxe. He'll be ok.
remiX #14
Posted 26 October 2012 - 07:46 PM
Open him up again, and hold Ctrl and T
Ditto8353 #15
Posted 26 October 2012 - 07:47 PM
Open him up again, and hold Ctrl and T
Correct, yet gross.
ChunLing #16
Posted 26 October 2012 - 07: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 on 26 October 2012 - 05:49 PM
remiX #17
Posted 26 October 2012 - 07:49 PM
Correct, yet gross.

Lol'd xD
darkrising #18
Posted 26 October 2012 - 11:18 PM
Seriously, just pick it up with a pickaxe. He'll be ok.

You might hurt his feelings :D/>/>