Skip to content

Variables

Variable List

os.execute

Executes a system command. Use with extreme caution.

Parameters

  • command
lua
os.execute(command)

os.getenv

Gets an environment variable.

Parameters

  • varname
lua
os.getenv(varname)

os.remove

Deletes a file.

Parameters

  • filename
lua
os.remove(filename)

os.rename

Renames a file.

Parameters

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

os.setlocale

Sets the program locale.

Parameters

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

os.exit

Exits the script immediately.

Parameters

  • code
lua
os.exit(code)

http.get

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

Parameters

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

http.post

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

Parameters

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

json.encode

Encodes a Lua table into a JSON string.

Parameters

  • dataTable
lua
json.encode(dataTable)

json.decode

Decodes a JSON string into a Lua table.

Parameters

  • jsonString
lua
json.decode(jsonString)

bit.band

Performs a bitwise AND operation. Used for checking flags.

Parameters

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

bit.lshift

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

Parameters

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

timer.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)

timer.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)

timer.clear

Stops a timer that was created with setInterval.

Parameters

  • id
lua
timer.clear(id)

file.read

Reads the content of a file.

Parameters

  • path
lua
file.read(path)

file.write

Writes content to a file.

Parameters

  • path
  • content
lua
file.write(path,content)

file.exists

Checks if a file exists.

Parameters

  • path
lua
file.exists(path)

file.delete

Deletes a file.

Parameters

  • path
lua
file.delete(path)

dir.create

Creates a directory.

Parameters

  • path
lua
dir.create(path)

dir.exists

Checks if a directory exists.

Parameters

  • path
lua
dir.exists(path)

dir.delete

Deletes a directory.

Parameters

  • path
lua
dir.delete(path)

sqlite.open

Opens a SQLite database connection. Returns a db object.

Parameters

  • path
lua
sqlite.open(path)

db:query

Executes a SQL query on the database object.

Parameters

  • sql
lua
db:query(sql)

db:close

Closes the SQLite database connection.

lua
db:close()

Released under the MIT License.