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

 

Code

    There are a few more terms to define...

        Routine:        A routine is a sequence of computer instructions for performing a task.

        Sub-routine:    A routine within a routine.

        Chunks:    Wrapped routines. Has a starting and ending point. A function is a chunk. (See below)

        Command:    An order to a computer to execute a series of instructions.

        Keyword:    Keywords are reserved to the programming language. The following words are keywords for Lua...
                            and    break    do    else    elseif    end    false
                            for    function    if    in    local    nil    not    or
                            repeat    return    then    true    until    while

        Parameters:    Value requirements of a routine

        Functions:    A function is a chunk or groups of chunks. It's a named procedure that is specifically executed. and is closed with and "end" statement.

         Library:        Many commands grouped together to serve a common purpose. The Lua language has several libraries, these are just a few...
                            ipc,    logic,    com,    event,    sound,    gfd

        Loops:        A series of chunks performed repeatedly.

 

    Introducing new commands gets tricky if the user isn't a programmer. When a new command is introduced, I will try to show the different pieces. For example, let's pretend there's a command called "JohnDoe". There will be certain formats to indicate certain uses...

        JohnDoe()

    The font itself will be an indicator. If you don't have the font "Consolas" installed, I suggest getting it HERE.  The reason I like the "Consolas" font is it easily  distinguishes between the letter "O" and the number zero "0".

    Another format you will see is italics. This will tell you that the italicized word is a parameter and may not be used exactly as shown since variables can be names different things.

        JohnDoe(name, age)

    Another format you will see are [ and ].  These will surround optional items. In the next example, The name parameter is required, but not the age parameter.

        JohnDoe(name[, age])

    Sometimes I will also use color to explain various parts of a command...

        JohnDoe(name[, age])

    This is the first name and this is the last name.

 


 


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