You are right in that I had not realised that the figures are in screen pixels.
I run FSX in windowed mode on a 1920*1080 monitor. So, I corrected the script as follows:
function logvs(off, val)
if val ~= 0 then
-- if on ground flag just set, get VS, convert it and log it
vs = ipc.readSD(0x030C)
vs = vs * 60 * 3.28084 / 256
ipc.log("Vertical speed at touchdown = " .. vs)
gs, tas, ias = ipc.readStruct(0x02B4, "3UD")
ias = ias / 128
ipc.log("IAS at touchdown = " .. ias)
ipc.display ("Vertical speed at touchdown = " .. vs.."\nIAS at TD ="..ias)
ipc.setdisplay(240, 240, 226, 112)
end
end
-- set to call above routine whenever "on ground" flag changes
event.offset(0x0366, "UW", "logvs")
I tried different numbers and different positions within the script of ipc.setdisplay with no luck; still the LuaWindow pops up at the default position at the center of the windscreen.
The .ini file records the following if that helps:
[Window.LUA display]
Docked=7413, 3273, 3537, 2435
Undocked=875, 874, 250, 110