Goksel Sunar Posted October 13, 2015 Report Posted October 13, 2015 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_vals2=ipcDebug3=record to csv[LuaFiles]1=display_vals2=ipcDebug3=record to csv I run the fsx but nothing hapend. What I'm missing or what's missing. Please help me. best regards Goksel
Pete Dowson Posted October 13, 2015 Report Posted October 13, 2015 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
Goksel Sunar Posted October 13, 2015 Author Report Posted October 13, 2015 thank you for your interest . i did it some thing. First , I do NOT add a "LuaFiles" section. I create one lua file and assign to F6 key in the "FSUIPC Options and Settings" windows and , if I hit F6 key in the simulation , this is working good now.
Pete Dowson Posted October 13, 2015 Report Posted October 13, 2015 First , I do NOT add a "LuaFiles" section. Good, though you said you did. Pete
Alex Bodrov Posted February 17, 2017 Report Posted February 17, 2017 (edited) 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 February 17, 2017 by Alex Bodrov
Pete Dowson Posted February 18, 2017 Report Posted February 18, 2017 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
Alex Bodrov Posted February 18, 2017 Report Posted February 18, 2017 (edited) thank you! I`m very inattentive! did not see this file Edited February 18, 2017 by Alex Bodrov
Alex Bodrov Posted February 18, 2017 Report Posted February 18, 2017 (edited) One more question, please. How to make rows not added, they need to be overwritten? Edited February 18, 2017 by Alex Bodrov
Alex Bodrov Posted February 18, 2017 Report Posted February 18, 2017 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?
Pete Dowson Posted February 18, 2017 Report Posted February 18, 2017 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
Alex Bodrov Posted February 18, 2017 Report Posted February 18, 2017 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+'
Alex Bodrov Posted February 18, 2017 Report Posted February 18, 2017 I tried to put these values, but it did not help me I'm sorry, but I'm a bad programmer))) I'm a good dentist
Pete Dowson Posted February 18, 2017 Report Posted February 18, 2017 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
Alex Bodrov Posted February 19, 2017 Report Posted February 19, 2017 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 !
Pete Dowson Posted February 19, 2017 Report Posted February 19, 2017 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
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