DEN19 Posted May 7, 2015 Report Posted May 7, 2015 A couple of queries. 1. I would like to operate on offset 0D0C , picking out individual lights and monitoring for a change of status via the Event function, but cannot see how to specify the individual bits to be monitored. This would then trigger a WND function to change the colour of the WND window, effectively showing whether the light is on or off. Is this possible using the Event function? Or is there an easier way to do it? 2. Is it possible to operate a Lua program on the Wideclient (slave) pc by request rather than at start up? Preferably via a button on either the Button screen on the slave pc or a button on the master (fsx) pc.
Pete Dowson Posted May 7, 2015 Report Posted May 7, 2015 I would like to operate on offset 0D0C , picking out individual lights and monitoring for a change of status via the Event function, but cannot see how to specify the individual bits to be monitored. . You can either use event.offsetmask, with the mask picking out the bit (or bits) to test -- this would allow you to have a separate function called for each bit -- or use event.offset for any changes in 0D0C and test individual bits using the logic.And function, within the one function. The former is probably easiest. For a single bit the mask is the value of that bit -- 1 for bit 0, 2 for bit 1, 4 for bit 2 and so on, up to 32768 for bit 15. If you don't understand about bits and bytes please refer to the FAQ subforum where there's a thread to help. Is it possible to operate a Lua program on the Wideclient (slave) pc by request rather than at start up? Preferably via a button on either the Button screen on the slave pc or a button on the master (fsx) pc WideClient automatically runs any Lua it finds in its folder. You'd need to have a signal sent to an already running Lua program to activate it. One way would be to use one or more of the User offsets (66C0-66FF), For example, assign your button to the Offset ubyte set control, setting it non-zero, and in the already-running Lua just have the one event, event.offset, on that byte. So nothing happens in the Lua program til the byte is set. The function it calls could contain the other event functions you might need for it to then carry on normally. You could also turn it off the same way, with a function then deeting all the other events. If you want a lot of such WideFS plug-ins, it might be best to use a bit for each, using Offset byte setbits, or maybe Offset byte togglebits, depending on your button or switch, and event.offsetmask in the plug-in.. Pete
DEN19 Posted May 8, 2015 Author Report Posted May 8, 2015 Thank you, I will try this. I'm also trying to get the wnd.bitmap command to work but it constantly returns the following error LUA Error: ...sers\den\Documents\WideClient690 - Copy\announce.lua:10: attempt to call field 'bitmap' (a nil value) The command is wnd.bitmap(w1, "C:\\Users\\den\\Pictures\\Annunciatorgreenoff") The complete script is : - w1 = wnd.open("Paused", WND_FIXED, -154,10,90,50) -- function to operate window colourfunction Paused(off,val) if val ~= 1 then wnd.bitmap(w1, "C:\\Users\\den\\Pictures\\Annunciatorgreenoff") else wnd.bitmap(w1, "C:\\Users\\den\\Pictures\\Annunciatorgreenon") end end event.offset(0x0264, "UW", "Paused") The window is created but remains white. The pathname is copied from the Properties panel and I have put the extra \ in where needed. The file definitely exists. I've tried adding the .bmp at the end of the filename but that doesn't work either. It is probably something so obvious but I can't see it. Please tell what I am doing wrong|
Pete Dowson Posted May 8, 2015 Report Posted May 8, 2015 I'm also trying to get the wnd.bitmap command to work but it constantly returns the following error It just means that the wnd.bitmap function isn't in the version of WideClient you are using. It needs to be version 6.999g or later. Pete
DEN19 Posted May 9, 2015 Author Report Posted May 9, 2015 :oops: Doh, what an eedyot. I run 2 copies of Wideclient on the slave pc. I updated copy 1 but forgot to do copy 2, which only gets used now and then depending on what I fly. Now working, thanks Pete.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now