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

Is there a wait() command?

Started by explosive557, 06 January 2014 - 06:06 PM
explosive557 #1
Posted 06 January 2014 - 07:06 PM
Is there a piece of code or something like that used to make the script wait a couple seconds, then proceed? I've tried a bunch of different ways to do it with the wait() command but now I'm almost positive that that command doesn't exist.
Lyqyd #2
Posted 06 January 2014 - 08:36 PM
sleep().
aaa #3
Posted 07 January 2014 - 02:46 PM
sleep(<nb_of_second_you_want_to_sleep>)
With no argument, it waits 0s (only yields, for use in infinite loop, or parallel)

edit : with no argument, it errors (see my neighbour of below)
Edited on 12 January 2014 - 01:47 PM
OReezy #4
Posted 07 January 2014 - 08:33 PM
sleep(<nb_of_second_you_want_to_sleep>)
With no argument, it waits 0s (only yields, for use in infinite loop, or parallel)

if you code sleep() without a number it errors.