Variables
Variable List
band
Performs a bitwise AND operation. Used for checking flags.
Parameters
xy
bit.band(x,y)clear
Stops a timer that was created with setInterval.
Parameters
id
timer.clear(id)clock
Returns the CPU time used by the program in seconds.
os.clock()date
Formats a date and time.
os.date()decode
Decodes a JSON string into a Lua table.
Parameters
jsonString
json.decode(jsonString)encode
Encodes a Lua table into a JSON string.
Parameters
dataTable
json.encode(dataTable)execute
Executes a system command. Use with extreme caution.
Parameters
command
os.execute(command)exit
Exits the script immediately.
Parameters
code
os.exit(code)get
Performs an HTTP GET request. Must be wrapped in a coroutine.
Parameters
urlheaders
http.get(url,headers)getenv
Gets an environment variable.
Parameters
varname
os.getenv(varname)lshift
Performs a left bitwise shift. Used for creating bit flags.
Parameters
xn
bit.lshift(x,n)post
Performs an HTTP POST request. Must be wrapped in a coroutine.
Parameters
urlheaderspostData
http.post(url,headers,postData)remove
Deletes a file.
Parameters
filename
os.remove(filename)rename
Renames a file.
Parameters
oldnamenewname
os.rename(oldname,newname)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)setlocale
Sets the program locale.
Parameters
localecategory
os.setlocale(locale,category)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)time
Returns the current time as a Unix timestamp.
os.time()