76
6.1.16. Log function
log(var1, [var2, [var3, ...]])
Converts variables to human-readable form and stores them in the main database. All items are
accessible in the "Logs" module.
Example
1.
-- log function accepts Lua nil, boolean, number and table (up to 5 nested levels) type
variables
2.
a
={
key1
='value1'
, key2
=2}
3.
b
='test'
4.
c
=123.45
5.
-- logs all passed variables
6.
log(
a, b, c
)
6.1.17. Scheduled scripting date/time format
Scheduled scripting uses standard cron format for date/time parameters. Valid values are:
* execute script every minute, hour or day.
*/N execute script every N minutes, hours or days. N is an integer, script is executed
when current value divided by N gives 0 in modulo. For example, script with hour
parameter set to */8 will be executed when hour is 0, 8 and 16.
N execute script exactly at N minute, hour or day.
N-K execute script when minute, hour or day is between N-K range (inclusive).
N,K it is possible to specify several N and N-K type parameters separated by comma.
For example, script with minute parameter set to 15,50-52 will get executed when minute
is 15, 50, 51 and 52
6.1.18. Time function
os.sleep(delay)
Delay the next command execution for the delay seconds.
os.microtime ()
Returns two values: current timestamp in seconds and timestamp fraction in nanoseconds
os.udifftime (sec, usec)
Returns time difference as floating point value between now and timestamp components
passed to this function (seconds, nanoseconds)