Variables
Variable List
os.execute
Executes a system command. Use with extreme caution.
Parameters
command
os.execute(command)os.getenv
Gets an environment variable.
Parameters
varname
os.getenv(varname)os.remove
Deletes a file.
Parameters
filename
os.remove(filename)os.rename
Renames a file.
Parameters
oldnamenewname
os.rename(oldname,newname)os.setlocale
Sets the program locale.
Parameters
localecategory
os.setlocale(locale,category)os.exit
Exits the script immediately.
Parameters
code
os.exit(code)http.get
Performs an HTTP GET request. Must be wrapped in a coroutine.
Parameters
urlheaders
http.get(url,headers)http.post
Performs an HTTP POST request. Must be wrapped in a coroutine.
Parameters
urlheaderspostData
http.post(url,headers,postData)json.encode
Encodes a Lua table into a JSON string.
Parameters
dataTable
json.encode(dataTable)json.decode
Decodes a JSON string into a Lua table.
Parameters
jsonString
json.decode(jsonString)bit.band
Performs a bitwise AND operation. Used for checking flags.
Parameters
xy
bit.band(x,y)bit.lshift
Performs a left bitwise shift. Used for creating bit flags.
Parameters
xn
bit.lshift(x,n)timer.settimeout
Executes a function once after a specified delay. Additional arguments are passed to the function.
Parameters
delay_secondsfunction...args
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_secondsfunction
timer.setInterval(interval_seconds,function)timer.clear
Stops a timer that was created with setInterval.
Parameters
id
timer.clear(id)file.read
Reads the content of a file.
Parameters
path
file.read(path)file.write
Writes content to a file.
Parameters
pathcontent
file.write(path,content)file.exists
Checks if a file exists.
Parameters
path
file.exists(path)file.delete
Deletes a file.
Parameters
path
file.delete(path)dir.create
Creates a directory.
Parameters
path
dir.create(path)dir.exists
Checks if a directory exists.
Parameters
path
dir.exists(path)dir.delete
Deletes a directory.
Parameters
path
dir.delete(path)sqlite.open
Opens a SQLite database connection. Returns a db object.
Parameters
path
sqlite.open(path)db:query
Executes a SQL query on the database object.
Parameters
sql
db:query(sql)db:close
Closes the SQLite database connection.
db:close()