The Flight Sim IO Server will automatically create a Lua script file called global.lua which will contain nothing. This Lua script file will run automatically once an aircraft's virtual cockpit has loaded.
global.lua is shared across all aircraft and must contain only code that is relevant for all aircraft e.g. setting global variables for use across all Lua scripts.
global.lua runs on its own thread so can be coded to loop continuously. Remember to add a sleep statement if looping the code so that the thread does not hog all the CPU time e.g. sleep(100).