Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Lua error SLX_G1000.lua

Featured Replies

Helo Maarten,

 

There's some coding error in SL_G1000.lua in line 26 (missing bracket ')' ):

 

-- "Slave Server" example LUA plug-in, by Pete Dowson, October 2009
-- To make the Server FS act as a slave, following the Client FS acting as Master
 
-- The SOCKET module is built into FSUIPC, but is not active until "required"
local socket = require("socket")
 
-- Set the host name to the name of the PC running this Server
local host = "localhost"
 
-- The port must match the port selected in the client and not clash with others.
local port = "34568"
 
 
local function processdata(data)
-- decode string, format is lvarname,lvarvalue,isstring (0 or 1)
local index1 = 1
local index2 = string.find(data, ",")
local lvarname = string.sub(data, index1, index2 - 1)
index1 = index2 + 1
index2 = string.find(data, ",", index1)
local lvarvalue = string.sub(data, index1, index2 - 1)
local lvarisstring = string.sub(data, index2 + 1)
 
if lvarisstring == "1" then
for i = 1, 6 do
if (string.len(lvarvalue) >= i then             ////here exactly - error when parsing///
ipc.writeLvar("SLX_StringValue" .. i, string.byte(lvarvalue, i)
else
ipc.writeLvar("SLX_StringValue" .. i, 0)
end
end
else
ipc.writeLvar("SLX_" .. lvarname, tonumber(lvarvalue))
end
ipc.writeLvar("SLX_" .. lvarname .. "_Set", 1)
end
 
local server = assert(socket.bind(host, port))
local ack = "<EOF>"
while 1 do
    print("slx_fs9gps_server: waiting for client connection...")
    local control
if (server ~= nil)
control = server:accept()
else
control = nil
    if control ~= nil then
print("slx_fs9gps_server: client connected!")
while 1 do 
local data = control:receive()
if data == nil then
print("slx_fs9gps_server: client disconnected")
-- ipc.control(65794) -- Pause FS
break
end
else
local index = string.find(data, "<EOF>")
if index ~= nill then 
data = string.sub(data, 1, index - 1)
if data == "ping" then
assert(control:send("ping<EOF>"))
else
assert(control:send(ack))      
processdata(data)
end
end
end
end
    end
end
 

Best wishes,

Darek

 

Czarnecki Dariusz

yeEIP.gifBoeing777_Banner_Pilot.jpg

Hi Darek,

 

Well spotted! Fortunately this .lua file is not yet used. Some GPS variables are missing in the SimConnect API and I will use this .lua file (together with the SLX_G1000.CAB gauge) to workaround this issue when I have made some more progress with the implementation of the G1000 PFD and MFD.

 

thanks, Maarten

Maarten Boelens ([m][a:][R][t][ʏ][n])
Developer of SimLauncherX

ftx_supporter_avsim.gifC172Siggy1_zps11944daf.jpg

  • Author

Sounds clear for me :)

 

You're doing a fantastic job. Thanks for Your tremendous work, I really appreciate that a lot.

 

All the best,

Darek 

Czarnecki Dariusz

yeEIP.gifBoeing777_Banner_Pilot.jpg

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.