
gsumner
Members-
Posts
60 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Gallery
Downloads
Everything posted by gsumner
-
LAU script to emulate key presses
gsumner replied to gsumner's topic in FSUIPC Support Pete Dowson Modules
Yes been there and read that before i posted. Thats where my attempt came from. Its the triple key thats confusing things. I think im going to assign a single spare key to the tilt up viewpoint and just call that with a LUA script. Thanks Graham -
LAU script to emulate key presses
gsumner replied to gsumner's topic in FSUIPC Support Pete Dowson Modules
Ive tried using ipc.keypress(17,16,81) to send "ctrl shift q" to fsx but it doesnt seem to work Is the syntax wrong ? What is the correct syntax if it is Thanks Graham -
LAU script to emulate key presses
gsumner replied to gsumner's topic in FSUIPC Support Pete Dowson Modules
A LUA method would have been grand. I only need seat down during landing and up for flight. I was thinking of incorporating it into undercarriage up and down selections. Im sure there will be an offset for seat up and down. Just need to find it. Graham -
My view perspective (eye point) is too high in the cockpit on approach. Can I write a lua script to move my seat lower (shift - backspace) by a given number. I can do this manually but once I know how much my seat needs lowering it will be much quicker than doing it manually. By the way I dont have to cockpit showing so it will be the outside view perspective that changes. Any help will be appreciated. Graham
-
Lua script to transfer CRS 1 to CRS 2
gsumner replied to gsumner's topic in FSUIPC Support Pete Dowson Modules
Hi Pete welcome back. Hope you enjoyed your break. I did consider using an event offset. A few years ago I was fortunate to get 10 hours one to one instruction in a full size 737 sim with an instructor. He was a bit old school and insisted the fo should be on raw data especially on sids and stars so the PF had a secondary reference should something fail at a critical time. This of course means vors tuned and courses set. Needing 2 different course settings would mean the offset. Method wouldn't allow this. I will try to tidy up the loop method a bit though. Thanks Graham -
Lua script to transfer CRS 1 to CRS 2
gsumner replied to gsumner's topic in FSUIPC Support Pete Dowson Modules
Ive actually ended up using this CrsOne = ipc.readUW(0x9434) CrsTwo = ipc.readUW(0x943E) while CrsOne ~= CrsTwo do ipc.writeUW("9400", 199) -- this line increments crs2 by 1 then the next line reads the new value ipc.sleep(200) CrsTwo = ipc.readUW(0x943E) end I'm sure its not efficient code and Pete feel free to correct me when you return from your well earned break. It works however. Graham -
Lua script to transfer CRS 1 to CRS 2
gsumner replied to gsumner's topic in FSUIPC Support Pete Dowson Modules
Hi Offsets are from ifly737. Script will be called by a button push. Will try that space Thanks Graham -
Hi, My MCP has only 1 crs selector and I would like to set both CRS 1 and 2 without showing the panel on my screen. Ive written a LUA file for this but my coding is very basic and Im going wrong somewhere. Here is what my button press should do:- read the value of CRS 1 = OFFSET 9434 size 2 transfer it to CRS 2 = OFFSET 943E size 2 The lines of code ive written are MyData = ipc.readUW(0x9434) ipc.writeUW("943E",MyData) it doesnt work though. Im sure Im missing something obvious or barking up the wrong tree altogether. Can someone correct me Thankyou Graham
-
The reason why I chose this to quiz you is the guy that wrote the above is also testing the APU gen status light. Offset 940F bit 5 but he's using what looks like binary for 5 0x0101 and not hex 0x20 which is what we used in my case. Is that another way to do it or is this code faulty. I promise I'll read up on things Peter . . . Promise ;-) Graham
-
Thanks for your help. It did help get me to where I got to in the end. Pete youve been a great help so far, can you just do one last thing before we can wrap this thread up. Can you just talk me through this code taken from another thread in another forum. function ApuGenOffline(offset, value)--//Apu Gen Offline Lights gfd.SetBright(GFP8, 0, 10)--//Sets the brighness level (10) for my P8 FIRST unit(1) if logic.And(value,0x0101) ~=0 then gfd.SetLight(GFP8, 0, 1) gfd.SetLight(GFP8, 0, 3) else gfd.ClearLight(GFP8, 0, 1) gfd.ClearLight(GFP8, 0, 3) end end event.offset("940F", "UB", "ApuGenOffline") It seems that event.offset("940F", "UB", "ApuGenOffline") has 3 parameters. Is the third the result of the function. Where is value taken from and put into the function being defined. Graham
-
Youre not going to believe this Pete but I actually noticed that capital L and momentarily hovered my mouse over it to change it to lowercase. Then I checked back through this thread and saw that they were all capitals right from the post from SPOKES2012 so I dismissed my own judgment. Maybe we all copied and pasted ( I know I did). It works excellent Pete. I can now release a lot of my button associations as I can now give some of them a dual purpose. Happy man . . . . .for now anyway. Thanks very much Graham
-
Hi Pete, Thankyou for your last post. My understanding of things are much clearer now. It was the bit5 I was having trouble with. I did read the FAQ on bits but didn't understand it. It was clearer when I revisited it after your informative post. Unfortunately it still doesnt work and puzzled as to why that may be. The following is my lua script saved in the modules folder and called by a button press assigned in FSUIPC. The ip.write lines are correct as I saved them as a single line in a lua file and assigned them to a button for testing purposes. They worked as advertised. Ifly2fsuipc documentation says the apu offline status light is 940F bit 5 which is the way I chose to detect whether the apu is running or not so my button operates the correct operation of START or OFF. The line beneath the script is an error relating to my lua script which was picked up by the Linda console window.Im not certain it likes the testing method we chose. MyData = ipc.readUB(0x940F) if Logic.And(MyData, 0x20) ~= 0 then -- Bit 5 = 100000 binary, 32 decimal, 20 hexadecimal ipc.writeUW("9400",517) -- stop apu else ipc.writeUW("9400",519) --start apu end [E] *** LUA Error: ...s\Microsoft Flight Simulator X\Modules\ApuToggle.lua:2: attempt to index global 'Logic' (a nil value) I think were nearly there but a last hurdle is yet to be jumped. Hope you can help. Graham
-
The trouble with words on a page is they don't convey the feeling sometimes when they were written. When I wrote now that was brutal I remember I was actually smiling at the fact I really do know very little and seem to be barking up the wrong tree. No-one is throwing anything back at anyone Pete. I would have liked the solution but I've read a post were you said you weren't here to provide a coding service ( and why should you? ) so " cap in hand ", I had a go at it myself and came to the ones who know their stuff. Being perplexed at all this stuff, I was even more perplexed at my mistakes you pointed out. I apologize if my reply to your help came across in a way that it wasn't supposed to. I'm sorry. Graham
-
n =ipc.readUB(940F) Then test n ? There's several lights assigned to 940F so how do I get n to test 940F bit 5. I'm sorry but I'm just not getting any of it Graham
-
Now that was brutal Pete. I'm just trying to make lua do one or 2 things for me so trying to get an understanding for programming, hex and binary and all things technical is like learning do it yourself brain surgery so you can cut your own fingernails. Once I learn one or two tricks like the one I'm trying to achieve I can apply it to many things. I can't try them at present because I'm away from my computer for a while but trying to get one or two lua scripts written for when I'm next home and able to try them. I'm not asking people to provide a coding service but one or two pointers with my position in mind would be eally nice. I'm in the middle east working and would love to pop round to a fellow simmers house to exchange notes but they'd be over 3 and a half thousand miles away. Graham
-
I'm struggling getting to grips with lua I'm afraid. I'm trying to get a code a push button to start the apu if its not already running. If it is then stop it. I'm testing offset 940F bit 5. This is the apu generator offbus light which will be a reasonable test to see if I can shut the apu down safely. Apart from the 2 lines --// start apu etc. Can you see any problems with this code. It may not be the best way to do it but I'm looking for a simple solution. ifly2fsuipc will off course be running and this lua file will be assigned to a switch in fsuipc. function ApuToggle(offset, value) if Logic.And(value, 0x0101) ~=0 then --//stop apu else --//start apu end end ApuToggle("940F", "UB", "0x0101") Please don't be tooo brutal in your reply and try to keep it relatively simple as I really am a beginner. I learn best from examples too. Thanks Graham
-
Ok Peter I'll take a look ......so much to read ..... I'll get there ;-)
-
Thanks Pete, I do just that. Just thought id make use of widefs and view the offsets on a separate laptop as I flew around but nevermind. Graham
-
Im trying to view ifly offsets using fsinterrogater but the memory locations in the left column dont seem to go up to 9400 which is where i believe ifly offsets are. Im doing something wrong but need i little help to get mr started. Excuse my ignorence at this level but i guess we all have to start somewhere.
-
Assigning a key to a LUA script
gsumner replied to gsumner's topic in FSUIPC Support Pete Dowson Modules
It's ok Peter. I just wanted to make sure I didn't have to use the LuaClear to stop the script executing as I lifted the key. But I guess now that's not the case. It's just simple stuff I'm doing really but things seem fine. Thanks for your programs and also your work and support. Graham -
Assigning a key to a LUA script
gsumner replied to gsumner's topic in FSUIPC Support Pete Dowson Modules
Ok, I'm not good at writing about things I know little about but ill try to make it a bit clearer. Sorry. I've written a LUA script and assigned it to a keystroke ( keyboard ) using fsuipc. I noticed that my .lua file also had one suffixed clear. The script I wrote just moves switches in my ifly 737 cockpit ( several at once instead of individually ) I just wonded if I also had to use the " clear" in the dropdown box that's actioned when my assigned key is released. Hope that's a bit clearer sorry. Graham -
I've managed to assign a script to a LUA file I have written. Do I have to assign the command LUAclear **** for when the key is released. Thanks Graham