MobiFlight Community Support

Welcome to the forum for MobiFlight! Feel free to reach out to the community in case you have questions, issues or just want to share great ideas or details about your latest home cockpit project.

You like MobiFlight? Donate via PayPal and support the MobiFlight development. Thanks! 

05/03/2024 - This forum is read-only

The community support for MobiFlight has moved exclusively over to our Discord server. Register for free and enjoy more interactive functions like image and video upload, voice chat. More than 7,000 registered users around the world make it a great experience!

See you on our MobiFlight Community Discord server.

A HUGE Thank You to everyone who participated in the forum, especially obviously to Pizman and Stephan who did an outstanding job over so many years providing an incredible service to the MobiFlight community.

The forum is still providing a lot of good content, hence we keep this information accessible.

icon
Avatar
ismailsurek37
Posts: 8
hi
How can possible is the using Lua script with mobiflight .
Lua ; seem on configurator when building up the sooftware
can anyone describe how to use can using Lua because if possible,
Using 74HC4067 multiplexer can use for input so we will have more ports
we were used Lua inputs( button switch and comutator ) for FWD and AFT overhead with 2 arduino mega
but need to working hard to use this for outputs
Thanks
2019-12-14 18:24
Avatar
ismailsurek37
Posts: 8
how can we use this code_ ?
https://bitbucket.org/mobiflight/mobiflightfc/src/master/MobiFlight/InputConfig/LuaMacroInputAction.cs
--------------------------------------------------------------------------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MobiFlight.FSUIPC;

namespace MobiFlight.InputConfig
{
class LuaMacroInputAction : InputAction
{
public String MacroName = "";
public Int32 MacroValue = 0;
public new const String Label = "Lua Macro";
public const String TYPE = "LuaMacroInputAction";

public override object Clone()
{
LuaMacroInputAction clone = new LuaMacroInputAction();
clone.MacroName = MacroName;

return clone;
}

public override void ReadXml(System.Xml.XmlReader reader)
{

MacroName = reader["macroName"];
MacroValue = Int32.Parse(reader["value"]);
}

public override void WriteXml(System.Xml.XmlWriter writer)
{
writer.WriteAttributeString("type", TYPE);
writer.WriteAttributeString("macroName", MacroName);
writer.WriteAttributeString("value", MacroValue.ToString());
}

public override void execute(FSUIPC.FSUIPCCacheInterface cache, MobiFlightCacheInterface moduleCache)
{
if (MacroName == "") return;

Log.Instance.log("LuaMacoInputAction:Execute : Calling macro " + MacroName, LogSeverity.Debug);
cache.executeMacro(MacroName, MacroValue);
}
}
}
2019-12-14 20:26
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Check this short posting for syntax notes.

https://www.mobiflight.com/forum/message/10232.html

Apology for missing guide..... In case no "beginners" need this stuff and the pro users still know themself how to work with it there was no needness until now for a guide.
I personlaly not use it myself till now so i not start to write a guide and i also not have won experience with it.
Good Luck !
2019-12-17 03:51
icon