Jump to content
The simFlight Network Forums

Annunciators


Recommended Posts

Pete

I am looking to the poosibility of adding some annunciators to my slave pc for such things as generator lights, fuel cut-offs etc, which will show one colour if not running and anothern if running.

to do this in the usual way with output cards and LEDs will be expensive so it set me thinking...

Is this possible with a Lua script to read the required offset and display, say, a .jpeg image on the slave pc- although I am not sure how it could be done. I cannot see how the image will work just on the desktop, so it would require another program running to display it.

Conversely could a Lua scrip be used to alter the state of a toggle in my button screen (again based on reading the value of an offset) from,say, red to green and vice versa. The toggle would not drive anything in FSX but only be used solely as a display for whatever info was needed to be displayed. This has the advantage that the text on the button would be programmable to anything needed.

Or could Wideclient be made to do this itself?

Or is there another way to do it?

Your thoughts would be much appreciated.

Den

Link to comment
Share on other sites

Is this possible with a Lua script to read the required offset and display, say, a .jpeg image on the slave pc- although I am not sure how it could be done.

I've just finished working on a Lua library called "wnd" (short for "window"), which allows text windows to be created, closed and text written in them. This doesn't support images, but it does allow both the backgound colour and the text colour to be changed. So you could, at a pinch, just have one or more small windows, clear of text, but with different colours, which you could change at any time based on offset values.

The windows have a sizing border and a title. You could put the indication label in the title, or have it like a backlit label in the window itself.

I can't think of any other way at present without additional programs or other changes. The wnd library is in WideClient 6.95, just released, but I've not updated the Lua documentation yet. I can give you a little plua plug-in to do this, though, if you like. I'll be doing the documentation tomorrow, with luck.

Conversely could a Lua scrip be used to alter the state of a toggle in my button screen (again based on reading the value of an offset) from,say, red to green and vice versa.

No, not at present. I could have a look at that. Currently the ButtonScreen is completely independent of other parts of Wideclient. If I implemented that it would have to be by the Button Number controlled by that position, so any change wouldn't be seen if the page with that button number wasn't currently shown.

Regards

Pete

Link to comment
Share on other sites

Pete

Thanks for the quick reply.

I can give you a little plua plug-in to do this, though, if you like. I'll be doing the documentation tomorrow, with luck.

Yes I would like to try that.

No, not at present. I could have a look at that. Currently the ButtonScreen is completely independent of other parts of Wideclient. If I implemented that it would have to be by the Button Number controlled by that position, so any change wouldn't be seen if the page with that button number wasn't currently shown.

That would be my prefferred way. Can I run multiple instances of Wideclient on the slave pc or would that be impossible. If so, I could then have a one-page BS running on a second monitor on the slave which would just be for annunciators. I could then add a cut-out to the MIP for the display to show through.

Of course, if the plug works OK then may not be be needed anyway.

Den

Link to comment
Share on other sites

Yes I would like to try that.

Okay. I have to go out this evening, but I'll make a little example later.

That would be my prefferred way. Can I run multiple instances of Wideclient on the slave pc or would that be impossible.

You can run multiple copies using TCP protocol (the main one can use UDP), but setting different numbers for the "ClassInstance" parameter. I have one client running several programs and two button screens, Applications only connect to the ClassInstance=0 copy.

Regards

Pete

Link to comment
Share on other sites

Okay. I have to go out this evening, but I'll make a little example later.

Try this:


-- create one or more windows
w1 = wnd.open("Paused", 0,0,200,140)

wnd.font(w1, WND_ARIAL, 30.0, WND_BOLD) --Font, Size, Properties

-- function to operate window colour
function Paused(off,val)
if val ~= 0 then
wnd.backcol(w1, 0xf00) --Set red when paused
wnd.textcol(w1, 0xfff)
wnd.clear(w1)
wnd.text(w1, "\n\n\tPAUSED")
else
wnd.backcol(w1, 0x0f0) --Set Green when unpaused
wnd.textcol(w1, 0x000)
wnd.clear(w1)
wnd.text(w1, "\n\nUNPAUSED")
end
end

event.offset(0x0264, "UW", "Paused")[/CODE]

Save it in the same folder as Wideclient.exe version 6.95 or later, named, say, "announce.lua". You can add more windows, for events, more offsets, colours etc.

This isn't really the sort of application I had in mind for this facility. It was more for text displays like checklists, logs, performance data, whatever. For this application you'd really not want title bars ad thick borders and so on.

I'll look at putting Lua programmable features into the ButtonScreen facilities in any case.

Regards

Pete

Link to comment
Share on other sites

This isn't really the sort of application I had in mind for this facility. It was more for text displays like checklists, logs, performance data, whatever. For this application you'd really not want title bars ad thick borders and so on.

I'll look at putting Lua programmable features into the ButtonScreen facilities in any case.

Having now tried it out see what you mean, it's not really right for the situation. I'll wait for the BS facility instead. I've already set up a second instance of Wideclient ready for use.

Thanks again

Den

Link to comment
Share on other sites

Having now tried it out see what you mean, it's not really right for the situation. I'll wait for the BS facility instead. I've already set up a second instance of Wideclient ready for use.

Okay. Since version 6.95 I have added a fixed window option, which has no borders and no title bar, so it would work with that. The only problem with that is it isn't movable or closable by the user without borders or title bar, so you have to get it the right size in the Lua wnd.open call. However, once you have worked that out it would be simple enough to tile the screen with such windows.

I'm working on the ButtonScreen method. There will be a new ipc library function, ipc.setbtncol(buttonnum, red, blue, green) where the button number is 0-287 for the 288 possible button positions.

[LATER]

Okay. Download Wideclient 6.951.

Two things you can try. One is just edit that example Lua i provided early. Change the wnd.open line to:


w1 = wnd.open("Paused", WND_FIXED, 10,10,190,110)[/CODE]

That's one way. Try it anyway, just to see.

Otherwise, use your button screen and change colours by using:

[b]ipc.setbtncol( button, red, green, blue)[/b]

where button number is 0-287 for the 288 possible buttons (but don't select one designated for Toggle, because that controls its own colour),

and the colour values are each 0-255. Block would be 0,0,0 and white 255,255,255.

Have fun.

Regards

Pete

Link to comment
Share on other sites

I'm working on the ButtonScreen method. There will be a new ipc library function, ipc.setbtncol(buttonnum, red, blue, green) where the button number is 0-287 for the 288 possible button positions.

Whoops. Sorry, the colours should of course be red, green, blue. (RGB, the standard order).

I edited the original post too in case others use it.

Pete

Link to comment
Share on other sites

One is just edit that example Lua i provided early. Change the wnd.open line to:

w1 = wnd.open("Paused", WND_FIXED, 10,10,190,110)

That's one way. Try it anyway, just to see.

Tried this out now and it works OK. I can see that this can easily be used to produce a bank of annunciators for anything that info can be read from FSX offsets. Brilliant job.

One question- the parameters for the positioning of the window, in this instance 10, 10, 190, 110, obviously refer to the position and size on the main screen on the desktop. How do I position it on another monitor on the same pc. I have 3 monitors on the desktop on my slave and want to position it on none of the others.

I've not tried the BS one so fsr but will later today. I am assumimg that the action from the ipc.setbtncol( button, red, green, blue) command will only be actioned on the instance of Wideclient that the Lua file is stored with. Am I correct in that?

Den

Link to comment
Share on other sites

One question- the parameters for the positioning of the window, in this instance 10, 10, 190, 110, obviously refer to the position and size on the main screen on the desktop.

Yes: x, y, cx, cy

x = horizontal-position of top left corner, in pixels, counting left-to-right.

y = vertical-position of top left corner, in pixels, counting top-to-bottom.

cx = window width in pixels

cy = window height in pixels

How do I position it on another monitor on the same pc. I have 3 monitors on the desktop on my slave and want to position it on none of the others.

Windows uses x,y coordinates which extend from the top left corner of the leftmost topmost screen to the bottom right corner of the rightmost bottommost screen. The top left of the main windows screen is always 0, 0, so any left or above that will have negative values for coordinates.

So, it's either a matter of trial and error, or working it out. The relative positions of screens are controlled and shown in the Windows screen applet, and that also controls the resolutions in use, so you can compute positions and sizes.

I've not tried the BS one so fsr but will later today. I am assumimg that the action from the ipc.setbtncol( button, red, green, blue) command will only be actioned on the instance of Wideclient that the Lua file is stored with. Am I correct in that?

Yes, of course. There's no other way of doing it. Nothing else but the instance of Wideclient providing the ButtonScreen knows anything about where the buttons are.

I'm adding another ButtonScreen function in Lua: to set the state of a Toggle button, so that I can make the Red or Green state indication reflect the relevant offset setting in FS.

Regards

Pete

Link to comment
Share on other sites

Windows uses x,y coordinates which extend from the top left corner of the leftmost topmost screen to the bottom right corner of the rightmost bottommost screen. The top left of the main windows screen is always 0, 0, so any left or above that will have negative values for coordinates.

Damn-Should have thought of that myself!

I'm adding another ButtonScreen function in Lua: to set the state of a Toggle button, so that I can make the Red or Green state indication reflect the relevant offset setting in FS.

You set me thinking, I may not actually need a second instance of BS now to act as annunciators.

Since each button can be controlled to visually reflect the status of the offset they effectively become self-indicating and always refect the condition of the parameter they are controlling. Just like self-illuminating switches in RW.

I'm off to play again.

Den

Link to comment
Share on other sites

Damn-Should have thought of that myself!

Actually, I thought of another way -- and i've tested it here, and it works.

The Lua ext library can be used to move and size the window on any screen, by screen number, and any position/size as a proportion of the screen size. For instance, in the example from earlier:

w1 = wnd.open("Paused", WND_FIXED, 10,10,190,110)
ext.position("Paused", 50,50,25,25,2)[/CODE]

The "Paused" window will go to Screen 2, top left positioned at dead centre (50% across, 50% down) and have a width equal to 25% of that screen width and height 25% of that screen height.

So using that you can tile the windows all over any screen you like without resorting to pixel counts!

You set me thinking, I may not actually need a second instance of BS now to act as annunciators.

Since each button can be controlled to visually reflect the status of the offset they effectively become self-indicating and always refect the condition of the parameter they are controlling. Just like self-illuminating switches in RW.

Yes, but currently that won't work with buttons on the button screen designated as "Toggle" (T or TN). They send a "press" and "release" on alternate presses, to simulate a proper toggle switch rather than a button, and change their own colour from their defalut to RED when the press is sent.

I've just added and tested this facility:

[b]ipc.setbtnstate(button, state)[/b]

which tells the ButtonScreen to assume the toggle is in its "pressed" state if [b]state [/b]is non-zero, but in its released state if that parameter is zero.

Using this I have the Lua plug-in working for my cockpit (this is just an extract). Note that there are duplicate buttons for some things, like Pause and Slew, because I have many button-selectable pages in my ButtonScreen setup, and common needs like Pause are replicated in most pages.

[CODE]
-- Set Toggle button states to match FS settings
function mkrsound(off,val)
ipc.setbtnstate(2, logic.And(val, 4))
end
event.offset(0x3122, "UB", "mkrsound")

function pause(off,val)
ipc.setbtnstate(20, val)
ipc.setbtnstate(44, val)
ipc.setbtnstate(68, val)
ipc.setbtnstate(92, val)
ipc.setbtnstate(116, val)
ipc.setbtnstate(140, val)
ipc.setbtnstate(163, val)
end
event.offset(0x0264, "UW", "pause")

function trafficoff(off, val)
ipc.setbtnstate(21, val == 0)
ipc.setbtnstate(45, val == 0)
end
event.offset(0x0250, "UB", "trafficoff")

function doors(off,val)
ipc.setbtnstate(31, logic.And(val, 1))
ipc.setbtnstate(35, logic.And(val, 2))
ipc.setbtnstate(39, logic.And(val, 4))
end
event.offset(0x3367, "UB", "doors")

function slew(off,val)
ipc.setbtnstate(96, val)
end
event.offset(0x05dc, "UW", "slew")[/CODE]

I' ll upload WideClient 6.952 with this addition within the hour ...

Regards

Pete

Link to comment
Share on other sites

So using that you can tile the windows all over any screen you like without resorting to pixel counts!

That certainly makes the arithmetic easier for setting it up.

Yes, but currently that won't work with buttons on the button screen designated as "Toggle" (T or TN). They send a "press" and "release" on alternate presses, to simulate a proper toggle switch rather than a button, and change their own colour from their defalut to RED when the press is sent.

What I am thinking is that instead of using toggles in the BS this new facility means that an ordinary button can be used and then use the Toggle facility in FSX with the feedback to the button colour for indication.

For example I currently have one toggle on my BS for Master Battery- set to red when fsx loads up and which goes to green when I switch it on. That's fine as long as I do a C & D start, which I usually do, but it can be thrown out of sync. This is especially so if I am in shared cockpit mode on multiplayer, a position I find myself in more and more since I joined an on-line GA flying club (CIX VFR). In this position when the other person switches on the master switch mine remains red. With the new ipc.setbtncol addition I hope mine will turn to green when he switches it on.

I'm sure there will be some instances where this cannot be applied though.

I will actually have to use both the options you have come up with (the wnd and btn functions) because my cockpit has some functions controlled through the BS and some through real switches/pushbuttons via Bu0836X and KE72 interfaces. For the latter I will need some annunciators separate to the BS. Again this just reflects RW practices though.

Den

Link to comment
Share on other sites

What I am thinking is that instead of using toggles in the BS this new facility means that an ordinary button can be used and then use the Toggle facility in FSX with the feedback to the button colour for indication.

Yes, but that way you forgo the ButtonScreen's toggle facility (i.e. sending alternately "press" and "release" instead of press-release with each press), and are forced to use the button flag method of making buttons into toggles in the FSUIPC INI. I agree both would work fine, but if you are happy with "Red" for "On" the BS toggle option along with the use of the setbtnstate function is easier.

I will actually have to use both the options you have come up with (the wnd and btn functions) because my cockpit has some functions controlled through the BS and some through real switches/pushbuttons via Bu0836X and KE72 interfaces. For the latter I will need some annunciators separate to the BS.

Or just use up some of the 288 buttons as indicators without assigning actions in FSUIPC.

BTW WideClient 6.952 is up now.

Regards

Pete

Link to comment
Share on other sites

Just got the time now to try it out with the new setbtnstate command. It works well and I think, along with the other 2 add-ins already tried that it gives me excellent flexibility to do all I originally wanted in terms of annunciators and, probably, a lot of other stuff I haven't even thought of yet but you probably have!.

Or just use up some of the 288 buttons as indicators without assigning actions in FSUIPC

The only problem with this is that my buttons are spread across several pages so , as you pointed out, I wouldn't necessarily see them "lighting up". That is why I will probably buid a bank of "idiot lights" as well.

Again many thanks for your support.

All it needs now is the ability to play an audible tone when on of the buttons changes state.

(thinks to self) Now- how can I do that?...........

Regards

Den

Link to comment
Share on other sites

All it needs now is the ability to play an audible tone when on of the buttons changes state.

(thinks to self) Now- how can I do that?...........

Easy. use the Lua sound library.

BTW the Lua updated documentation is now posted -- see the Download Links subforum.

Pete

Link to comment
Share on other sites

Easy. use the Lua sound library.

BTW the Lua updated documentation is now posted -- see the Download Links subforum

Thanks- I knew you'd know the answer to that.

w1 = wnd.open("Paused", WND_FIXED, 10,10,190,110)

ext.position("Paused", 50,50,25,25,2)

Question. If using the ext.position command do I still need to use the positional data (10,10,190,110) in the wnd.open command?

Den

Link to comment
Share on other sites

Pete

Now managed to try out the setbtnstate in multiplayer. It's great to watch the toggles change colour as the other pilot swiches things on and off.

I've noticed a couple of things to do with the following code, using the wnd command,which I can't fathom out- despite staring at it for too long ( something to do with trees and woods I think).

w1 = wnd.open("Alt1", WND_FIXED)

ext.position("Alt1", 43,1,6,2,1)

wnd.font(w1, WND_ARIAL, 12.0, WND_BOLD) --Font, Size, Properties

-- function to operate window colour

function Alt1(off,val)

if val ~= 1 then

wnd.backcol(w1, 0xf00) --Set red when off

wnd.textcol(w1, 0xfff)

wnd.clear(w1)

wnd.text(w1, "\n\n\tALT 1")

else

wnd.backcol(w1, 0x0f0) --Set Green when on

wnd.textcol(w1, 0x000)

wnd.clear(w1)

wnd.text(w1, "\n\n\tALT 1")

end

end

event.offset(0x3101, "UB", "Alt1")

w2 = wnd.open("Alt2", WND_FIXED)

ext.position("Alt2", 49,1,6,2,1)

wnd.font(w2, WND_ARIAL, 12.0, WND_BOLD) --Font, Size, Properties

-- function to operate window colour

function Alt2(off,val)

if val ~= 1 then

wnd.backcol(w2, 0xf00) --Set red when o wnd.textcol(w2, 0xfff) --

wnd.clear(w2)

wnd.text(w2, "\n\n\tALT 2")

else

wnd.backcol(w2, 0x0f0) --Set Green when on

wnd.textcol(w2, 0x000)

wnd.clear(w2)

wnd.text(w2, "\n\n\tALT 2")

end

end

event.offset(0x3ab8, "DD", "Alt2")

-----------------------------------------------------

w3 = wnd.open("Alt3", WND_FIXED)

ext.position("Alt3", 55,1,6,2,1)

wnd.font(w3, WND_ARIAL, 12.0, WND_BOLD) --Font, Size, Properties

-- function to operate window colour

function Alt3(off,val)

if val ~= 1 then

wnd.backcol(w3, 0xf00) --Set red when paused

wnd.textcol(w3, 0xfff)

wnd.clear(w3)

wnd.text(w3, "\n\n\tALT 3")

else

wnd.backcol(w3, 0x0f0) --Set Green when unpaused

wnd.textcol(w3, 0x000)

wnd.clear(w3)

wnd.text(w3, "\n\n\tALT 3")

end

end

event.offset(0x39f8, "DD", "Alt3")

------------------------------------------------------

w4 = wnd.open("Alt4", WND_FIXED)

ext.position("Alt4", 61,1,6,2,1)

wnd.font(w4, WND_ARIAL, 12.0, WND_BOLD) --Font, Size, Properties

-- function to operate window colour

function Alt4(off,val)

if val ~= 1 then

wnd.backcol(w4, 0xf00) --Set red when paused

wnd.textcol(w4, 0xfff)

wnd.clear(w4)

wnd.text(w4, "\n\n\tALT 4")

else

wnd.backcol(w4, 0x0f0) --Set Green when unpaused

wnd.textcol(w4, 0x000)

wnd.clear(w4)

wnd.text(w4, "\n\n\tALT 4")

end

end

event.offset(0x3938, "DD", "Alt4")

---------------------------------------------------

1. The windows are supposed to appear on one screen, and they always do, but occasionally when Wideclient is started one witll appear on the main screen as well, and when it does it is huge, roughly a quarter of the screen in size with no text in it. It then won't disappear until Wideclient is closed.

2. The windows text is supposed to be white or black, depending on the b/g colour, but in one of them (Alt2) it is always black- and I can't figure out what I've done wrong. Please help.

Finally a question. Can the wnd command be used to display two types of text, one static and one based on data from FSX. What I'm thinking is an OAT gauge which reads the temp from fs and display it as "OAT nn ºC" with the nn read from fs and rest as static text?

Regards

Den

Link to comment
Share on other sites

1. The windows are supposed to appear on one screen, and they always do, but occasionally when Wideclient is started one witll appear on the main screen as well, and when it does it is huge, roughly a quarter of the screen in size with no text in it. It then won't disappear until Wideclient is closed.

Sorry, I'm a little confused. You say:the windows are "supposed to appear on one screen, and they always do", but then go on to say sometimes they don't?

The default size, because you omitted it in the opening call, would probably be something like a quarter of the screen. It sounds like the "ext.position" call is being executed before the opening of the window has been completed, so it doesn't find it. Try inserting an "ipc.sleep(5)" after each wnd.open call, just to be sure. Or, alternatively, do all your wnd.opens then all the ext.positions.

2. The windows text is supposed to be white or black, depending on the b/g colour, but in one of them (Alt2) it is always black- and I can't figure out what I've done wrong. Please help.

Ah, that's easy ... You have a line

wnd.textcol(w2, 0x000)

setting black when you set the background to green, but no equivalent

wnd.textcol(w2, 0xfff)

to set it white in the other case.

Finally a question. Can the wnd command be used to display two types of text, one static and one based on data from FSX.

Of course. Lua doesn't know or care where the text comes from or how it is generated. It just displays whatever string you provide. Luas variables can be strings or numbers, and Lua converts one to the other automatically.

What I'm thinking is an OAT gauge which reads the temp from fs and display it as "OAT nn ºC" with the nn read from fs and rest as static text?

If the OAT is read into a variable "oat" that would simply be something like:

wnd.text(w, "OAT " .. oat .. "C")

depending on whether "oat" was read as an integer or a floating point value. If it was floating point the more accurately youd use the 2string.format2 function,

str = string.format("OAT %2.0fC", oat + 0.5)

wnd.text(w, str)

I added 0.5 to round up when the temperature is x.5 or more.

Regards

Pete

Link to comment
Share on other sites

Sorry, I'm a little confused. You say:the windows are "supposed to appear on one screen, and they always do", but then go on to say sometimes they don't?

Sorry for the confusion.

They always appear on the correct screen but sometimes one appears on the home scree1 as well. Of couse there may be more than one super-imposed on each other, I never thought to check. I'll try the delay and report back.

Ah, that's easy ... You have a line

wnd.textcol(w2, 0x000)

setting black when you set the background to green, but no equivalent

wnd.textcol(w2, 0xfff)

to set it white in the other case.

Thanks Pete, don't know how I missed that, they were all just copied and pasted from the first entry- or so I thought.

s

If the OAT is read into a variable "oat" that would simply be something like:

wnd.text(w, "OAT " .. oat .. "C")

depending on whether "oat" was read as an integer or a floating point value. If it was floating point the more accurately youd use the 2string.format2 function,

str = string.format("OAT %2.0fC", oat + 0.5)

wnd.text(w, str)

Thanks I'll try that tomorrow as well.

Regards

Den

Link to comment
Share on other sites

Ah, that's easy ... You have a line

wnd.textcol(w2, 0x000)

setting black when you set the background to green, but no equivalent

wnd.textcol(w2, 0xfff)

to set it white in the other case.

I've just noticed, it was there but stuck on the end of the line above. Somehow the "return" had been lost and just needed re-inserting. See below.

wnd.backcol(w2, 0xf00) --Set red when o wnd.textcol(w2, 0xfff) --

The ipc.sleep did the job, the windows flash up on the main screen but immediately disappear.

I am struggling though with the OAT coding. I'm a complete novice with coding of any sort and have spent several hours fruitlessly trying to get it to work. I only managed to get the other windows to work by blatantly plagiarising your notes above.

What I have tried is shown below and it won't even get the window to display, never mind put any text in it. And as I don't have much hair left these days I can't afford to tear any of it out!

w5 = wnd.open("OAT", WND_FIXED)

ipc.sleep(5)

ext.position("OAT", 43,5,12,2,1)

wnd.font(w5, WND_ARIAL, 12.0, WND_BOLD)

wnd.backcol(w5, 0xf00)

wnd.textcol(w5, 0xfff)

wnd.clear(w5)

wnd.text(w, "OAT " .. temp .. "C")

end

--str = string.format("OAT %2.0fC", oat + 0.5)

temp = ipc.readSW(0x0e8c)

I would very much appreciate it if you would show me how to do it, with as short explanation so I can learn for the future- if you can spare the time.

Thanks

Den

Link to comment
Share on other sites

The ipc.sleep did the job, the windows flash up on the main screen but immediately disappear.

You could get rid of that by setting 0,0,0,0 for the position and size values in the wnd.open function.

What I have tried is shown below and it won't even get the window to display, never mind put any text in it. And as I don't have much hair left these days I can't afford to tear any of it out!

w5 = wnd.open("OAT", WND_FIXED)
ipc.sleep(5)
ext.position("OAT", 43,5,12,2,1)
wnd.font(w5, WND_ARIAL, 12.0, WND_BOLD)
wnd.backcol(w5, 0xf00)
wnd.textcol(w5, 0xfff)
wnd.clear(w5)
wnd.text(w, "OAT " .. temp .. "C")

end[/CODE]

What is that "end" the end of? you've not had any beginning to warrant an "end".

If you look at the FSUIPC log you will surely see the error message telling you this! If there's an error in the program it cannot compile, but the error message will tell you what the error is and even which line it is in! Have you never looked?

[CODE]--str = string.format("OAT %2.0fC", oat + 0.5)
temp = ipc.readSW(0x0e8c)[/CODE]

What is this intended to do? The first line there is a comment (all lines starting -- are comments). Comments don't do anything except inform the reader of the code.

Even if it wasn't a comment, it seems to be trying to make a string "OAT nnC" with a value named "oat" which hasn't been set by anything yet. Then the string, 'str', is never used in any case!

Then the next line sets "temp" from the offset 0E8C, yet "temp" is never used for anything before the whole thing suddenly ends.

Please explain how you arrived at all this ...? If you are pulling lines at random from other things, then I think you should stop, and tthink a little instead. You can't make programs that work with random lines. Well, you can i suppose but the chances are extremely remote, the same as a roomful of monkeys with typewrites coming up with the works of Shakespeare! ;-)

Pete

Link to comment
Share on other sites

All you have said above just bears out what I said that I do not have any idea about how to write the coding I need to get a window to display the OAT for me. I was doubtful about including the code because it was clear to me that it was a load of old rubbish. That is why I came asking for help.

If you look at the FSUIPC log you will surely see the error message telling you this! If there's an error in the program it cannot compile, but the error message will tell you what the error is and even which line it is in! Have you never looked?

No, because I didn't realise that the log would include any information that would help me. Another lesson learnt! W

hether I would have understood what to do from the message there is debatable anyway. What comes easy to you as an expert is like Double Dutch to a novice like me.

Please explain how you arrived at all this ...? If you are pulling lines at random from other things, then I think you should stop, and tthink a little instead. You can't make programs that work with random lines. Well, you can i suppose but the chances are extremely remote, the same as a roomful of monkeys with typewrites coming up with the works of Shakespeare! ;-)

To be or not to xsdnmfskljnbfgb;jkv..... :razz:

There's probably more chance of that than me getting the code I need correct, but I was hoping that, with some helpful advise I might learn how to get there. I've spent about 8 hours this weekend trying to understand what to do and how to do it- from the Lua handbook, which I found hardgoing, to Google, and got nowhere.

That's why I need help.

Den

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.