FlyWithLua Quick Reference Manual Fly With Lua En
User Manual:
Open the PDF directly: View PDF
Page Count: 101 [warning: Documents this large are best viewed by clicking the View PDF Link!]
- Using the Plugin
- Reference
- Predefined variables
- LONGITUDE
- LATITUDE
- PLANE_ICAO
- PLANE_TAILNUMBER
- SCREEN_WIDTH
- SCREEN_HIGHT
- MOUSE_X
- MOUSE_Y
- XSB_METAR
- LUA_RUN
- XPLANE_VERSION
- XPLANE_HOSTID
- SDK_VERSION
- SYSTEM
- SYSTEM_ARCHITECTURE
- XPLANE_LANGUAGE
- DIRECTORY_SEPARATOR
- SCRIPT_DIRECTORY
- AIRCRAFT_PATH
- AIRCRAFT_FILENAME
- DO_EVERY_FRAME_TIME_SEC
- DO_EVERY_DRAW_TIME_SEC
- DO_SOMETIMES_TIME_SEC
- DO_OFTEN_TIME_SEC
- SCRIPTS_LOADING_TIME_SEC
- CLOCKS_PER_SEC
- LUA_MEMORY_USAGE_KB
- Lua functions
- DataRef( "variable name", "DataRef name" )
- DataRef( "variable name", "DataRef name", "readonly" )
- DataRef( "variable name", "DataRef name", "readonly", index )
- table = dataref_table( "DataRef name")
- define_shared_DataRef("DataRef name", "DataRef type")
- table = create_dataref_table( "DataRef name", "DataRef type")
- DataRef name, Index, readonly, DataRef type, DataRef ID = get_DataRef_binding( "variable name" )
- button( button number )
- last_button( button number )
- create_switch( button number, DataRef name, index, off value, on value )
- create_positive_edge_flip( button number, DataRef name, index, first value, second value )
- create_negative_edge_flip( button number, DataRef name, index, first value, second value )
- create_positive_edge_trigger( button number, DataRef name, index, value )
- create_negative_edge_trigger( button number, DataRef name, index, value )
- create_positive_edge_increment( button number, DataRef name, index, stepping, limit, rounding )
- create_negative_edge_increment( button number, DataRef name, index, stepping, limit, rounding )
- create_positive_edge_decrement( button number, DataRef name, index, stepping, limit, rounding )
- create_negative_edge_decrement( button number, DataRef name, index, stepping, limit, rounding )
- create_axis_median( axis number, variable name )
- get( "DataRef name" )
- get( "DataRef name", index )
- set( "DataRef name", value )
- set_array( "DataRef name", index, value )
- set_button_assignment( button number, "simulator function")
- set_axis_assignment( axis number, "axis function", "reverse")
- clear_all_axis_assignments()
- clear_all_button_assignments()
- set_pilots_head( x, y, z, heading, pitch )
- x, y, z, heading, pitch = get_pilots_head( )
- command_begin( "simulator function" )
- command_once( "simulator function" )
- command_end( "simulator function" )
- logMsg( "string" )
- XSBSpeakString( "string" )
- XPLMSpeakString( "string" )
- print( "string" )
- do_sometimes( "Lua code string" )
- do_often( "Lua code string" )
- do_every_frame( "Lua code string" )
- do_every_draw( "Lua code string" )
- do_on_keystroke( "Lua code string" )
- do_on_mouse_wheel( "Lua code string" )
- do_on_mouse_click( "Lua code string" )
- do_on_new_metar( "Lua code string" )
- do_on_new_XSB_text( "Lua code string" )
- do_on_exit( "Lua code string" )
- draw_string( x, y, "string" )
- draw_string( x, y, "string", "color" )
- draw_string( x, y, "string", red, green, blue )
- draw_string_Helvetica_10( x, y, "string" )
- draw_string_Helvetica_12( x, y, "string" )
- draw_string_Helvetica_18( x, y, "string" )
- draw_string_Times_Roman_10( x, y, "string" )
- draw_string_Times_Roman_24( x, y, "string" )
- measure_string( "string" )
- measure_string( "string", "font name" )
- hight, width = bubble( x, y, "title", … )
- hight, width = big_bubble( x, y, "title", … )
- hight, width = huge_bubble( x, y, "title", … )
- add_macro( "macro name", "Lua code string" )
- add_ATC_macro( "macro name", "Lua code string" )
- add_macro( "macro name", "activation code string", "deactivation code string", "default state" )
- create_command( "command name", "command description", "begin code string", "continue code string", "end code string" )
- table = directory_to_table( "path" )
- place_aircraft_at( "ICAO" )
- load_aircraft( "path and full filename" )
- load_situation( "path and full filename" )
- save_situation( "path and full filename" )
- reload_scenery()
- crash_the_sim()
- Predefined variables
- Modules
- OpenAL sound
- OpenGL graphics
- Functions of OpenGL
- glBegin_POINTS()
- glBegin_LINES()
- glBegin_LINE_STRIP()
- glBegin_LINE_LOOP()
- glBegin_POLYGON()
- glBegin_TRIANGLES()
- glBegin_TRIANGLE_STRIP()
- glBegin_TRIANGLE_FAN()
- glBegin_QUADS()
- glBegin_QUAD_STRIP()
- glEnd()
- glVertex2f(x, y)
- glVertex3f(x, y, z)
- glLineWidth(width)
- glColor3f(red, green, blue)
- glColor4f(red, green, blue, alpha)
- glRectf(x1, y1, x2, y2)
- XPLMSetGraphicsState(EnableFog, NumberTexUnits, EnableLighting, EnableAlphaTesting, EnableAlphaBlending, EnableDepthTesting, EnableDepthWriting)
- Functions of OpenGL
- The graphics module
- Functions of graphics module
- x_result, y_result = graphics.move_angle( x, y, angle, length )
- graphics.draw_line( x1, y1, x2, y2 )
- graphics.draw_rectangle( x1, y1, x2, y2 )
- graphics.draw_triangle( x1, y1, x2, y2, x3, y3 )
- graphics.set_color( red, green, blue, alpha )
- graphics.set_width( width )
- graphics.draw_angle_line( x, y, angle, length )
- graphics.draw_angle_arrow( x, y, angle, length, arrowhead's length, line width )
- graphics.draw_circle( x, y, radius, line width )
- graphics.draw_filled_circle( x, y, radius )
- graphics.draw_arc( x, y, start angle, end angle, radius, line width )
- graphics.draw_filled_arc( x, y, start angle, end angle, radius )
- graphics.draw_tick_mark( x, y, angle, radius, length, width )
- graphics.draw_outer_tracer( x, y, angle, radius, size )
- graphics.draw_inner_tracer( x, y, angle, radius, size )
- Functions of graphics module
- HUD module
- An Interactive HUD
- An Example
- Functions from HUD module
- HUD.begin_HUD( x, y, width, hight, "name", "always" )
- HUD.end_HUD( )
- HUD.create_element( "name", x, y, width, hight, red, green, blue, alpha )
- HUD.draw_string( x, y, fontsize, "string", red, green, blue, alpha )
- HUD.draw_fstring( x, y, fontsize, "format", "expression", red, green, blue, alpha )
- HUD.create_backlight_indicator( x, y, width, hight, "condition", red, green, blue, alpha )
- HUD.create_click_action( x, y, width, hight, "action" )
- HUD.create_click_switch( x, y, width, hight, "variable", value, alternative value )
- HUD.create_wheel_action( x, y, width, hight, "action" )
- XPLMNavigation
- Functions from XPLMNavigation
- nav_reference = XPLMGetFirstNavAid()
- next_nav_reference = XPLMGetNextNavAid( inNavAidRef )
- first_nav_reference = XPLMFindFirstNavAidOfType( inType )
- last_nav_reference = XPLMFindLastNavAidOfType( inType )
- nav_reference = XPLMFindNavAid( inNameFragment, inIDFragment, inLat, inLon, inFrequency, inType)
- outType, outLatitude, outLongitude, outHeight, outFrequency, outHeading, outID, outName = XPLMGetNavAidInfo( inRef )
- index_count = XPLMCountFMSEntries()
- index = XPLMGetDisplayedFMSEntry()
- index = XPLMGetDestinationFMSEntry()
- XPLMSetDisplayedFMSEntry( inIndex )
- XPLMSetDestinationFMSEntry( inIndex )
- outType, outID, outRef, outAltitude, outLat, outLon = XPLMGetFMSEntryInfo( inIndex )
- XPLMSetFMSEntryInfo( inIndex, inRef, inAltitude)
- XPLMSetFMSEntryLatLon( inIndex, inLat, inLon, inAltitude)
- XPLMClearFMSEntry( inIndex )
- Functions from XPLMNavigation
- Access HID devices
- Pre-defined variables
- HID related functions
- table, number = create_HID_table()
- device = hid_open( vendor_ID, product_ID )
- device = hid_open_path( path )
- hid_close( device )
- hid_write( device, report ID, value, ... )
- nov, variable, ... = hid_read_timeout( device, nov wanted, milliseconds )
- nov, variable, ... = hid_read_timeout( device, nov wanted )
- success = hid_set_nonblocking( device, nonblock )
- nobw = hid_send_feature_report( device, report ID, value, ... )
- nobw = hid_send_filled_feature_report( device, report ID, nobts, value, ... )
- nobr, report ID, variable, ... = hid_get_feature_report( device, novw )
- The Arcaze USB module
- device = arcaze.open_first_device()
- A1, A2, A3, ..., B19, B20 = arcaze.read_pins( device )
- ADC1, ADC2, ADC3, ADC4, ADC5, ADC6 = arcaze.read_ADCs( device )
- E1, E2, E3, ..., E19, E20 = arcaze.read_encoders( device )
- arcaze.set_all_pins_for_input( device )
- arcaze.set_pin_direction( device, pin, direction )
- arcaze.set_pin( device, pin, value )
- arcaze.init_display( device, address, intensity, scan_limit )
- arcaze.init_display( device, address )
- arcaze.show( device, address, mask, value_string )
- Classic and modern mode
- The Lua way to access DataRefs
- Manage your joysticks
- Understanding PLCs
- Basic knowledge about DataRefs
- Take Lua into consideration
- Debugging
- Integrate foreign libraries
- The new 64-bit architecture
- Q&A
- Credits
- License