FSUIPC: Lua Tutorial
For Microsoft Flight Simulator and GoFlight Equipment

 

Home
About Lua
Executing Code
Binary
Hexadecimal
Bits & Bytes
Memory Offsets
Variables
The Code
The Editor
Get Started
FlightSim
Cleaning Up
Assignments

 

Executing Lua Code

    There are two ways to get your Lua files going. Manually and Automatically. Each method has several ways of it's own.

 

Manual Code Execution

    You can assign any button, switch, key or lever to run a Lua file.  In the example below, we have assigned a button to run a Lua file named "MyTestLua". file.

 

Automatic Code Execution

    The best way to get the same files running every time is to have them run automatically. This is accomplished several ways.

  • FSUIPC.ini

     Add a section called [Auto] and using a sequential list, add any files you want.

            [Auto]
            1=Lua GF-Setup
            2=Lua ModDisplay
     

  • ipcinit.Lua            This file is automatically run as soon as FSUIPC has initialized.
  • ipcready.Lua        This file is automatically run when FS is "ready to fly".
  • ipcDebug.Lua       This file is automatically loaded before and Lua program which is started in Debug mode.
     
  • From within your Lua file, we can run another Lua file using the
    ipc.runLua("pathname"[, parameter])
    command

 

Stopping or Killing Code

    The best way is to assign the Kill function within FSUIPC. You can kill individual Lua files or all at the same time.

 

Let's move on to how computers think.

 


Written by
Joseph "Skittles" Cardana
skittles(at)anadrac.com
Updated: 2011-08-25 07:58