Jump to content
The simFlight Network Forums

Skittles

Members
  • Posts

    189
  • Joined

  • Last visited

Everything posted by Skittles

  1. Thank you for repeating yourself then, looks like I missed that.
  2. I'm back to bother you again, I'm sorry. I used to use GFConfig to assign the Altimeter to a GF45 and the Xpdr to a GF166, with each rotary "click", the number changed. Now, instead of GFConfig, I'm using FSUIPC, but the rotaries now click twice before the number changes. Any ideas on why one method is "more sensitive" than the other?
  3. I read these two quotes as saying two different things The way I understood it to mean was that the function was executed without being called by the event.offset during the initial run. I'm probably wrong, but I think there's a difference between executing a function and calling a function. But even in my own VB programs, functions don't execute unless called, I just wanted clarification. Thanks, Joe
  4. In the "FSUIPC Lua Library" manual, in the event.offset section it states... My question is... Does the function itself get executed or do the event.offset commands get executed? Here's why I'm asking, I have 8 event.offsets which call the same function. So if the initial execution is actually done by the event.offset commands, it would run the function 8 times, right? gfd.GetValues(GFT8, 1) -- GFT8 Module 1 function GFModule(offset, value) unit = 1 gfd.GetValues(GFT8, unit) if gfd.TestButton(0) then -- BATTERY MASTER ipc.set("MastBatt", 1) gfd.SetLight(GFT8, unit, 0) ipc.writeUB("3102", 1) ipc.runlua("GF-T80") else ipc.set("MastBatt", 0) gfd.ClearLight(GFT8,unit,0) ipc.writeUB("3102", 0) gfd.BlankAll() ipc.runlua("GF-T80") end -- gfd.GetValues(GFT8, unit) -- ALTERNATOR MASTER if gfd.TestButton(1) then if ipc.get("MastBatt") == 1 then gfd.SetLight(GFT8, unit, 1) end ipc.writeUB("3101", 1) else gfd.ClearLight(GFT8,unit,1) ipc.writeUB("3101", 0) end -- gfd.GetValues(GFT8, unit) -- AVIONICS MASTER if gfd.TestButton(2) then ipc.set("AviMast", 1) if ipc.get("MastBatt") == 1 then gfd.SetLight(GFT8, unit, 2) end ipc.writeUB("3103", 1) ipc.runlua("GF-Altimeter") ipc.runlua("GF-Clock") ipc.runlua("GF-HSaD") else ipc.set("AviMast", 0) gfd.ClearLight(GFT8,unit,2) ipc.writeUB("3103", 0) ipc.runlua("GF-Clock") ipc.runlua("GF-Altimeter") ipc.runlua("GF-HSaD") end -- gfd.GetValues(GFT8, unit) -- NAV GPS/VOR if gfd.TestButton(3) then if ipc.get("MastBatt") == 1 then gfd.SetLight(GFT8, unit, 3) end ipc.writeUB("132C", 1) else gfd.ClearLight(GFT8,unit,3) ipc.writeUB("132C", 0) end -- gfd.GetValues(GFT8, unit) -- FUEL PUMP if gfd.TestButton(4) then if ipc.get("MastBatt") == 1 then gfd.SetLight(GFT8, unit, 4) end ipc.writeUB("3104", 1) else gfd.ClearLight(GFT8,unit,4) ipc.writeUB("3104", 0) end -- gfd.GetValues(GFT8, unit) -- SPOILER ARM if gfd.TestButton(5) then if ipc.get("MastBatt") == 1 then gfd.SetLight(GFT8, unit, 5) end ipc.writeUB("0BCC", 1) else gfd.ClearLight(GFT8,unit,5) ipc.writeUB("0BCC", 0) end -- gfd.GetValues(GFT8, unit) -- AUTO FEATHER if gfd.TestButton(6) then if ipc.get("MastBatt") == 1 then gfd.SetLight(GFT8, unit, 6) end ipc.writeUB("2E88", 1) else gfd.ClearLight(GFT8,unit,6) ipc.writeUB("2E88", 0) end -- gfd.GetValues(GFT8, unit) -- Parking Brake if gfd.TestButton(7) then if ipc.get("MastBatt") == 1 then gfd.SetLight(GFT8, unit, 7) end ipc.writeUB("0BC8", 32768) else gfd.ClearLight(GFT8,unit,7) ipc.writeUB("0BC8", 0) end end --============================================================================== -- POWER SWITCHES / GF-T8 MODULE 1 event.offset("3102", "UB", "GFModule")-- Battery Master event.offset("3101", "UB", "GFModule")-- Alternator Master event.offset("3103", "UB", "GFModule")-- Avionics Master event.offset("132C", "UD", "GFModule")-- NAV GPS/VOR event.offset("3104", "UB", "GFModule")-- Fuel Pump event.offset("0BCC", "SD", "GFModule")-- Spoiler Arm event.offset("2E88", "UD", "GFModule")-- Auto Feather event.offset("0BC8", "SW", "GFModule")-- Parking Brake [uPDATE:] I added a ipc.log command. This is what was logged... So I answered my own question... but is it supposed to do this?
  5. Years and years huh? I'm just glad I wasn't me messing up again!
  6. I assigned a rotary to "Xpndr Low NN Dec" for CCW rotation and "Xpndr Low NN Inc" for CW rotation. Same with the "Xpndr High NN Dec & Inc" They worked backwards. Dec, increased the numbers and vice-versa. Or am I thinking backwards.
  7. Why is it... When I post here and bother you, I solve my own problem. I kept trying to convert BCD to Decimal. I found a converter online and discovered it nothing more then DEC2HEX!!! I found a DEC2HEX function for Lua. So I solved the puzzle! Until next time,
  8. Hello Mr. Dowson, I trust you had a good visit with your daughter. Welcome back! I need to be bailed out... again :( OK, the short version: I'm trying to use Lua script to display the XPDR feq on my GF-166. But I'm getting the raw BCD value. How do I convert a BCD value to decimal? The long version: I understand that offset x0354 is an unsigned 16bit word (two bytes). I understand that FS stores the value as a Binary Coded Decimal. I'd never heard of that so I Googled it. I then conducted searches here and found that many people had the same problem I am. I've tried searching through the forum at Luahub.com... nuthin. You said in another post, something about "shifting the byes"... I don't know what that means and now, I can't find that post for reference. I've set a GF button to set the XPDR to x1200. Which, GFConfig converts to "1200" for the display, but naturally when I use Lua I get 4608. FSUIPC changed the parameter of x1200 to 4608. If I remember correctly, I read that the GFConfig software preferrs to "control" the modules and that it doesn't like to share. On the same GF-166, I have a clock in one window and the XPDR in the other. I was using Lua script to run the clock and GFConfig to run the XPDR but FS kept crashing randomly. So I thought I'd try using Lua script to run the XPDR. I'd appreciate any help you have to offer.
  9. It's been a long time, but I think, instead of "disabling" I assigned "nothing", which I suppose is not the same thing but produces the same result. I think I also raised the Null and lowered the sensitivity. Assigning that to a button control...???
  10. You're running Microsoft Windows, right? Need I ask more?
  11. I've not heard of this before, but that may not mean much. The only thing I can think of is maybe FSX is changing time based on time zone??? I don't see anything within FSUIPC that would change the time unless you tell it to. I have a "control" setup to instantly set the time to 6am. But I had to program it to do that. The only thing I can see that FSUIPC changes the time is it syncs up the seconds only. Maybe your installation of FSX is having a nervous breakdown. Maybe a deeper look into FSX instead of FSUIPC.
  12. I figured out my problem... It always seems to happen after I make a post! However, I still don't know why FSUIPC is doing this... [JoyNames] AutoAssignLetters=No 0=CH FLIGHT SIM YOKE LE 1=Saitek X45 2=GoFlight GF-RC Rudder Controls 3=GoFlight GF-TQ6 Throttle System !0.GUID={B1B50AC0-B77A-11E0-8002-444553540000} !1.GUID={B1B50AC0-B77A-11E0-8003-444553540000} !2.GUID={B1C362A0-B77A-11E0-8019-444553540000} !3.GUID={B1C362A0-B77A-11E0-801A-444553540000} 0.GUID={B1B50AC0-B77A-11E0-8002-444553540000} 1.GUID={B1B50AC0-B77A-11E0-8003-444553540000} 2.GUID={B1C362A0-B77A-11E0-8019-444553540000} 3.GUID={B1C362A0-B77A-11E0-801A-444553540000} I tried remarking the second set of joysticks but FSUIPC put them back, so I figure they're important.
  13. I use a registered version of FSUIPC(3.997c) to assign all axis'. I have a CH Yoke, Saitek x45, GoFlight Rudder and TQ-6. Everything is working fine except lever 2 on my TQ-6. I have it assigned to mixture 1 for Prop a/c. (I know, Mixture 1 on lever 2??? I have the unit upside-down) It's acting like a control input conflict... Jumping up and down as I slowly move the lever. I have recalibrated in Windows CP and FSUIPC. I verified I have NO assignments made in FS2004 and NO assignments using GFConfig(2.02). I also verified no other joystick axis' have the Mixture 1 assignment. I use Profiles in FSUIPC, Piston Prop/Turbo Prop/Jetliner/Jet Fighter/Prop Fighter I thought I was a master at this sort of problem... Is there anything else I may have missed? I did find this in my FSUIPC.ini [JoyNames] AutoAssignLetters=No 0=CH FLIGHT SIM YOKE LE 1=Saitek X45 2=GoFlight GF-RC Rudder Controls 3=GoFlight GF-TQ6 Throttle System 0.GUID={B1B50AC0-B77A-11E0-8002-444553540000} 1.GUID={B1B50AC0-B77A-11E0-8003-444553540000} 2.GUID={B1C362A0-B77A-11E0-8019-444553540000} 3.GUID={B1C362A0-B77A-11E0-801A-444553540000} This doesn't seem right to me... It looks as if FSUIPC has made dual enteries? Thanks for your time, Joe
  14. I'm terribly sorry... When I got it to work how I wanted, I went back to my post and tried to remove it. So I'm very sorry to say, I once again, wasted your time. I did however take your suggestion about the looping... ipc.display("Loaded, Please wait") ipc.sleep(4000) -- Wait until next two offsets are initialised while (ipc.readUB("3364") ~= 0) or (ipc.readUB("3365") ~= 0) do ipc.sleep(333) end ipc.sleep(2000) -- waits until aircraft is initialized within the sim gfd.BlankAll() Now I need to figure out why my light switches keep turning on and off. It never ends.
  15. I suppose it's a good thing I'm a tinkerer. According to the Lua Library Reference the function syntax is... function-name(model, unit) The function in question works without parameters. function NAME()
  16. I'm receiving a Lua Error... I'm guessing that 24 is the line number? This is line 24 of the Llua file. function CHKPWRSWT(GFT8, 1) -- CHECK POWER SWITCHES I can't see the problem. I've attached the whole file as a txt. GF-ModDisp.txt
  17. I hadn't investigated the TestButton when I last wrote. I was just going to get into that until I saw you provided that example. You beat me to it... Thanks for your time and efforts. I'll get on it. You're awesome Mr. Dowson.
  18. Thanks Pete, Yes I did include the gfd.GetValues command. I just missed that line when pasting into the forum. Here's what I came up with last night. It may not be pretty but it works. gfd.GetValues(GFT8,1) -- Get values of GFT8 Unit 1 n = gfd.Buttons() --ipc.display(n) if n >= 128 then -- Switch 8 is ON ipc.writeSB("0bc8",1) n = n - 128 else ipc.writeSB("0bc8",0) end if n >= 64 then -- Switch 7 is ON ipc.writeSB("2438",1) n = n - 64 else ipc.writeSB("2438",0) end if n >= 32 then -- Switch 6 is ON ipc.writeSB("0bcc",1) n = n - 32 else ipc.writeSB("0bcc",0) end if n >= 16 then -- Switch 5 is ON ipc.writeSB("3104",1) n = n - 16 else ipc.writeSB("3104",0) end if n >= 8 then -- Switch 4 is ON ipc.writeSB("132c",1) n = n - 8 else ipc.writeSB("132c",0) end if n >= 4 then -- Switch 3 is ON ipc.writeSB("3103",1) n = n - 4 else ipc.writeSB("3103",0) end if n >= 2 then -- Switch 2 is ON ipc.writeSB("3101",1) n = n - 2 else ipc.writeSB("3101",0) end if n >= 1 then -- Switch 1 is ON ipc.writeSB("3102",1) else ipc.writeSB("3102",0) end
  19. What I'm trying to do I'm writing a lua script that will determine what physical GoFlight switches are switched on and then set the aircraft switches accordingly. What I have n = gfd.Buttons() -- Gets the State of the switches on the T8 ipc.display(n) -- Displays the returned value What I need I need to break down the returned value so I can determine the state of individual switches. I believe it's done with either masks or a math function/formula, I don't know or remember which. Can someone point me in the right direction? Thanks, Joe
  20. I've been going back and forth, experimenting. I will go back to using the ini [Auto] section. OK I was tinkering with which I like better Yes, I found the "floor" function, but I was missing the idea of adding 0.5... Thank You! So instead of using Ctrl-Shft-R to reload the aircraft I can have it reload the lua... Why do I make things more complicated than they are? (Don't answer that LOL) Thank you for your time and sorry for the frustration I've caused. ADDED: That did the trick... the Math.Floor command works great and so does re-loading the lua. Boy did I make a mess out of this. Again, my apologies.
  21. I'm sorry about how I structured my post, yes I can understand the confusion. At first, I thought if I just asked the question, it would prompt you to ask me questions. I was trying to anticipate your questions. I'll give you the long story... I'm learning the lua script. I have the file ipcready.lua which contains a single line... ipc.macro("Lua GF-ModDisp") This is correctly loading and running my GF-ModDisp.lua file. This is written to display the Mag heading and speed on my GF46. function HDG(offset, value) gfd.SetDisplay(GF46,0,1,value) -- Display Mag Heading end function ASPD(offset, value) if ipc.readSW(0x0366) == 0 then gfd.SetDisplay(GF46,0,0,value /128) -- Display Air Speed end end function GSPD(offset, value) if ipc.readSW(0x0366) == 1 then gfd.SetDisplay(GF46,0,0,value *1.9438445 /65536) -- Display Ground Speed end end ----------------------------------- event.offset("2B00", "DBL", "HDG") -- A/C Mag Heading event.offset(0x02bc, "UD", "ASPD") -- Air Speed event.offset(0x02b4, "UD", "GSPD") -- Ground Speed It's working correctly. I'm trying to figure out how to make the displayed values a whole number. When I make a change in the code, I save the lua file and then change aircraft in the sim. (Thereby reloading the lua file) so I can see the affects of the change. When I change aircraft, the sim sends them spinning to the ground. So I was hoping it was possible to get FSUIPC to recognize a "aircraft reload".
  22. I didn't think you would appreciate me quoting the whole section since you wrote it. Some people may feel like I'm throwing it in their face. I just wanted to quote the part that says FSUIPC can be setup to automatically load the lua files. Yes I did, yes I have and it's loading the lua as expected. I didn't say I was having a problem with it loading automatically. I didn't say FSUIPC was causing the spinning dive, it's FS2004 doing that.I just wanted to know if it's possible to have FSUIPC either re-run the "Auto" section or just re-load the lua file when the user reloads the aircraft. That would prevent FS2004 from sending the aircraft in to a dive. I thought it would make the file editing/troubleshooting go a little smoother. I'm upset for getting jumped on... I was just asking a question and trying to provide a little background to give my question some meaning. Sorry
×
×
  • 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.