--[[ these vars will be assigned only once global var will keep their values between scans BUT NOT between project restarts!!! -- for saving data between project restarts use D or DSxxx registers or key-value storage --]] first_scan = true -- first scan flag GLOBAL_CONSTANT_1 = 100 -- UPPER case preferrable for constants local now1 = 0 -- global because outside scope of main function main (userId) now2 = 0 -- also global because no "local" before if first_scan then first_scan = false -- some actions only made once upon project restart end now1 = os.time () -- get time from Lua function now2 = GetReg ( "systemTime" ) -- get time form register with "systemTime" alias if (now1 == now2) then DEBUG ( "both time are equal" ) else ERROR ( "something wrong with time ... " ) end end -- main