Jump to content
The simFlight Network Forums

Kees69

Members
  • Posts

    12
  • Joined

  • Last visited

Everything posted by Kees69

  1. Hi John, I have now programmed the entire overhead and this is the complete list, more than 250 lines. With this script it sometimes took 5 to 6 seconds before a light in my overhead panel came on. I have now divided this LUA script over 10 LUA scripts and included them in FSUIPC.ini and the lights respond within 1 second. However, the option you propose with the event.lvar seems to me to be a better option. In the near future I will see if I can rewrite my script in the way you suggested. Thanks for your comment! Kees function checkOverhead() --Check lights overhead ipc.writeUB(0x4264, ipc.readLvar("L:O01_031_DG6")) ipc.writeUB(0x4265, ipc.readLvar("L:O01_031_DG5")) ipc.writeUB(0x4266, ipc.readLvar("L:O01_031_DG4")) ipc.writeUB(0x4267, ipc.readLvar("L:O01_031_DG3")) ipc.writeUB(0x4268, ipc.readLvar("L:O01_031_DG2")) ipc.writeUB(0x4269, ipc.readLvar("L:O01_031_DG1")) ipc.writeUB(0x426A, ipc.readLvar("L:O01_032_DG7")) ipc.writeUB(0x426B, ipc.readLvar("L:O01_032_DG6")) ipc.writeUB(0x426C, ipc.readLvar("L:O01_032_DG5")) ipc.writeUB(0x426D, ipc.readLvar("L:O01_032_DG4")) ipc.writeUB(0x426E, ipc.readLvar("L:O01_032_DG3")) ipc.writeUB(0x426F, ipc.readLvar("L:O01_032_DG2")) ipc.writeUB(0x4270, ipc.readLvar("L:O01_032_DG1")) ipc.writeUB(0x428D, ipc.readLvar("L:O01_016_LT0")) ipc.writeUB(0x428E, ipc.readLvar("L:O01_017_LT0")) ipc.writeUB(0x428F, ipc.readLvar("L:O01_018_LT0")) ipc.writeUB(0x4290, ipc.readLvar("L:O01_019_LT0")) ipc.writeUB(0x4291, ipc.readLvar("L:O01_020_LT0")) ipc.writeUB(0x4292, ipc.readLvar("L:O01_021_LT0")) ipc.writeUB(0x4293, ipc.readLvar("L:O01_022_LT0")) ipc.writeUB(0x4294, ipc.readLvar("L:O01_023_LT0")) ipc.writeUB(0x4295, ipc.readLvar("L:O01_024_LT0")) ipc.writeUB(0x4296, ipc.readLvar("L:O01_025_LT0")) ipc.writeUB(0x4297, ipc.readLvar("L:O01_026_LT0")) ipc.writeUB(0x4298, ipc.readLvar("L:O01_027_LT0")) ipc.writeUB(0x4260, ipc.readLvar("L:O02_002_BUT")) ipc.writeUB(0x4261, ipc.readLvar("L:O02_002_LT2")) ipc.writeUB(0x4262, ipc.readLvar("L:O02_001_BUT")) ipc.writeUB(0x4263, ipc.readLvar("L:O02_001_LT2")) ipc.writeUB(0x4271, ipc.readLvar("L:O03_001_BUT")) ipc.writeUB(0x4272, ipc.readLvar("L:O03_001_LT2")) ipc.writeUB(0x4273, ipc.readLvar("L:O03_002_BUT")) ipc.writeUB(0x4274, ipc.readLvar("L:O03_002_LT2")) ipc.writeUB(0x4275, ipc.readLvar("L:O04_001_LT0")) ipc.writeUB(0x4276, ipc.readLvar("L:O04_002_LT0")) ipc.writeUB(0x4277, ipc.readLvar("L:O04_003_LT0")) ipc.writeUB(0x4278, ipc.readLvar("L:O04_004_LT0")) ipc.writeUB(0x4279, ipc.readLvar("L:O04_005_LT0")) ipc.writeUB(0x427A, ipc.readLvar("L:O04_006_LT0")) ipc.writeUB(0x427B, ipc.readLvar("L:O04_007_BUT")) ipc.writeUB(0x427C, ipc.readLvar("L:O04_008_BUT")) ipc.writeUB(0x427D, ipc.readLvar("L:O04_009_BUT")) ipc.writeUB(0x427E, ipc.readLvar("L:O04_010_BUT")) ipc.writeUB(0x427F, ipc.readLvar("L:O04_007_LT2")) ipc.writeUB(0x4280, ipc.readLvar("L:O04_008_LT2")) ipc.writeUB(0x4281, ipc.readLvar("L:O04_009_LT2")) ipc.writeUB(0x4282, ipc.readLvar("L:O04_010_LT2")) ipc.writeUB(0x4283, ipc.readLvar("L:O04_011_LT0")) ipc.writeUB(0x4284, ipc.readLvar("L:O04_012_LT0")) ipc.writeUB(0x4285, ipc.readLvar("L:O04_013_LT0")) ipc.writeUB(0x4286, ipc.readLvar("L:O04_014_LT0")) ipc.writeUB(0x4287, ipc.readLvar("L:O04_015_LT0")) ipc.writeUB(0x4288, ipc.readLvar("L:O04_016_LT0")) ipc.writeUB(0x4289, ipc.readLvar("L:O04_017_LT0")) ipc.writeUB(0x428A, ipc.readLvar("L:O04_018_LT0")) ipc.writeUB(0x428B, ipc.readLvar("L:O04_019_LT0")) ipc.writeUB(0x428C, ipc.readLvar("L:O04_020_LT0")) ipc.writeUB(0xA000, ipc.readLvar("L:O06_001_LT0")) ipc.writeUB(0xA001, ipc.readLvar("L:O06_002_LT0")) ipc.writeUB(0xA002, ipc.readLvar("L:O06_003_LT0")) ipc.writeUB(0xA003, ipc.readLvar("L:O06_004_LT0")) ipc.writeUB(0xA004, ipc.readLvar("L:O06_005_LT0")) ipc.writeUB(0xA005, ipc.readLvar("L:O06_006_LT0")) ipc.writeUB(0xA006, ipc.readLvar("L:O06_007_LT0")) ipc.writeUB(0xA007, ipc.readLvar("L:O06_008_LT0")) ipc.writeUB(0xA008, ipc.readLvar("L:O06_009_LT0")) ipc.writeUB(0xA009, ipc.readLvar("L:O06_010_LT0")) ipc.writeUB(0xA00A, ipc.readLvar("L:O06_011_LT0")) ipc.writeUB(0xA00B, ipc.readLvar("L:O06_012_LT0")) ipc.writeUB(0xA00C, ipc.readLvar("L:O06_013_LT0")) ipc.writeUB(0xA00D, ipc.readLvar("L:O06_014_LT0")) ipc.writeUB(0xA00E, ipc.readLvar("L:O06_016_LT0")) ipc.writeUB(0xA00F, ipc.readLvar("L:O06_017_LT0")) ipc.writeUB(0xA010, ipc.readLvar("L:O06_018_LT0")) ipc.writeUB(0xA011, ipc.readLvar("L:O06_019_LT0")) ipc.writeUB(0xA012, ipc.readLvar("L:O08_001_BUT")) ipc.writeUB(0xA013, ipc.readLvar("L:O08_001_LT2")) ipc.writeUB(0xA014, ipc.readLvar("L:O08_003_LT0")) ipc.writeUB(0xA015, ipc.readLvar("L:O08_004_LT0")) ipc.writeUB(0xA016, ipc.readLvar("L:O09_001_BUT")) ipc.writeUB(0xA017, ipc.readLvar("L:O09_002_BUT")) ipc.writeUB(0xA018, ipc.readLvar("L:O09_003_BUT")) ipc.writeUB(0xA019, ipc.readLvar("L:O09_004_BUT")) ipc.writeUB(0xA01A, ipc.readLvar("L:O09_001_LT2")) ipc.writeUB(0xA01B, ipc.readLvar("L:O09_002_LT2")) ipc.writeUB(0xA01C, ipc.readLvar("L:O09_003_LT2")) ipc.writeUB(0xA01D, ipc.readLvar("L:O09_004_LT2")) ipc.writeUB(0xA01E, ipc.readLvar("L:O09_006_BUT")) ipc.writeUB(0xA01F, ipc.readLvar("L:O09_007_BUT")) ipc.writeUB(0xA020, ipc.readLvar("L:O09_010_BUT")) ipc.writeUB(0xA021, ipc.readLvar("L:O09_011_BUT")) ipc.writeUB(0xA022, ipc.readLvar("L:O09_006_LT2")) ipc.writeUB(0xA023, ipc.readLvar("L:O09_007_LT2")) ipc.writeUB(0xA024, ipc.readLvar("L:O09_010_LT2")) ipc.writeUB(0xA025, ipc.readLvar("L:O09_011_LT2")) ipc.writeUB(0xA026, ipc.readLvar("L:O09_005_LT0")) ipc.writeUB(0xA027, ipc.readLvar("L:O09_008_LT0")) ipc.writeUB(0xA028, ipc.readLvar("L:O09_009_BUT")) ipc.writeUB(0xA029, ipc.readLvar("L:O09_012_BUT")) ipc.writeUB(0xA02A, ipc.readLvar("L:O09_009_LT2")) ipc.writeUB(0xA02B, ipc.readLvar("L:O09_012_LT2")) ipc.writeUB(0xA02C, ipc.readLvar("L:O10_001_LT0")) ipc.writeUB(0xA02D, ipc.readLvar("L:O10_002_LT0")) ipc.writeUB(0xA02E, ipc.readLvar("L:O12_005_BUT")) ipc.writeUB(0xA02F, ipc.readLvar("L:O12_005_LT2")) ipc.writeUB(0xA030, ipc.readLvar("L:O13_002_LT0")) ipc.writeUB(0xA031, ipc.readLvar("L:O13_003_BUT")) ipc.writeUB(0xA032, ipc.readLvar("L:O13_003_LT2")) ipc.writeUB(0xA033, ipc.readLvar("L:O15_001_LT1")) ipc.writeUB(0xA034, ipc.readLvar("L:O15_001_LT2")) ipc.writeUB(0xA035, ipc.readLvar("L:O15_002_LT0")) ipc.writeUB(0xA036, ipc.readLvar("L:O15_003_LT0")) ipc.writeUB(0xA037, ipc.readLvar("L:O33_001_BUT")) ipc.writeUB(0xA038, ipc.readLvar("L:O33_001_LT2")) ipc.writeUB(0xA039, ipc.readLvar("L:O33_002_BUT")) ipc.writeUB(0xA03A, ipc.readLvar("L:O33_002_LT2")) ipc.writeUB(0xA03B, ipc.readLvar("L:O33_003_LT0")) ipc.writeUB(0xA03C, ipc.readLvar("L:O16_001_BUT")) ipc.writeUB(0xA03D, ipc.readLvar("L:O16_001_LT2")) ipc.writeUB(0xA03E, ipc.readLvar("L:O16_002_BUT")) ipc.writeUB(0xA03F, ipc.readLvar("L:O16_002_LT2")) ipc.writeUB(0xA040, ipc.readLvar("L:O16_003_BUT")) ipc.writeUB(0xA041, ipc.readLvar("L:O16_003_LT2")) ipc.writeUB(0xA042, ipc.readLvar("L:O16_004_BUT")) ipc.writeUB(0xA043, ipc.readLvar("L:O16_004_LT2")) ipc.writeUB(0xA044, ipc.readLvar("L:O16_005_LT0")) ipc.writeUB(0xA045, ipc.readLvar("L:O16_006_BUT")) ipc.writeUB(0xA046, ipc.readLvar("L:O16_006_LT2")) ipc.writeUB(0xA047, ipc.readLvar("L:O16_007_BUT")) ipc.writeUB(0xA048, ipc.readLvar("L:O16_007_LT2")) ipc.writeUB(0xA049, ipc.readLvar("L:O16_008_BUT")) ipc.writeUB(0xA04A, ipc.readLvar("L:O16_008_LT2")) ipc.writeUD(0xA060, ipc.readLvar("L:O17_001_IND")) ipc.writeUD(0xA064, ipc.readLvar("L:O17_002_IND")) ipc.writeUD(0xA068, ipc.readLvar("L:O17_003_IND")) ipc.writeUB(0xA06C, ipc.readLvar("L:O17_004_IND")) ipc.writeUD(0xA070, ipc.readLvar("L:O17_005_IND")) ipc.writeUB(0xA050, ipc.readLvar("L:O18_001_BUT")) ipc.writeUB(0xA051, ipc.readLvar("L:O18_001_LT2")) ipc.writeUB(0xA052, ipc.readLvar("L:O18_002_BUT")) ipc.writeUB(0xA053, ipc.readLvar("L:O18_002_LT2")) ipc.writeUB(0xA054, ipc.readLvar("L:O18_003_BUT")) ipc.writeUB(0xA055, ipc.readLvar("L:O18_003_LT2")) ipc.writeUB(0xA056, ipc.readLvar("L:O18_004_LT0")) ipc.writeUB(0xA057, ipc.readLvar("L:O18_005_LT0")) ipc.writeUB(0xA058, ipc.readLvar("L:O20_001_BUT")) ipc.writeUB(0xA059, ipc.readLvar("L:O20_001_LT2")) ipc.writeUB(0xA05A, ipc.readLvar("L:O20_002_BUT")) ipc.writeUB(0xA05B, ipc.readLvar("L:O20_002_LT2")) ipc.writeUB(0xA05C, ipc.readLvar("L:O20_003_BUT")) ipc.writeUB(0xA05D, ipc.readLvar("L:O20_003_LT2")) ipc.writeUB(0xA05E, ipc.readLvar("L:O20_003_BUT")) ipc.writeUB(0xA05F, ipc.readLvar("L:O20_003_LT2")) ipc.writeUB(0xA060, ipc.readLvar("L:O14_001_BUT")) ipc.writeUB(0xA061, ipc.readLvar("L:O14_001_LT2")) ipc.writeUB(0xA062, ipc.readLvar("L:O14_002_BUT")) ipc.writeUB(0xA063, ipc.readLvar("L:O14_002_LT2")) ipc.writeUB(0xA064, ipc.readLvar("L:O14_003_BUT")) ipc.writeUB(0xA065, ipc.readLvar("L:O14_003_LT2")) ipc.writeUB(0xA066, ipc.readLvar("L:O14_004_BUT")) ipc.writeUB(0xA067, ipc.readLvar("L:O14_004_LT2")) ipc.writeUB(0xA068, ipc.readLvar("L:O21_001_BUT")) ipc.writeUB(0xA069, ipc.readLvar("L:O21_002_BUT")) ipc.writeUB(0xA06A, ipc.readLvar("L:O21_003_BUT")) ipc.writeUB(0xA06B, ipc.readLvar("L:O21_004_BUT")) ipc.writeUB(0xA06C, ipc.readLvar("L:O21_005_BUT")) ipc.writeUB(0xA06D, ipc.readLvar("L:O21_006_BUT")) ipc.writeUB(0xA06E, ipc.readLvar("L:O21_007_BUT")) ipc.writeUB(0xA06F, ipc.readLvar("L:O21_008_BUT")) ipc.writeUB(0xA070, ipc.readLvar("L:O21_009_BUT")) ipc.writeUB(0xA071, ipc.readLvar("L:O21_010_BUT")) ipc.writeUB(0xA072, ipc.readLvar("L:O21_011_BUT")) ipc.writeUB(0xA073, ipc.readLvar("L:O23_005_LT0")) ipc.writeUW(0xA086, ipc.readLvar("L:O23_004_IND")) ipc.writeUB(0xA074, ipc.readLvar("L:O25_001_LT0")) ipc.writeUB(0xA075, ipc.readLvar("L:O25_002_LT0")) ipc.writeUB(0xA076, ipc.readLvar("L:O25_004_LT0")) ipc.writeUB(0xA077, ipc.readLvar("L:O25_005_LT0")) ipc.writeUB(0xA078, ipc.readLvar("L:O25_006_LT0")) ipc.writeUB(0xA079, ipc.readLvar("L:O26_004_BUT")) ipc.writeUB(0xA07A, ipc.readLvar("L:O26_004_LT2")) ipc.writeUB(0xA07B, ipc.readLvar("L:O26_005_LT0")) ipc.writeUB(0xA07C, ipc.readLvar("L:O26_006_LT0")) ipc.writeUB(0xA07D, ipc.readLvar("L:O34_001_BUT")) ipc.writeUB(0xA07E, ipc.readLvar("L:O34_001_LT2")) ipc.writeUB(0xA07F, ipc.readLvar("L:O34_002_BUT")) ipc.writeUB(0xA080, ipc.readLvar("L:O34_002_LT2")) ipc.writeUB(0xA081, ipc.readLvar("L:O34_003_BUT")) ipc.writeUB(0xA082, ipc.readLvar("L:O34_003_LT2")) ipc.writeUB(0xA083, ipc.readLvar("L:O27_001_IND")) ipc.writeUB(0xA084, ipc.readLvar("L:O27_002_IND")) ipc.writeUB(0xA085, ipc.readLvar("L:O27_003_IND")) ipc.writeUB(0xA08A, ipc.readLvar("L:O28_001_LT0")) ipc.writeUB(0xA08B, ipc.readLvar("L:O28_002_LT0")) ipc.writeUB(0xA08C, ipc.readLvar("L:O28_003_LT0")) ipc.writeUB(0xA08D, ipc.readLvar("L:O28_007_BUT")) ipc.writeUB(0xA08E, ipc.readLvar("L:O28_007_LT2")) ipc.writeUB(0xA08F, ipc.readLvar("L:O28_008_BUT")) ipc.writeUB(0xA090, ipc.readLvar("L:O28_008_LT2")) ipc.writeUB(0xA091, ipc.readLvar("L:O28_009_BUT")) ipc.writeUB(0xA092, ipc.readLvar("L:O28_009_LT2")) ipc.writeUB(0xA093, ipc.readLvar("L:O28_010_BUT")) ipc.writeUB(0xA094, ipc.readLvar("L:O28_010_LT2")) ipc.writeUB(0xA095, ipc.readLvar("L:O28_011_BUT")) ipc.writeUB(0xA096, ipc.readLvar("L:O28_011_LT2")) ipc.writeUB(0xA097, ipc.readLvar("L:O28_014_LT0")) ipc.writeUB(0xA098, ipc.readLvar("L:O29_012_BUT")) ipc.writeUB(0xA099, ipc.readLvar("L:O29_012_LT2")) ipc.writeUB(0xA09A, ipc.readLvar("L:O29_013_BUT")) ipc.writeUB(0xA09B, ipc.readLvar("L:O29_013_LT2")) ipc.writeUB(0xA09C, ipc.readLvar("L:O29_005_BUT")) ipc.writeUB(0xA09D, ipc.readLvar("L:O29_005_LT2")) ipc.writeUB(0xA09E, ipc.readLvar("L:O29_009_BUT")) ipc.writeUB(0xA09F, ipc.readLvar("L:O29_009_LT2")) ipc.writeUB(0xA0A0, ipc.readLvar("L:O29_010_BUT")) ipc.writeUB(0xA0A1, ipc.readLvar("L:O29_010_LT2")) ipc.writeUB(0xA0A2, ipc.readLvar("L:O29_011_BUT")) ipc.writeUB(0xA0A3, ipc.readLvar("L:O29_011_LT2")) ipc.writeUB(0xA0A4, ipc.readLvar("L:O29_002_LT0")) ipc.writeUB(0xA0A5, ipc.readLvar("L:O29_003_LT0")) ipc.writeUB(0xA0A6, ipc.readLvar("L:O29_004_LT0")) ipc.writeUB(0xA0A7, ipc.readLvar("L:O29_006_LT0")) ipc.writeUB(0xA0A8, ipc.readLvar("L:O29_007_LT0")) ipc.writeUB(0xA0A9, ipc.readLvar("L:O29_008_LT0")) ipc.writeUB(0xA0AA, ipc.readLvar("L:O29_014_LT0")) ipc.writeUB(0xA0AB, ipc.readLvar("L:O30_001_LT0")) end event.timer(100, "checkOverhead") FSUIPC.ini: [Programs] [LuaFiles] 1=76_lua_lights_mip 2=76_lua_lights_mcp 3=76_offset 4=76_lua_overhead1 5=76_lua_overhead2 6=76_lua_overhead3 7=76_lua_overhead4 8=76_lua_overhead5 9=76_lua_overhead1a 10=76_lua_overhead2a 11=76_lua_overhead3a 12=76_lua_overhead4a 13=76_lua_overhead5a [Auto] 1=Lua 76_lua_display 2=Lua 76_lua_lights 3=Lua 76_lua_lights_mip 4=Lua 76_lua_lights_mcp 5=LUA 76_offset 6=lua 76_lua_overhead1 7=lua 76_lua_overhead2 8=lua 76_lua_overhead3 9=lua 76_lua_overhead4 10=lua 76_lua_overhead5 11=lua 76_lua_overhead1a 12=lua 76_lua_overhead2a 13=lua 76_lua_overhead3a 14=lua 76_lua_overhead4a 15=lua 76_lua_overhead5a
  2. Hi, To light the LEDs in my home-built overhead for the 767, I write the values of the LVARs to a free FSUIPC offset. I do that in the following way: function checkOverhead() --Check lights overhead ipc.writeUB(0x4251, ipc.readLvar("L:O16_001_BUT")) ipc.writeUB(0x4252, ipc.readLvar("L:O16_001_LT2")) ipc.writeUB(0x4253, ipc.readLvar("L:O16_002_BUT")) ipc.writeUB(0x4254, ipc.readLvar("L:O16_002_LT2")) ipc.writeUB(0x4255, ipc.readLvar("L:O16_003_BUT")) ipc.writeUB(0x4256, ipc.readLvar("L:O16_003_LT2")) ipc.writeUB(0x4257, ipc.readLvar("L:O16_004_BUT")) end event.timer(100, "checkOverhead") However, the list is getting longer (almost 200 outputs/LEDs), so it sometimes takes a long time (1 to 2 seconds) before the script checks whether a light is on and then turns on the corresponding LED in my overhead. Is there a way to make this work faster? I am using Captain Sim 767, with P3D and FSUIPC6. Thanks! Kees
  3. Hi Paul, Thanks for your reply. I only now realize that I actually posted the message in the wrong forum. I had seen this function before, but it would be quite a job, because I would have to program about 200 different functions (one for each output). I was hoping there would be an easier solution. I will also try it in John's forum. Thx, Kees
  4. Hi, To light the LEDs in my home-built overhead for the 767, I write the values of the LVARs to a free FSUIPC offset. I do that in the following way: function checkOverhead() --Check lights overhead ipc.writeUB(0x4251, ipc.readLvar("L:O16_001_BUT")) ipc.writeUB(0x4252, ipc.readLvar("L:O16_001_LT2")) ipc.writeUB(0x4253, ipc.readLvar("L:O16_002_BUT")) ipc.writeUB(0x4254, ipc.readLvar("L:O16_002_LT2")) ipc.writeUB(0x4255, ipc.readLvar("L:O16_003_BUT")) ipc.writeUB(0x4256, ipc.readLvar("L:O16_003_LT2")) ipc.writeUB(0x4257, ipc.readLvar("L:O16_004_BUT")) end event.timer(100, "checkOverhead") However, the list is getting longer (almost 200 outputs/LEDs), so it sometimes takes a long time (1 to 2 seconds) before the script checks whether a light is on and then turns on the corresponding LED in my overhead. Is there a way to make this work faster? I am using Captain Sim 767, with P3D and FSUIPC6. Thanks! Kees
  5. Indeed, I still had version 6.0.3. Now I updated to version 6.1.8 and see now that in the documentation the offsets beginning at 0x4200 are reserved. OK I will spend again a few hours programming to correct the offsets 🙂. But again I learned something.... Look much often for updates...
  6. That offset area is also reserved Are you sure? In the manual of FSUIPC6 I read that the offsets from 0x4200 (size 256) are free for general use. See this screenshot: Screenshot Kees
  7. Hi John and Reinhard, I just spent a few hours reprogramming my script. I have now done it as Reinhard had indicated. In addition, I divided the script into 3 lua files. In the old script of mine, lua took about 5.5 seconds to complete the script. Now every script only needs between 1.2 and 1.5 seconds. So a very nice gain of time and the lights now react clearly with less delay. I now use the offsets starting at 0x4200. Thanks for your help! Kees
  8. Hi Reinhard, I understand your modified script and that is indeed a lot simpler and therefore much clearer. I had some programming experience in the past (Visual Basic and Php), but was unfamiliar with Lua. And with some trial and error I made that script and since it worked anyway, I left it that way. I knew that I skipped all offsets with A through F. However, that was a bit easier for programming with the loops. As I mentioned in my answer to John above, I'm going to rewrite my script with your tips and then use the correct offsets right away. Thanks for taking the timeto simplify my script. Kind regards, Kees
  9. Hi Reinhard, I understand your modified script and that is indeed a lot simpler and therefore much clearer. I had some programming experience in the past (Visual Basic and Php), but was unfamiliar with Lua. And with some trial and error I made that script and since it worked anyway, I left it that way. I knew that I skipped all offsets with A through F. However, that was a bit easier for programming with the loops. As I mentioned in my answer to John above, I'm going to rewrite my script with your tips and then use the correct offsets right away. Thanks for taking the timeto simplify my script. Kind regards, Kees
  10. Yes I understand. And with the simplified script that Reinhard posted above, I will also adjust the offsets and use the ofssets for general use. Look, I've learned something new. 😉 Thanks, Kees
  11. John, Thank you for your fast reply. The lua files are indeed started from the Auto section: [Auto] 1=Lua 76_lua_display 2=Lua 76_lua_lights I have now set it to 100 ms, but there is no significant performance change. Thanks for the tip of debugging. I now see that the total script needs about 5.5 seconds to fully execute. And yes, it is because of reading all those Lvars. A second Lua script that is running and reads the displays in the MCP is much quicker. And needs only 0.4 seconds to fully execute. Is it an idea to divide the script over several scripts? I used the because I saw in the documentation that they were reserved and at thios moment not used. I didn't see the PMDG file with the ofssets for the PMDG. But I don't use PMDG (and think will never use it). So for now it is ok. But you are right, maybe it is better to use the once for general use. When I have some time, I will rewrite the code. Kind regards, Kees
  12. First I am a very beginner in programming in LUA. I have made a script for my Captain sim 767. That script reads the Lvars from different lights, to see their status. And writes them to some FSUIPC offsets. This script is attached to this topic. In the script there is a function for checking these lights. At the end of the script there is a event.timer to restart the function every 1 ms. But when I execute the script and a light in p3D turns on, sometimes it lastst till 2 seconds before the light turns on in my homecockpit. Am I right that this delay is caused by the time that the length of the script needs to fully execute? If so, what can I do to speed it up? Thanks in advance. Kees 76_lua_lights.lua
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.