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

[LUA]How do i make a program loop?

Started by KingMinecrafter, 06 December 2012 - 02:37 AM
KingMinecrafter #1
Posted 06 December 2012 - 03:37 AM
Hi! i want to make my program loop, i have done so it is in startup on my main computer so i can acces it easily, but i want it to loop. it is a program that sends a message to a turtle to turn on the lights and open the door but i always have to type in reboot or startup agian before i can type another command, i want to make it so i can type commands non stop until i exit it manually. not just one command and it exits itself. please help :)/> i am very new to this.
Kingdaro #2
Posted 06 December 2012 - 04:00 AM
Infinite loops are usually best done with while true do.


while true do
  -- stuff
end
KingMinecrafter #3
Posted 06 December 2012 - 04:05 AM
thanks! it worked :D/>