Jump to content
The simFlight Network Forums

Search the Community

Showing results for tags 'lua'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Product Support Forums
    • FSUIPC Support Pete Dowson Modules
    • MyTraffic Support Forum
    • FeelThere Support Forums
    • FS Commander Support Forum
    • Flying W Simulation
    • AConstable Traffic Sounds Support Forum
    • Fabio Merlo Products Support Forum
    • Elite-Air Studio Support Forum
    • Nikola Jovanovic Support Forum
    • Intrasystems Support Forum
    • FScene Support Forum
    • Taburet & DanVFR Support Forum
    • Environ Scenery
  • simFlight DE
  • FS MAGAZIN (DE)
  • simRussia
  • FSUIPC Client DLL for .NET

Categories

There are no results to display.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 50 results

  1. Hello, I am trying to read a joystick's axis in a lua script. My controllers have letters assigned and the axis is recognised in the FSUIPC tab as Joy "A" axis "X" (screenshot). When I run my script this line alway returns 16191 no matter what: m = ipc.axis("A", "X") I even tried using 0 as joystick number and reading other axises (?) but the result is the same. I have seen this in use e.g. the smooth brake lua script but what am I doing wrong here? Thanks! Code: function readX() m = ipc.axis("A", "X") strDisplay = m.." " m = ipc.axis("A", "Y") strDisplay = strDisplay..m.." " m = ipc.axis("A", "Z") strDisplay = strDisplay..m.." " m = ipc.axis("A", "R") strDisplay = strDisplay..m.." " m = ipc.axis("A", "U") strDisplay = strDisplay..m.." " m = ipc.axis("A", "V") strDisplay = strDisplay..m.." " ipc.display(strDisplay) end event.timer(1000, "readX") Log: 1637027 LUA.0: Waiting for an event in "C:\FSX\Modules\pwr.lua" 1638026 LUA.0: Timer event: calling "readX" in "C:\FSX\Modules\pwr.lua" 1638026 LUA.0: C:\FSX\Modules\pwr.lua:8 1638026 LUA.0: C:\FSX\Modules\pwr.lua:9 1638026 LUA.0: C:\FSX\Modules\pwr.lua:11 1638026 LUA.0: Global: strDisplay = 16191 1638026 LUA.0: C:\FSX\Modules\pwr.lua:12 1638026 LUA.0: C:\FSX\Modules\pwr.lua:14 1638026 LUA.0: Global: strDisplay = 16191 16191 1638026 LUA.0: C:\FSX\Modules\pwr.lua:15 1638041 LUA.0: C:\FSX\Modules\pwr.lua:17 1638041 LUA.0: Global: strDisplay = 16191 16191 16191 1638041 LUA.0: C:\FSX\Modules\pwr.lua:18 1638041 LUA.0: C:\FSX\Modules\pwr.lua:20 1638041 LUA.0: Global: strDisplay = 16191 16191 16191 16191 1638041 LUA.0: C:\FSX\Modules\pwr.lua:21 1638041 LUA.0: C:\FSX\Modules\pwr.lua:23 1638041 LUA.0: Global: strDisplay = 16191 16191 16191 16191 16191 1638041 LUA.0: C:\FSX\Modules\pwr.lua:24 1638041 LUA.0: C:\FSX\Modules\pwr.lua:26 1638041 LUA.0: Global: strDisplay = 16191 16191 16191 16191 16191 16191 1638057 LUA.0: C:\FSX\Modules\pwr.lua:27 1638057 LUA.0: Waiting for an event in "C:\FSX\Modules\pwr.lua" 1639040 LUA.0: ended "C:\FSX\Modules\pwr.lua" FSUIPC4.ini
  2. Hi all I'm a long-term Pete Dowson admirer and user of his wonderful program, I know is needless to say after all this time, but FSUIPC and the integration with LUA is simply extraordinary. I am building a home cockpit and I chose the Pokeys board for my MIP (ethernet), throttles (USB) and recently also overhead (ethernet version). With LUA and IPC controls and pokeys.dll I managed to have a great deal of systems working with default B737/800 so I'm very happy with that, and this site helped me a lot to find examples and solutions for almos every problem. Also Pete's documentation was so good and clear, even though I had to overload my poor brain to get started at the beginning. Now I decided to post a message because I cannot really solve this issue by myself. My code, launched by ipcready as documented, works perfectly, no errors, all running smoothly. Randomly though, I realize that the code has stopped working because there is no reaction to variables change or switches changes etc. I see the log file and there is no message of any kind regarding errors or other issues. Is there a way to understand what problem is causing the code to stop, or to trace the errors in a deeper log? It happens both with the MIP code and with the OVERHEAD code (based on ethernet pokeys) but never with the throttles (USB pokeys) but the net is stable, I changed switches, cables, etc, but all other net devices seem to work. Can someone (hopefully Pete!) help me ? Best regards Massimo
  3. This Lua file invokes the Print Screen button passing the clipboard to IrfanView.exe and, by using IrfanView's powerful command line options, processes the pasted file to an output .jpg modified as wanted. --[[ NOTES - USE WITH [AUTO] IN .INI TO START WITH FS - ASSIGN IN FSUIPC AS "LuaSet <Saved Name>" WITH A PARAMETER OF 1 - HTTP://WWW.IRFANVIEW.COM/ - SEE "I_OPTIONS.TXT" OR "I_VIEW32.CHM|OVERVIEW|COMMAND LINE OPTIONS" FOR COMMAND LINE DESCRIPTIONS. - EXAMPLE OF "SS_$U(%d%b%y_%H%M%S).jpg" IN OPTIONS = "SS_20Oct15_112307.jpg" - !!! IMPORTANT !!! - CHANGE "IV_Path" AND "IV_Options" TO OWN INSTALLATION AND REQUIRED OPTIONS - COMMAND OPTION "/convert=" WILL AUTOMATICALLY SHUT DOWN IRFRANVIEW AFTER PROCESSING - BECAUSE PRINT SCREEN IS INVOKED IN LUA, OWNED BY FS, IT CAPTURES ONLY THE ACTIVE MAIN WINDOW, IE FS. - !!! NOW MODIFIED FOR BETTER BEHAVIOUR - SEE COMMENTS IN "TRIGGERS SECTION" BELOW FOR OTHER ASSIGNEMENT OPTIONS END NOTES ]] sound.path("C:/Windows/Media") local flagged = 0 -- !!! IMPORTANT !!! - CHANGE THE FOLLOWING 2 LINES TO SUIT !!! local IV_Path = "E:/IrfanView/i_view32.exe" -- !!! IMPORTANT !!! - USE DOUBLE BACKSLAHES FOR OUTPUT PATH local IV_Options = "/clippaste /crop=(1443,62,1357,684) /sharpen=20 /jpgq=100 /convert=D:\\My Pictures\\FS_SCREENSHOTS\\PP_OUTPUT\\SS_$U(%d%b%y_%H%M%S).jpg" -- /crop=(13,62,1357,684) -- /crop=(1443,62,1357,684) -- PRESS PRINT SCREEN KEY, RUN IRFRANVIEW (SELF STOPPING), PASTE CLIPBOARD, OPTIONS PROCESSING, CREATE JPG & RETURN FOCUS TO FS function PrtScn(x, y, move, flags) flagged = ipc.testflag(1) if flags == 16 or flags == 32 or flags == 64 or flagged then ext.focus(0) -- REGAIN OWNERSHIP OF FS - FSX ONLY!!! x, y, xr, yr, xp, yp = mouse.getpos() mouse.move(66, 0, 2) mouse.click(0) mouse.move(xr, yr, 1) -- END FSX ONLY ipc.clearflag(1) ipc.control(1070, 300) -- WAIT FOR "PRTSCN" TO PROCESS, ADJUST HIGHER IF NOT PICKING UP FS WINDOW ipc.sleep(100) handle, error = ext.shell(IV_Path, IV_Options) if handle ~= 0 and error == 0 then sound.play("Windows Default", 0, 100, -1) end ext.focus(0) end end -- TRIGGERS SECTION -- SETFLAG TRIGGER, FOR JOY OR KEYS THROUGH FSUIPC ASSIGNMENTS event.flag(1, "PrtScn") -- MOUSEWHEEL CLICK - FSUIPC V4 ONLY! DISABLED FOR FSUIPC MOUSE LOOK FUNCTION USE -- event.mousemiddletrap("PrtScn") -- MOUSEWHEEL LEFT / RIGHT - FSUIPC V4 ONLY! DOES NOT WORK WITH MY MOUSE, USED KEYSEND MACRO IN MOUSE SOFTWARE -- event.mousehoriz("PrtScn")
  4. I'm trying to make a lua script that checks the FSX time against the current UTC time and then sets the FSX time to the real UTC time if it isn't already there. So, for example, if I load the default flight and set the time to "dusk" and that UTC time is not accurate, it will update the time to the current UTC time. This is the first time I have ever touched LUA, so I don't know what I am doing. The only programming I have done is in PHP. I came up with this after some googling, but it isn't working, so I am trying to figure out what I am doing wrong. Any help is appreciated! -- FSX UTC Time Synch -- Novbember 2015 -- V 1.0 -- ## Sets FSX Time to UTC ############### while 1 do simHour = ipc.readUB("023B") simMinute = ipc.readUB("023c") Hour = os.date("!%H") Minute = os.date("!%M") if simHour ~= Hour then ipc.writeUB("023B", Hour) end if simMinute ~= Minute then ipc.writeUB("023c", Minute) end ipc.sleep(120) end
  5. Pete, Just noticed something when trying to use the numpad enter key using event.key in lua. IIRC there was something about this in the forum but through searches couldn't find it. This works just fine for repeats - event.key(135, 8, 5, "KeyStroke") For a single shot, this works only 1 time when lua is first loaded and the enter key is used. It doesn't "listen" for it afterwards. Unless.... The enter key is pressed and held logging repeating keypresses. Then, it will work just 1 time afterwards until repeated. (a repeating keypress as a "listener" reset) All other keys on numpad work just fine. Single shot use, the one that doesn't seem to work properly - event.key(135, 8, 1, "KeyStroke") Strange thing though. When logging keys for the numpad enter key this is it's output for a single click / release. KEYDOWN & KEYUP don't match. HMMM???? 3056715 KEYDOWN: VK=135, Waiting=0, Repeat=N, Shifts=0 3056715 .. Key not programmed -- passed on to FS 3056902 KEYUP: VK=13, Waiting=0 Through the FSUIPC interface it picks up the keydown, not keyup, but keeps on listening. [Keys]21=135,8,L8:T,0,L8:K,0 9333696 KEYDOWN: VK=135, Waiting=0, Repeat=N, Shifts=0 9333696 LUA.4: "KeyTune.lua": Flag 0 toggled 9333696 .. This key is programmed in FSUIPC4 'Keys' options 9333696 LUA.4: Lua Flag event: calling "KeyStroke" in "G:\FSX\Modules\KeyTune.lua" 9333696 LUA.4: G:\FSX\Modules\KeyTune.lua:9 9333712 LUA.4: G:\FSX\Modules\KeyTune.lua:10 9333712 LUA.4: G:\FSX\Modules\KeyTune.lua:11 9333712 LUA.4: G:\FSX\Modules\KeyTune.lua:12 9333743 LUA.4: G:\FSX\Modules\KeyTune.lua:14 9333758 LUA.4: Waiting for an event in "G:\FSX\Modules\KeyTune.lua" 9333852 KEYUP: VK=13, Waiting=0No lua kill afterwards but it keeps listening for downpress. Just wondering.. Could go another route but was really hoping on using event.key v4.947d on FSX accel boxed.
  6. This will permit you to trigger whatever sounds you wish with joystick buttons. I wanted to help others in the future, who may wish to accomplish in their cockpits, what I have. Therefore, I put together a short step by step instruction document in PDF format. See attached, Michael Lehkamp Sound Scripting in LUA.pdf
  7. MOVED FROM "USER CONTRIBUTIONS" SUBFORUM so it might attract answers ... Because I am trying to understand the scenary I did: Is something wrong in this diagram?
  8. Hi Pete, everyone, I'm having a problem triggering sound files using LUA. For example: 1. I have a wav file called firebell.wav 2. It is located in the root of drive D 3. FS9 is also located on drive D ( D:\Flight Simulator 9 ) 4. My LUA file is titled "firebell.lua" and is located in the FS9 modules folder So I load FS9 and go into the FSUIPC GUI, click on buttons, and press the button I want to trigger the wav file. It reads location in FSUIPC as 5,0. Next switch 5,1, next switch 5,2 and so on. So once I press the switch I want to associate with the wav file (5,1), I place a check in the "Select for FS Control" box. I then scroll down until I see the "firebell lua" and select it. I then hit ok and exit FSUIPC. I re-boot FS and push the switch. NOTHING. No sound file play. I've done this over and over placing the sound files on the C drive, FS9/sound directory etc. etc. - No luck Below is the contents of my LUA file. Any help appreciated. Mitch Sound.play("D:\\firebell.wav")
  9. Hello fellow simmers! I've been using lua in my FSX projects for some time now, and I love it. Simple yet powerful. Thank you Pete for implementing lua in fsuipc. But I can't really find a way to develop with it efficiently. While developing I often bind the lua scripts to be executed by key presses (often the numeric keys). And I use tail to keep an eye on the log file. This approach works but it feels a bit clumsy. Is there a better way of doing this? How do you develop? Do you have any tips, ideas or suggestions how one can develop more efficiently? Any thoughts on this Pete Dowson (or anyone)?
  10. Hello fellow simmers! I've been using lua in my FSX projects for some time now, and I love it. Simple yet powerful. Good work Pete! As always... But I can't find a way to develop with it efficiently. While developing I bind the lua scripts to key presses (often the numeric keys) and also "lua kill" and so forth. I use tail to keep an eye on the log file. This approach works but it feels clumsy. Wouldn't it be great if there were a console/teminal in fsuipc that gave the possibilities to list, execute and kill lua scripts and so forth? How do you work? Do you have any tips, ideas or suggestions?
  11. Hello all! A newcomer to the forum here, and a complete beginner to FSUIPC, SPAD, Lua and all that jazz. My dilemma is that I do not know how to control and input multiple control axes, a Saitek Pro Flight Yoke and X52 joystick at the same time. At my ATC (Air Cadets) squadron, we have a pretty comprehensive setup, with Saitek panels, pedals, three screens and a projector. I'm in charge of the renovation project and a particular problem was the complications of having the two control inputs working at the same time; we had to reset FSX every time we wanted to swap. This is a problem and as far as I'm aware, is impossible in FSX's default binding settings. Using SPAD for the multitude of panels we have "shouldn't" be a problem (we'll see!) but I am clueless about setting up multiple axes to work simultaneously (even a method where there is a "sidestick priority-esque" system to use a button to switch between control methods is fine). Any insight is much appreciated and thanks to anyone in advance, Liam
  12. I am hoping to get some guidance in writing & testing lua programs with FSUIPC. I am a retired programmer, built a GA cockpit 4 years ago. Environment is Win 7, FSX, FSUIPC4 ver 4.937 (registered), Lua 5.1, SciTE editor. I have read the FSUIPC documents re Lua several times, but cannot figure out what I am missing. I tested a couple lua scripts (gfdDisplay & display vals) with FSX & they ran fine, produced expected results. I am a beginner with respect to Lua, my question is where are the 10 lua libraries that come with FSUIPC4? Are they part of FSUIPC4.DLL? For writing a lua program, should this module be copied to lua\clib? Then to test a lua module, I presume it has to be run with FSX. When trying to run a lua script by itself, I get the error "attempt to index global 'ipc' (a nil value)". I would appreciate some comment, am I on the right track or really missing something? I decided to try the Lua route because some of my GoFlight modules do not work with the A2A 172. Thanks for any help. Gene
  13. The Saitek Pro Flight Switch, Radio and Multi Panels can be accessed directly from FSUIPC and with the lua com library. Start with the HidDemo.lua and open the HID interface to the panels just as with a joystick. Vendor and product names can be retrieved with HIDScanner. Note that the switch panel has "HOLTEK" as Vendor/Manufacturer. Switch Panel For the Switch panel one 32-bit word is retrieved by com.read containing all the switches (incl. the rotary starter button). Adressing the LEDs works by sending a two-by string by com.writefeature(dev, s, wrf). The first byte must be char(0), the second byte contains a char which represents binary numerical representation of the LED-states: 0 b X X R1 R2 R3 G1 G2 G3 X stands for "ignored", R1 is the top, R2 bottom left, R3 bottom right LED, all in red, G1-3 the same in green. I.e. if you want turn on all LEDs in green then the character code is 0b00000111 or 7d (decimal). You can also turn on green and red at the same time by sending 0b00111111 (or 63d) to the feature data. Multi Panel It works similar for the Multi-Panel. Again, com.read retrieves all the button states. It has to be noticed that the trim wheel and the rotary button generates only short pulses in two individual bits each, indicating the turn direction. Not to miss relevant events by the proposed polling routine in HidDemo and also not to overload the lua-engine, I recommend to use at the begin of the polling routine this: while com.test(dev) >= 10*rd do CurrentData, n = com.read(dev, rd) End CurrentData, n = com.read(dev, rd) ... [/CODE] This discards effectively all but the last 10 button events and thus will provide enough rotary events to adjust trim and autopilot effectively, without having to much momentum effect after turning the knobs. Setting the display of the Multi-Panel works similar as with the Switch panel. Now the data string to the panel contains 13 bytes, which might be created like this: string.char(0, a1,a2,a3,a4,a5,b1,b2,b3,b4,b5,x) Again the first character must be a zero, then five characters follow for the first display line, and another five characters for the second display line. The last byte seems to be ingored. The displayed digit is the same as the character code. Character codes from 10-13 result in a blank position. In the second line character code 14 results in a "-". If all positions are filled with character code 15, the display is turned off. The display labels are not programmable, instead depend on the position of the mode selector switch (which is also mapped as a set of buttons). Also, when displaying courses, only the last three digits of the first line are shown. However the format of the writ string remains the same (i.e. only a3-a5 are shown on the panel). [b]Radio Panel[/b] As with the previous, the rotary, mode selector, and ACT/STBY buttons are mapped to buttons in the HID input section. Addressing the digital displays works similar as with the Multi-Panel by writing a string to the feature data. In this case the string contains 23 characters. As before, the first character code must be 0, then 20 characters follow containing the 5 digits each of the four displays. The last two characters seem to be ignored again: string.char(0,a1,a2,a3,a4,a5,b1,b2,b3,b4,b5,c1,c2,c3,c4,c5,d1,d2,d3,d4,d5,X,X) Again the first character code has to be zero, the next five codes show the upper left display, then upper right and so forth. Character codes are converted to the display as follows: [CODE]Code Display 0-9 0-9 10-15 <blank> This repeats in modulo 16 until a character code of 207. 208-217 0.-9. (decimal dot set) 218-223 . 224-239 - 240-248 0-9 250-255 <blank> [/CODE] [b]Annunciator Panel[/b] I don't have it, so I can't test it, but I'd expect it works the same way. [b]Finally[/b] Forgive me not to provide all the individual button mappings, I simply verified that it works this way and used the rotaries to dial through all possible codes at the digit positions, for finding out what they do. However, up to now I have now idea, what the effect is in writing other codes than "0" in the first byte (other than that the panel does not seem to accept anything), or in the ignored positions at the end of the string. Furthermore, the Multi-Panel has altogether two features caps, and I have no idea what the "second" means. Anyway, I know there a number of people interested in programming the Saitek Panels directly and this may help.
  14. Hi pete, I recently purchased a cockpitsonic tiller. Unfortunatly it is not a game hid usb so fsuipc can not see it. I ama cockpitbuilder and use prosim and ehid ( a utility which uses xml and communicates with prosim) I understand that for tiller to work, fsuipc has to control it. Unfotrunately is nit composed of a leo bodnar joystick usb board. I also understand that via lua script we can identify the tiller and hopefully make it work with fsuipc. I have an xml file that has the identification of the hardware. In addition through properties of the usb i can get details of the specs of the tiller. I was wondering if you help me with the steps to make it work ( isnthe above logic correct). Give me an example of the lua script and so i can replace it with the product hardware specs. I hope you can help. I am a reistered fsuipc and widex user. Thank you.
  15. Greetings... I have a desire to suppress a small number of FS control calls being written by a hardware interface (external .EXE) when first initialized. The developer of the software is overwriting the desired initial aircraft state using a view of a number of switch positions different than that desired. I've written a small piece of LUA that uses event.control to trap the events. What I am seeking is to suppress the events a single time from within the processing function and I will then event.cancel the functions so that subsequent calls to those FS controls are not impacted. After much digging, I'm not aware of any mechanism to suppress a FS control in this manner. I also tried event.intercept on an IPC offset of 0x3110 with a type of UD as well as SD thinking I could simply defer the ipc.writeXXX and the event.intercept never triggered. I suspect that the executable is making an external call outside of FSUIPC's purview and event.intercept is therefore not able to see this offset. FSUIPC does log the events so perhaps I am not calling it properly. Is what I am trying possible? The alternative is to write additional functions to set the switch positions back to the desired state which I can do if this approach is not possible. I was trying to avoid the "repeated switching" that takes place with that approach. I find that I am using FSUIPC all the time and I am grateful. A very clever piece of software which has solved many interesting challenges. My foray into LUA is now proving very interesting. Thanks in advance for any insights... ...DaddyBooks
  16. Hi everybody i have a script managing a Pokey56u01 card this script is ran by the ipcready.lua how i can run it again without restarting p3d (for example if i make a modification inside) i search in the advanced manuel of Pete about LUA command and automation page 41, but i don't see something helping me if you have a solution, an idea or trick to give me, you will be welcome Thierry
  17. Hi Pete, Hope you had a nice holiday / vacation.. I am working on a lua file where I need to substring/concatenate a string to the path from either 0x3C00 (.air) or 0x3E00 (fs path). Almost all the string functions I have found on the net seem to not work. I am assuming it has to do with the padding. For instance path .. string -- does not work string .. path -- does work cutting off the end ( - string.len) I am assuming the console window and ipc.display automatically removes the padding prior to displaying - or something.. Am I at a 256 byte limit for manipulation? Really Stumped here. I've tried a whole bunch of trim functions - Here and Here none work and many fail. Just thought of this as I'm typing - Instead of getting the whole 256 bytes from the offsets can I just get 100, 75 or 50 to give me some headroom? Thanks -- SET DISPLAY TIME IN SECONDS ( 0 = NO SHOW ) local disptim = 3.00 -- END SETTINGS -- GET AIR FILE PATH path = ipc.readSTR(0x3C00,256) length = string.len(path) -- TRIM PADDING TRIES newpath = string.gsub(path, "%s$", "") --newpath = string.gsub(path, "0$", "0") newlength = string.len(newpath) -- ALWAYS 256! display = newlength .. "\n" .. newpath ipc.setowndisplay("TEST STRINGS", 0, 3, 50, 15) ipc.display(display, 1, disptim) ipc.sleep(disptim * 1000) ipc.exit()
  18. Hi Pete, Just an inquiry if you know if the engine sound volume can be altered in flight. The reason I ask this is that in most rear engined aircraft the engine volume becomes almost non existent once you pass a certain airspeed. As I fly a Learjet in FS it would be nice to reduce the engine sound as I increase in speed. As it is at the moment the engine sounds are just as loud if I am doing 160kts or 320kts. Could this be done in LUA? Thanks Jeff
  19. - Because my English is not so special .... this text was translated by a translation program! - Hi, since yesterday afternoon, I am in possession of the payware FSUIPC4 - program for my FSX, which I bought at simmarket. Honestly, I do not know exactly what I should adjust exactly where now there, as there are unfortunately no German instructions. But in the FS MAGAZINE - Issue 05/2013 I found on page 6 of a report on a LUA packet with two files, which are intended to improve the roll characteristics in FSX: 1 = DynamicFriction 2 = Frictions But where exactly I can now download these files ? On the homepage of schiratti.com I could not find anything :-( Can someone help me out here maybe with a link? Thank you for your help and regards, Thomas :-)
  20. hi Pete and all how maybe able to help i have found and modified Goflight pro MCP Lua script but I have hit wall with IAS/MACH Crossover. It is falling over in the IAS/MACH section stringSPD = string.format("%03d", SPD) saying unexpected symbol near '==' is the a better why to write this section, if how can i fix it. prevCRS1 = -1 prevSPD = -1 prevHDG = -1 prevalt = -1 prevVS = -1 prevCRS2 = -1 prevMACH = -1 --************************All Working************************************************* while 1 do CRS1 = ipc.readSW("0C4E") if (CRS1 ~= prevCRS1) then stringCRS1 = string.format("%03d", CRS1) gfd.setDisplay(GFMCPPRO,0,0,stringCRS1) prevCRS1 = CRS1 end HDG = ipc.readSD("07CC") if (HDG ~= prevHDG) then stringHDG = string.format("%03d", ((HDG/65536)*360)) gfd.setDisplay(GFMCPPRO,0,2,stringHDG) prevHDG = HDG end alt = ipc.readSD("07D4") if (alt ~= prevalt) then stringalt = string.format("%05d", ((alt/65536)*3.2809)) gfd.setDisplay(GFMCPPRO,0,3,stringalt) prevalt = alt end VS = ipc.readSW("07F2") if (VS ~= prevVS) then stringalt = string.format("%05d", VS) gfd.setDisplay(GFMCPPRO,0,4,stringalt) prevVS = VS end CRS2 = ipc.readSW("0C5E") if (CRS2 ~= prevCRS2) then stringCRS2 = string.format("%03d", CRS2) gfd.setDisplay(GFMCPPRO,0,5,stringCRS2) prevCRS2 = CRS2 end --******************************************************************************************************* --*******************IAS/MACH Crossover NEED Help!!!!!!!!!!!!!**************************************** if ipc.readUD("07DC" and "07E4") == 0 then SPD = ipc.readSW("07E2") if (SPD ~= prevSPD) then stringSPD = string.format("%03d", SPD) gfd.SetDisplay(GFMCPPRO,0,1,stringSPD) prevSPD = SPD end else ipc.readUD("07DC") == 1 and ("07E42") == 0 then SPD = ipc.readSW("07E2") if (SPD ~= prevSPD) then stringSPD = string.format("%03d", SPD) gfd.SetDisplay(GFMCPPRO,0,1,stringSPD) prevSPD = SPD end else ipc.readUD("07DC") == 0 and ("07E42") == 1 then MACH = ipc.readSD("07E8") if (MACH ~= prevMACH) then stringMACH = string.format ("%02f", MACH/65536) gfd.SetDisplay(GFMCPPRO,0,1,stringMACH) prevMACH = MACH end --********************************************************************************************** ipc.sleep(200) end Thanks Johan
  21. Hello Pete! I have a question about the Lua ipc.sleep function. I have noticed that longer "sleeps" seems a bit shorter than they should. For instance “a sleep” with a duration of 60 000 ms only lasts about 54 seconds. First I thought that it might be something wrong with my environment but after have tried it on another computer I can say it behaves the same way. Any idea about the reason for this? Thanks for a otherwise excellent product. Best regards Bleedin
  22. Hi Pete, Sometimes you have the need to run or kill a LUA program by a button in your cockpit. You can either implement the Lua or the LuaKill function for this button. It would be useful to have also a LuaStartStop function for a given LUA program. This function should start the LUA prorgam, if it is not running and should kill the LUA, if it is currently running. This would allow, to activate and deactivate certain functionality with one single button. Of course there are some other methods, which can be coded, but I think, this would make it easier, to activate/deactivate functions in a cockpit by a single button press. How are you thinking about such a function ? Rgds Reinhard
  23. I have been trying for a while to figure a way to read the "A" (and other) variables using a LUA script. I can read and write L variables just fine but I can't find a way to read an "A" variable. (A:PROP SYNC ACTIVE, bool) for example. Is there some reason this can't be done? The point of the excercise is to take toggle only functions and add on/off assignability to them that can be easily included in the LINDA librairies. I have managed to kluge something together but only by adding an xml gauge to the plane for the reading of the "A" variables involved. Since the point is to make this something easy for pilots who are not computer savvy... adding a guage is not a great option. What I have so far is this: LUA function Prop_Sync_On () ipc.writeLvar("L:JMH_Prop_Sync", 1) end function Prop_Sync_Off () ipc.writeLvar("L:JMH_Prop_Sync", 0) end Corresponding XML (L:JMH_Prop_Sync, bool) (A:PROP SYNC ACTIVE, bool) != if{ (>K:TOGGLE_PROPELLER_SYNC) } Any Help? Cheers, Bao
  24. Hello, I use Prepar3d and have recently updated from version 1.3 to 1.4. As suggested by Lockheed Martin, I did a clean installation, completely removing the old version and installing the newer one. So I had to reinstall FSUIPC (v.4.853) as wel. No problems here, everything works as a bell. Exept for the .lua scripts that I made before (GF modules; avionics handling, APU handling,...) and where sound is used (APU startup,Cabin signs,...). Before upgrading Prepar3d all sounds invoked thrue the sound.play(filename) function worked fine, sounds were played normaly. However after the upgrade the sounds won't play anymore. The scripts work fine, there are no errors, the sounddevice is recognised and the soundref value is assigned. However the sound.query function returns as "false". The sound files are in the default "\Prepare3D\Sound" map and I tried using the sound.path function, no effect. I have tried reinstalling FSUIPC, no effect. All other simulator sounds, as well as PM Sounds, are played normaly. Any help would be greatly appreciated. Thanks!
  25. Hi all, I have 2 machines in a Prepar3D multiplayer session sharing cockpit. In one of the machines I have FSUIPC with Lua scripts to change xml gauge LVars values (ipc.writeLvar). The LVars values modified via Lua scripts are not propagated to the other cockpit. If I change the values via mouse cliccks in the gauge the values are propagated correctly. Can anyone help me with this?? Thanks, Gerardo
×
×
  • 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.