Fragtality Posted 12 hours ago Author Report Posted 12 hours ago 6 hours ago, GASimPilot said: Thanks for the reply. I have been trying to get the lua scripting working, and I cannot figure out how to read "A:PLANE HEADING DEGREES MAGNETIC" successfully. It always comes back 0. Here is my script. It does write the 0 correctly to the Heading Bug. If you could point me to my error, I would greatly appreciate it. SimVar("A:PLANE HEADING DEGREES MAGNETIC") SimVar("K:HEADING_BUG_SET") function PFD_HDG_SYNC() local curhdg = SimRead("A:PLANE HEADING DEGREES MAGNETIC") SimCommand("K:HEADING_BUG_SET:" .. curhdg) end You're close ;D The Variable Syntax is the Same as used in the Actions, so it should be: SimVar("(A:PLANE HEADING DEGREES MAGNETIC, Degrees)") SimRead("(A:PLANE HEADING DEGREES MAGNETIC, Degrees)") What eventually could be an Issue is the Concatenation when the Value returned is not an Integer/whole Number. Maybe print the resulting Command to the lua.log to analyze if the Result is correct Log("K:HEADING_BUG_SET:" .. curhdg)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now