_G

Global functions defined by bios.lua. This does not include standard Lua functions.

sleep(time)Pauses execution for the specified number of seconds.
write(text)
print(...)
printError(...)
read(replaceChar, history, completeFn, default)
_HOSTThe ComputerCraft and Minecraft version of the current computer environment.
_CC_DEFAULT_SETTINGSThe default computer settings as defined in the ComputerCraft configuration.
sleep(time)Source

Pauses execution for the specified number of seconds.

As it waits for a fixed amount of world ticks, time will automatically be rounded up to the nearest multiple of 0.05 seconds. If you are using coroutines or the parallel API, it will only pause execution of the current thread, not the whole program.

Note Because sleep internally uses timers, it is a function that yields. This means that you can use it to prevent "Too long without yielding" errors, however, as the minimum sleep time is 0.05 seconds, it will slow your program down.

Warning Internally, this function queues and waits for a timer event (using os.startTimer), however it does not listen for any other events. This means that any event that occurs while sleeping will be entirely discarded. If you need to receive events while sleeping, consider using timers, or the parallel API.

Parameters

  1. time number The number of seconds to sleep for, rounded up to the nearest multiple of 0.05.

See also

write(text)Source

Parameters

  1. text
print(...)Source

Parameters

  1. ...
printError(...)Source

Parameters

  1. ...
read(replaceChar, history, completeFn, default)Source

Parameters

  1. replaceChar
  2. history
  3. completeFn
  4. default
_HOSTSource

The ComputerCraft and Minecraft version of the current computer environment.

For example, ComputerCraft 1.93.0 (Minecraft 1.15.2).

_CC_DEFAULT_SETTINGSSource

The default computer settings as defined in the ComputerCraft configuration.

This is a comma-separated list of settings pairs defined by the mod configuration or server owner. By default, it is empty.

An example value to disable autocompletion:

shell.autocomplete=false,lua.autocomplete=false,edit.autocomplete=false