Jump to content
The simFlight Network Forums

prokopiu

Members
  • Posts

    40
  • Joined

  • Last visited

Everything posted by prokopiu

  1. Hi, Pete is right - the NGX CDU can be driven by a combination of controls. You cannot assign this directly but make use of lua scripting and you can assign. Either make a lua for every key (not a good idea) or use my script in the contribution section - (which you should have already, Gerard). Hopefully LINDA will eventually support CDU I or II as a device - at the moment I have a hack but don't want to publish this as it messes in the LINDA system files and I don't want to support people to get that right. Basically the NGX CDU can be addressed in LUA with the sequence of: function key_press(icode) ipc.control(icode,4194304) ipc.sleep(1) ipc.control(icode,131072) ipc.sleep(1) ipc.control(icode,536870912) end and then for example: function MN_LEGS_press() key_press(70184) end There is a code for every key. Kosta
  2. Hi, I have my CDU I connected and do the following: a function to press the key: function key_press(icode) ipc.control(icode,4194304) ipc.sleep(1) ipc.control(icode,131072) ipc.sleep(1) ipc.control(icode,536870912) end And then the individual keys code with your method: if ipcPARAM == 101 then key_press(70166) elseif ... Hope that help Kosta
  3. Hi, I guess The Ghost is using the FSUIPC Exporter of Eric Marciano which is the only way to export FSUIPC offsets from Wilco Airbusses (I have that as well). It costs money though and only has 5 or 10 minutes before it stops working if you have not payed Eric and received a license code in return. Kosta
  4. Here are some more scripts for the CDU. These ones need FSUIPC macro files also placed in the modules folder of FS. Take away all the .txt endings for the stuff to work. If you want to change the macro filename because you have one already then change the filename and edit the corresponding XXX_CDU.lua replacing all XXX: with NEW: in the ipc.macro() calls. * ISG_CDU for Ernie Alstone's great Integrated Simvionics Gauges (the Boeing CDU Gauge - and I now I mistyped the macro name) * ATR_CDU with the great Flight 1 ATR 72 which is still my favourite Turbo Prop (tha macro file contains much more then needed - also used for MCP Combo though not finished yet) Kosta ATR.MCRO.txt ATR_CDU.lua.txt ISG_CDU.lua.txt IGS.MCRO.txt
  5. Hi, I recently bought myself the VRInsight CDU I (no screen) and as usual with SerialFP2 you hit these limitations with certain aircraft or things like vasFMC. So, I created the same solution which I have already used for my VRi MCP Combo for the CDU I. Chances are that the CDU II (the one with screen) uses the same codes and therefore the solution could work here as well. If someone tries and succeeds please let me know. I attach a description and some sample Luas for you guys to try. Remove the .txt ending and place in the modules folder. The CDU_Lua_general is just a skeleton for you to fill with your own scripting. Kosta AirbusX_CDU.lua.txt CDU_Lua_general.lua.txt Fokker_CDU.lua.txt VRInsight_CDU_and_FSUIPC_V10.pdf
  6. Hi, a couple of months later and I have actually moved to the next level thanks to a simmer/programmer called Artem Crum. He developed LINDA which is a great way of assigning those Lua scripts one has found with a Joystick or the MCP Combo. I helped testing it and also created a profile for one of the planes /more are actually in the queue but I had not yet time enough to test them). Some of what I explained here applies in LINDA as well and if you cannot find your addon in the ever growing list of supported planes then you can use that great editor in LINDA and creat your own scripts. See http://fs-linda.com/ for more. Kosta
  7. Hi Jose, I don't have Go-Flight MCP but the VRInsight MCP Combo but I use it to control vasFMC 2.1 via Lua (actually it is the new tool LINDA I use which unfortunately does not yet support GoFlight hardware). vasFMC 2.1 has now FSUIPC offsets (see documentation) and with these offsets you can trigger changes in the A/P settings or EFIS. With the GoFlight Lua library you can interface with your hardware. The rest is something like: handle event from GoFlight write appropriate value to the vasFMC offset e.g. To toggle the Flight Director in vasFMC use ipc.writeUB(0x6dd5,22) Kosta
  8. Hi, for one - there is a way to connect the VRInsight Combo with FSX without SerialFP or VSPE only based on registered FSUIPC. I use this with practically all my airplanes. see here I do not have the Beech Duchess and can therefore not give you a ready to go solution but when I add a new airplane which is not all standard FSX I do a couple of "investigations" to figure out how to connect the MCP to it. The ideal case is that there are FSUIPC offsets defined - either the standard FSX ones or in some cases special ones. Not quite so ideal but still easy enough is that the aircraft and the panels use XML coding and expose a number of L: variables which can be used. You usually find a .cab file for gauges in that case. The AirbusX is such a plane - normal macro recording does not work here. Most PMDG airplanes use a mix of custom controls and default FSUIPC offsets. For debugging I use a lua script which comes with FSUIPC that dumps L: variables, FSInterrogate is a tool to check FSUIPC offsets and the FSUIPC logging of events and controls is also a good source. Hope that helps Kosta
  9. Hi, I assume we are talking about the VRInsight MCP Combo, right? If so I have connected pretty much all my aircraft via Lua scripting. I do not have the QW757 but it seems you have quite nicely established some L:Vars to go with your aircraft. It appears that the way you use inc and dec on L:alt_sel_num makes increases of one. Another way to deal with this could be to have the MCP trigger the normal altitude change via FS controls. This probably does not update the QW757 LVar so you would have to transfer the current value in the respective FSUIPC offset to your LVar. For this you can use an event handler in a small lua file that would need to be started when your QW757 is started. The code could look like this (assuming the full altitude in feet is what needs to be put into the alt_sel_num variable: qw757alt.lua: (do not include the ===) ================ function setAPALT(offset, value) buffer = ipc.readUD(0x07D4)/65536*3.28 ipc.writeLvar("L:alt_sel_num", buffer) end event.offset(0x07D4, "UW", "setAPALT") ================= You have to put the file in the modules folder and use fsuipc.ini to start up or program a key or whatever else. It will continue running and every time you modify the AP altitude setting via keys, clicks or by having the MCP make the change it will trigger, retrieve the value and write it complete into the LVar. Now, I did this blindly - you might have to modify the logic to suite your aircraft. Hope it helps. [EDIT by Pete: I've corrected the Event call for you -- you'd left it as 7CC and setAPHDG for a heading setting] Kosta
  10. Hi Surfman, I am assuming that you set one key with Lua Loglvars and the other with LuaKill Loglvars. The instructions are correct and it works fine here. I think that the Wilco CRJ might NOT have ANY LVars and therefore the script stops again entirely on it's own since it makes no sense looping and detecting changes on non-existing variables. There is a simple way to test this, use a different plane like the B737-800 and if your red window appears you know that it works. The 2D 3D window makes NO difference. Kosta
  11. Hi Fouad, I use FSCONV to connect my VRInsight MCP hardware with the Level-D 767. The way FSCONV works with its regular scans of the Level-D components (of which it can do max. 12 parameters a second) could be the reason for the mismatch. I made sure that only the parameters I absolutely need for the MCP Combo are activated and I also read out once per second. Try optimizing FSCONV by turning off all the parameters except the one for the MESM selectors (save your current profile in FSCONV under a different name first so you can recover the current settings) and try again - using a higher frequency for scanning. If your engine selectors do work properly you have found the reason. GoFlight hardware or FSUIPC are probably not the reason. The Lua scripting is indeed an interesting option although you need some programming experience. There is a good support for GoFlight hardware with the gdf library offering scripted reading of GoFlight parameters. So, if optimizing FSCONV does not work, you could create a Lua script which reads the position of the switches on the MESM and makes sure that the Level-D get the same values... Kosta
  12. Next part is displaying A/P values and handling radios: The VRInsight MCP Combo has 2 displays, one in the middle with the Autopilot values (SPD, HDG, ALT) and on the right side the multi-purpose display for the radios. The content of the displays cannot be read by the Lua script - only changed by sending commands via the serial port to the MCP Combo. In order to keep MCP display and real values aligned you need to install an event handler for each value that triggers when the FSX value changes. The corresponding display is then updated by sending a command. The middle display: SPD*.... HDG* ALT* 999 .... 999 99999 You can change the following parts: Value Command ========================================= SPD value SPD999 (speed in kts) Top .... area DSP XXXX (XXXX being a 4 character text) Bottom .... DSP_XXXX HDG value HDG999 (heading 3 digit degree) ALT value ALT999 (altitude in thousands of feet) For many planes the standard FSX offsets work as a source for the values in Lua scripting: function setAPSPD(offset, value) buffer = ipc.readUW(0x07e2) com.write(dev, string.format("SPD%03d", buffer),8 ) end function setAPHDG(offset, value) buffer = ipc.readUW(0x07CC)/65536*360 com.write(dev, string.format("HDG%03d", buffer),8 ) end function setAPALT(offset, value) buffer = ipc.readUD(0x07D4)/65536*3.28/100 com.write(dev, string.format("ALT%03d", math.ceil(buffer)),8 ) end The Radio Panel display has two lines for displaying radio values and six mode buttons: [LINE 1 ] [LINE 2 ] [ ] [ ] [ ] [ ] [ ] COM NAV ADF DME TRN Commands to be used: Command Display ============================================ COMSEL1 COM1 frequencies COMSEL2 COM2 frequencies NAVSEL1 NAV1 frequencies NAVSEL2 NAV2 frequencies ADFSEL1 ADF1 frequency ADFSEL2 ADF2 frequency DMESEL1 Display DME1 dist/speed DMESEL2 Display DME2 dist/speed TRNSEL Transponder display COMs9999 Set COM1 standby freq 199.99 COMx9999 Set COM1 active frequeny 199.99 COMS9999 Set COM2 standby freq 199.99 COMX9999 Set COM2 active frequeny 199.99 NAVs9999 Set NAV1 standby freq 199.99 NAVx9999 Set NAV1 active frequeny 199.99 NAVS9999 Set NAV2 standby freq 199.99 NAVX9999 Set NAV2 active frequeny 199.99 ADF99999 Set selected ADF frequency to 9999.9 TRN9999 Set transponder display to 9999 DMiAAAA Set DME1 VOR name to AAAA DMEd9999 Set DME1 distance to 999.9 NM DMEs999 Set DME1 speed to 999 KT DMIAAAA Set DME2 VOR name to AAAA DMED9999 Set DME2 distance to 999.9 NM DMES999 Set DME2 speed to 999 KT In Lua scripting one needs to get these values from their respective FSUIPC offsets. Most planes use the FSX standard offsets so the code lines here work almost all the time: function setCOM1Radio(offset, value) buffer = ipc.readUW(0x034E) com.write(dev, string.format("COMx%04x", buffer),8 ) ipc.sleep(500) buffer = ipc.readUW(0x311A) com.write(dev, string.format("COMs%04x", buffer),8 ) end function setCOM2Radio(offset, value) buffer = ipc.readUW(0x3118) com.write(dev, string.format("COMX%04x", buffer),8 ) ipc.sleep(500) buffer = ipc.readUW(0x311C) com.write(dev, string.format("COMS%04x", buffer),8 ) end function setNAV1Radio(offset, value) buffer = ipc.readUW(0x0350) com.write(dev, string.format("NAVx%04x", buffer),8 ) ipc.sleep(500) buffer = ipc.readUW(0x311E) com.write(dev, string.format("NAVs%04x", buffer),8 ) end function setNAV2Radio(offset, value) buffer = ipc.readUW(0x0352) com.write(dev, string.format("NAVX%04x", buffer),8 ) ipc.sleep(500) buffer = ipc.readUW(0x3120) com.write(dev, string.format("NAVS%04x", buffer),8 ) end function setADF1Radio(offset, value) buffer = ipc.readUW(0x034C) buffer2 = ipc.readUW(0x0356) com.write(dev, string.format("adf%01x%03x%01x", buffer2/256, buffer, buffer2 % 0x0100),8 ) end function setADF2Radio(offset, value) buffer = ipc.readUW(0x02D4) buffer2 = ipc.readUW(0x02D6) com.write(dev, string.format("ADF%01x%03x%01x", buffer2/256, buffer, buffer2 % 0x0100),8 ) end function setTransponder(offset, value) buffer = ipc.readUW(0x0354) com.write(dev, string.format("TRN%04x", buffer),8 ) end In order to keep the displays updated and in synch, event listeners are added at the end of the lua script to be triggered whenever one of the offsets change. So when you or the FMC changes the NAV1 frequency, the event is recognized and the setNAV1Radio function is called. The events are declared like that: -- listen to changes of the Radions event.offset(0x034E, "UW", "setCOM1Radio") event.offset(0x311A, "UW", "setCOM1Radio") event.offset(0x3118, "UW", "setCOM2Radio") event.offset(0x311C, "UW", "setCOM2Radio") event.offset(0x0350, "UW", "setNAV1Radio") event.offset(0x311E, "UW", "setNAV1Radio") event.offset(0x0352, "UW", "setNAV2Radio") event.offset(0x3120, "UW", "setNAV2Radio") event.offset(0x034C, "UW", "setADF1Radio") event.offset(0x0356, "UW", "setADF1Radio") event.offset(0x02D4, "UW", "setADF2Radio") event.offset(0x02D6, "UW", "setADF2Radio") event.offset(0x0354, "UW", "setTransponder") To detect changes to the frequency entered in the MCP you need to detect the VRI event (the action code sent by the MCP) and react accordingly. Sample for COM1 and ADF2: -- detect the change of standby freq if string.match(str, "COMs(%d%d%d%d)") then comfreq = tonumber(string.match(str, "COMs(%d%d%d%d)"),16) ipc.writeUD(0x311a, comfreq) end -- detect the transfer of standby to active frequency if string.match(str, "COMx(%d%d%d%d)") then ipc.control(66372) end -- detect what ADF has been selected if str == "ADFSEL1" then ipc.set("adfsel",1) end -- detect what ADF has been selected if str == "ADFSEL2" then ipc.set("adfsel",2) end -- set ADF frequency based on two offsets if string.match(str, "ADF(%d%d%d%d%d)") then comfreq = tonumber("0x0" .. string.sub(str, 5,7), 16) adffreq = tonumber("0x0" .. string.sub(str, 4,4) .. "0" .. string.sub(str,8,8 ),16) if (ipc.get("adfsel") == 1) then ipc.writeUD(0x034C, comfreq) ipc.writeUD(0x0356, adffreq) else ipc.writeUD(0x02D4, comfreq) ipc.writeUD(0x02D6, adffreq) end end Kosta
  13. The next step with having the Lua script work with my MCP Combo is to be able to automatically start the appropriate Lua script for each individual airplane. There seem to be some ways to do this, the most flexible I found was to use Lua scripting again and facilitate the Lua macros (pretty much like you would when selecting something in the drop-downs for key or button assignments). In Lua there is the ipc.macro("name of macro") with which one can start, re-start or kill a running Lua script. Perfect for me. For example, having the Other_VRIH.lua file from my previous post I could start it by using the line: ipc.macro("Lua Other_VRIH") If I want to stop it because I would like to call another one (for another aircraft) I can use: ipc.macro("LuaKill Other_VRIH") In combination with the name of the currently loaded aircraft coming from the FSUIPC offset 0x3D00 I can start and switch VRInsight Handler Luas whenever I switch airplanes in FSX. Since the names of several variations (textures) of FSX planes usually start with the same text you can start the same lua script by providing the common part of the name (e.g. "Level D Simulations B767" covering all available types). I have my current version of the dispatcher Lua attached here. Make sure it gets started when FSX starts. It will take care of the rest then. Kosta LuaDispatcher.lua.txt
  14. Hi all, having a week off after Easter gave me some time to start a little project of documenting all the findings and results of me using FSUIPC and Lua scripting to connect all kinds of aircraft with my VRInsight MCP Combo. I found a way to do this without virtual serial ports or SerialFP and learnt an awfull lot on the way there. Time to document this in a growing topic. First installment is the setup of FSUIPC and VRInsight hardware to talk directly to each other. The attached PDF documents this approach and the text file is a sample for that kind of lua script I am talking about. In the coming days and weeks I will add more to this thread, also going into more details about individual planes from PMDG to Level-D and so forth for which I have collected quite some details about how to connect something like the MCP Combo to them. The knowledge here can also be applied to the Go-Flight MCP - you probably have to change some aspects of the scripts though as one connects differently to the Go-Glight stuff. Kosta VRInsight_MCP_and_FSUIPC_V10.pdf Other_VRIH.lua.txt
  15. Jorge, I am not sure how you map your keys now but the following works from the FSUIPC menu for the knobs: Select Key Presses (aircraft specific) - set the key you want to map - then below select the control "Rotor Brake" in the drop down and then enter as parameter: Range+: 72016 or Range-: 72015 or Mode+: 72013 or Mode-: 72012 When saved with OK the mode or range wheel in the EFIS part will turn when you enter the respective key press. You then need to map this to your GoFlight (not sure how that is done - I don't have it). The controls for the EFIS mode switches are: WX: ipc.control(72020,0) STA: ipc.control(72021,0) WPT: ipc.control(72022,0) ARPT: ipc.control(72023,0) DATA: ipc.control(72024,0) POS: ipc.control(72025,0) The problem here is that these controls are custom to the PMDG 747 and I am not sure if you can select them in the drop-down like the Rotor Brake. They do not have a name to them. So I am afraid you will have to do some programming with Lua. A simple Lua script could look like: p747efisarpt.lua: ipc.control(72023,0) That is all - make sure it is in the modules folder of FS. Then map to a key or button by looking for "Lua p747efisarpt" in the drop-down - the rest as with the others. Kosta
  16. Hi Jorge, I have a VRInsight MCP Combo and use Lua scripting for these things. I understand that this is not the option for everyone but in the course of getting all my planes connected I found that PMDG planes use controls to trigger actions on the panel. I program directly into my Lua scripts but you can trigger them also from the FSUIPC menu. The controls are: "Mode+": ipc.control(66587,72013) (Rotor Brake, Parameter 72013) "Mode-": ipc.control(66587,72012) (Rotor Brake, Parameter 72012) "Range+": ipc.control(66587,72016) (Rotor Brake, Parameter 72016) "Range-": ipc.control(66587,72015) (Rotor Brake, Parameter 72015) Cheers Kosta
  17. I managed to find some time for debugging. Here is the list of controls that trigger EFIS and MCP functions for the PMDG 747 FSX. It is in Lua notation but I guess you can use any code that triggers a control. Unfortunately there seem to be no LVars or other offsets I could find from where to read the heading and other values. I will look again some other time (sometimes they hide somewhere indirectly) but it is not like in the JS41 or the MD11 where I was able to get those values easily. Kosta -- EFIS "BARO STD" ipc.control(72006,0) "EFIS WX" ipc.control(72020,0) "EFIS STA" ipc.control(72021,0) "EFIS WPT" ipc.control(72022,0) "EFIS ARPT" ipc.control(72023,0) "EFIS DATA" ipc.control(72024,0) "EFIS POS" ipc.control(72025,0) "EFIS ADF1" ipc.control(66587,72011) "EFIS VOR1" ipc.control(66587,72010) "EFIS ADF2" ipc.control(66587,72018) "EFIS VOR2" ipc.control(66587,72017) "EFIS ND MODE-" ipc.control(66587,72012) "EFIS ND MODE+" ipc.control(66587,72013) "EFIS CTR" ipc.control(72014, 0) "EFIS ND RANGE+" ipc.control(66587,72016) "EFIS ND RANGE-" ipc.control(66587,72015) "EFIS TFC" ipc.control(72017,0) "EFIS MTR" ipc.control(72001,0) "EFIS FPV" ipc.control(72000,0) "MINIMUMS SET" ipc.control(72002,0) "MINIMUMS+" ipc.control(66587,72005) "MINIMUMS-" ipc.control(66587,72004) -- A/P "A/THR" ipc.control(72101,0) "FD" ipc.control(72100,0) "THR" ipc.control(72102,0) "SPD" ipc.control(72103,0) "FL CH" ipc.control(72108,0) "AP DISENGAGE" ipc.control(72127,0) "APL LOC" ipc.control(72121,0) "APL APP" ipc.control(72122,0) "APL CMDL" ipc.control(72123,0) "APL CMDC" ipc.control(72124,0) "APL CMDR" ipc.control(72125,0) "SPD Select-" ipc.control(66587,72104) "SPD Select+" ipc.control(66587,72105) "SPD INTV" ipc.control(72129,0) "TX MODE-" ipc.control(66587,74080) "TX MODE+" ipc.control(66587,74081) "TX IDENT" ipc.control(74094,0) "HDG+" ipc.control(66587,72112) "HDG-" ipc.control(66587,72111) "Activate HDG" ipc.control(72113) "Heading Hold" ipc.control(72114) "ALT-" ipc.control(66587,72119) "ALT INTV" ipc.control(72130,0) "ALT HOLD" ipc.control(72131,0) "VS+" ipc.control(66587,72116) "VS-" ipc.control(66587,72115) "VS HOLD" ipc.control(72118,0) "ECAS ENG" ipc.control(72060,0) "ECAS STAT" ipc.control(72061,0) "ECAS ELEC" ipc.control(72062,0) "ECAS FUEL" ipc.control(72063,0) "ECAS ECS" ipc.control(72064,0) "ECAS HYD" ipc.control(72065,0) "ECAS DRS" ipc.control(72066,0) "ECAS GEAR" ipc.control(72067,0) "CLOCK START/RESET" ipc.control(75005,0) "VNAV" ipc.control(72107,0) "LNAV" ipc.control(72106,0)
  18. I have managed to use Lua scripting to connect the VRInsight MCP Combo with the PMDG JS41 and MD11. In both cases I had to find a combination of controls triggered for the various functions. For example: Autopilot Master MD11: ipc.control(66587, 71001) JS41: ipc.control(66587,100001) ipc.sleep(1) ipc.control(66587,153) ipc.sleep(1) ipc.control(66587,8038) ipc.sleep(1) ipc.control(65792,0) ipc.sleep(10) ipc.control(66587,100002) ipc.sleep(1) ipc.control(66587,8038) I do have the PMDG 747 for FSX as well but unfortunately no time to analyze yet. If you want to try yourself start the logging of fsuipc and analyse which controls are fired when you select certain panel buttons. And the loglvars.lua that Pete is talking about may help as well. Kosta
  19. Hi Steve, normally you should be able to start the FSUIPC Options and Settings, Buttons + Switches, press the control button and then use "Select for FS control" and pick controls such as Toggle Nav Lights Toggle Taxi Lights Toggle Beacon Lights That usually works for all FS standard planes. In case that did not work for you you might have one of the add-ons that use their own code for switching. In that case you need something like mouse macros or Lua scripting. Kosta
  20. Hi Jay, Reading this thread I am not quite clear what it is you want to achieve. If you go through the hoops of connecting the VRInsight MCP Combo via VSPE to FSUIPC then you must intend to use Lua scripting to control the MCP outside SerialFP? Or what else do you want to do? Are you trying to connect an FSX plane such as AirbusX which cannot be programmed via SerialFP? Otherwise why not use SerliafFP with its many preprogrammed planes? Tell us a bit more about the goal and then we can see if there is a solution. I have the MCP Combo and use Lua scripting to connect it to all my planes wit VSPE and SerialFP. Cheers Kosta
  21. Hi John, Unfortunately the ATR has C binary gauges and no FSUIPC offsets exposed that I know of. There are no XML gauges one could analyze. I had a look at it some time ago since I like the ATR a lot but no success. Kosta
  22. Hi LN, When it comes to Lua programming I am always very interested and I recently bought ISG Gauges from Ernie Alston. So I invested some time to integrate these two, probably doing very similar things that you did as well. ISG modifies the A/P HDG which seems to work for all standard aircraft (and that is what the gauges are there fore since you do not need them for proper commercial add ons with FMCs). AirbusX as usual does everything differently and therefore these heading bug changes do not get through. I tried everything short of reprogramming components. As it looks to me now there are little options left, either I find the place in the XML gauges where these myriads of HDG Bug controls are fired by the AirbusX AFGS and change it so that external programs get a chance. Or I write some C++ code that uses the server gauge functionality of ISG Gauges to read out the new heading and write it directly into the L: variables of AirbusX XML gauges. Both options are time-consuming and if I ever find the time it will not be soon. Should I succeed eventually then I will post it here. Kosta
  23. Hi Günter, principally it is possible to read from the MCP - but not directly. What you have probably seen is the JS41 Lua I posted which runs entirely without SerialFP and VSPE for virtual ports. That works great apart from the fact that you cannot read out the displays directly. I did not get that to work. I am not sure why that is but so far it only works if SerialFP is connected and you have a (non-free) version of something like VSPE running. VSPE creates virtual COM ports and the lua scripts are principally spying on the communication between SerialFP and MCP. SerialFP is regularly asking for the state of the MCP and that can be used in lua scripts. So far I have been unable to recreate this without SerialFP and VSPE although I am quite sure that there is a way to be discovered to tell the MCP to release information. For the time being I use an indirect way. I initialize the MCP at the start of my scripts with values of the aircraft and then update the aircraft values with the values in the display (does not work for all aircraft but most I have experimented with). If I find a way to do reading from the MCP I will let you know. Kosta
  24. Hi Peter, I am not sure I fully understood what you were trying to achieve but have you considered a different approach: Have one Lua script that does it all and that runs in the background listening for your events. Basically it would look like something similar to: function handleButtons(joynum, button, downup) -- check if what number the button is for your joystick -- you could debug it by using one of the two -- ipc.log("Button mask: " .. button) -- ipc.display("Button mask: " .. button) if button == <number button 1> then ipc.display(button .. " pressed") end if button == <number button 2> then ipc.display(button .. " pressed") end if button == 0 then ipc.display("last button released") end end -- get the joystick number or the joystick letter from your fsuipc.ini [joynames] section -- if you use the letter encompass it in "" event.button(<your joystick number/text>,255,3,"handleButtons") It is not ideal because you need to know the joystick number and button numbers but it saves you from the trouble of terminating lua scripts. You do NOT assign this to the buttons but add it to luas being started by FSUIPC (see manual for possibilities). If you do not have it yet get yourself the FSUIPC SDK Documentation from this forum and read FSUIPC Lua Library.pdf for more information. Kosta
  25. No I don't mind. Go ahead. If you have questions let me know. Kosta
×
×
  • 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.