Skip to content

Variables

Variable List

band

Performs a bitwise AND operation. Used for checking flags.

Parameters

  • x
  • y
lua
bit.band(x,y)

clear

Stops a timer that was created with setInterval.

Parameters

  • id
lua
timer.clear(id)

clock

Returns the CPU time used by the program in seconds.

lua
os.clock()

date

Formats a date and time.

lua
os.date()

decode

Decodes a JSON string into a Lua table.

Parameters

  • jsonString
lua
json.decode(jsonString)

encode

Encodes a Lua table into a JSON string.

Parameters

  • dataTable
lua
json.encode(dataTable)

execute

Executes a system command. Use with extreme caution.

Parameters

  • command
lua
os.execute(command)

exit

Exits the script immediately.

Parameters

  • code
lua
os.exit(code)

get

Performs an HTTP GET request. Must be wrapped in a coroutine.

Parameters

  • url
  • headers
lua
http.get(url,headers)

getenv

Gets an environment variable.

Parameters

  • varname
lua
os.getenv(varname)

lshift

Performs a left bitwise shift. Used for creating bit flags.

Parameters

  • x
  • n
lua
bit.lshift(x,n)

post

Performs an HTTP POST request. Must be wrapped in a coroutine.

Parameters

  • url
  • headers
  • postData
lua
http.post(url,headers,postData)

remove

Deletes a file.

Parameters

  • filename
lua
os.remove(filename)

rename

Renames a file.

Parameters

  • oldname
  • newname
lua
os.rename(oldname,newname)

setInterval

Executes a function repeatedly at a specified interval. Returns an ID to be used with timer.clear.

Parameters

  • interval_seconds
  • function
lua
timer.setInterval(interval_seconds,function)

setlocale

Sets the program locale.

Parameters

  • locale
  • category
lua
os.setlocale(locale,category)

setTimeout

Executes a function once after a specified delay. Additional arguments are passed to the function.

Parameters

  • delay_seconds
  • function
  • ...args
lua
timer.setTimeout(delay_seconds,function,...args)

time

Returns the current time as a Unix timestamp.

lua
os.time()

Released under the MIT License.