Jump to content
The simFlight Network Forums

Recommended Posts

Hi ,

 

I have a , Flight Simulator X and accelaration pack  installed in c:\fsx folder and registred copy of  fsuipc version 4.947c  on windows 8.1 pro.

 

I copy these files to the modules directory,

 

record to csv.lua

ipcDebug.lua

display_vals.lua

 

and edit  fsuipc.ini  file.

 

[Auto]
1=display_vals
2=ipcDebug
3=record to csv

[LuaFiles]
1=display_vals
2=ipcDebug
3=record to csv

 

I run the fsx but nothing hapend.

 

What I'm missing or what's missing. Please help me.

 

best regards

 

Goksel

 

 

 

Link to comment
Share on other sites

I copy these files to the modules directory,

 

record to csv.lua

ipcDebug.lua

display_vals.lua

 

and edit  fsuipc.ini  file.

 

[Auto]

1=display_vals

2=ipcDebug

3=record to csv

[LuaFiles]

1=display_vals

2=ipcDebug

3=record to csv

 

I run the fsx but nothing hapend.

 

Three big errors:

 

1. You do NOT add a "LuaFiles" section. FSUIPC does that automatically. It is not a user-editable section at all, it is just the way FSUIPC keeps track of assignments, in Buttons, Keys or Axes sections to Lua plug-ins.

 

 

2. The [Auto] sections are for Macros and Lua plugins. Please please do refer to the section entitled

Automatic running of Macros and Lua plugins in the FSUIPC4 advanced users guide.

 

FSUIPC has no way to understand what it is you mean by 

1=display_vals2=ipcDebug3=record to csv

because those are all in the wrong format. It would think they are Macro filenames, but with the contained macro name missing (it should folow a : character, as shown in the example). Lua plugins are run by the Lua command as shown in the documentation.

 

3. The supplied ipcDebug lua package s NOT usable on its own. It is automatically preloaded when you use the LuaDebug control. It is very rarely used these days as FSUIPC now has a more automatic Lua/ Debug/Trace option, enabled in its Logging Tab.

 

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

 

Please do not rush in trying to use things before looking them up.
 
Pete
Link to comment
Share on other sites

  • 1 year later...

Hi all!

I need help with a small addition of file "display vals.lua" from the archive FSUIPC "example LUA plugins.zip".

I'm not strong in programming in LUA and C++. and need this script to append the output function of flight parameters (altitude, speed, etc.) to a file *.txt

Thank you, who can help me with this small addition.

Edited by Alex Bodrov
Link to comment
Share on other sites

On 2/17/2017 at 4:53 AM, Alex Bodrov said:

I need help with a small addition of file "display vals.lua" from the archive FSUIPC "example LUA plugins.zip".

I'm not strong in programming in LUA and C++. and need this script to append the output function of flight parameters (altitude, speed, etc.) to a file *.txt

But "display vals.lua" is not about creating a file with values. You should use the "record to csv.lua" example as a base.  It has most of the values you might be interested in already. Just change the filename it uses if you wish.

Pete

 

Link to comment
Share on other sites

8 hours ago, Pete Dowson said:

But "display vals.lua" is not about creating a file with values. You should use the "record to csv.lua" example as a base.  It has most of the values you might be interested in already. Just change the filename it uses if you wish.

Pete

 

One more question, please.

How to make rows not added, they need to be overwritten?

Link to comment
Share on other sites

16 minutes ago, Pete Dowson said:

The file created is intended to be a log. If you need the file to be replaced every time by a new one then you need to change the parameters in the open function call. I suggest you use the reference documents supplied. The file access library has its own document.

Pete

 

 'r' 'w' 'a' 'r+' 'w+' 'a+'  
Link to comment
Share on other sites

2 hours ago, Alex Bodrov said:

I tried to put these values, but it did not help me

Sorry, you need to be more explicit. What values did you put in where? What are you now trying to do? I can't help you with no information at all!

Why are you trying to create some file if you don'tknow what you are doing?

Pete

 

Link to comment
Share on other sites

i want just one line that should be updated, and not a several of new lines. is there a way to manage this? and where should i change the script to let it do this?

i need to create a new script, or you can make changes to a file Record_csv and to achieve the desired result?

thanks !

Link to comment
Share on other sites

3 hours ago, Alex Bodrov said:

i want just one line that should be updated, and not a several of new lines. is there a way to manage this? and where should i change the script to let it do this?

Files are not designed to be changed all the time. the only way to do that easily is to create a new file every time, as I said. Please look back to my earlier message where I clearly explained this. You appear to have completely ignored what I said. Here, I'll repeat it now:

15 hours ago, Alex Bodrov said:

The file created is intended to be a log. If you need the file to be replaced every time by a new one then you need to change the parameters in the open function call. I suggest you use the reference documents supplied. The file access library has its own document.

Did you even bother to look for the "open" function?  Are you really not wanting to help yourself and do any investigation yourself?  And as I asked earlier, why are you trying to create some file if you don't know what you are doing?  What is using this file?

Anyway, just look at the script. I think the "open" is in the very first line, after the comments at the top. There you can change the filename (from "FSrecord.csv")  and the way the file is opened (from "a+")

The "open" function is part of the Lua io library, which is documented in Lua reference books and on the Lua website.  Here, I've even found the right page in their documentation section:

https://www.lua.org/manual/5.3/manual.html#6.8

and here's the part on io.open:

io.open (filename [, mode])

This function opens a file, in the mode specified in the string mode. In case of success, it returns a new file handle.

The mode string can be any of the following:

  • "r": read mode (the default);
  • "w": write mode;
  • "a": append mode;
  • "r+": update mode, all previous data is preserved;
  • "w+": update mode, all previous data is erased;
  • "a+": append update mode, previous data is preserved, writing is only allowed at the end of file.

The mode string can also have a 'b' at the end, which is needed in some systems to open the file in binary mode.

Do you think you can understand that? It is pretty clear.  Change the mode to whatever you want to happen to the file!

I shouldn't have to do all this searching when you need to be perfectly capable of looking for yourself. And if you ignore me again I may not bother replying. I don't see any point in answering the same question all the time.

Pete

 

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.