
John Dowson
Members-
Posts
13,222 -
Joined
-
Last visited
-
Days Won
270
Content Type
Profiles
Forums
Events
Gallery
Downloads
Everything posted by John Dowson
-
No, mouse macros are not possible with MSFS2020.
-
Different actions for short and hold presses of the button
John Dowson replied to Georgy's topic in FSUIPC7 MSFS
Take a look at the TripleUse.lua script which is included in the lua examples (zipped in your FSUIPC7 Documents folder). There is also a more advanced version of this lua script available in the User Contributions sub-forum: You should be able to adapt either one of those for your needs. John -
The presets provided are a community effort, led by MobiFlight. If there are currently no presets available for this aircraft, it is because nobody has yet submitted any. You can define your own presets if you like, using the myevents.txt file (see Advanced user guide, WASM section). You should also submit any presets you create to MF, so that they can be used by others. However, looking at the Headwind A330, it does say that it is based on the FBW A32NX, so you may find that many of the presets for that aircraft also work with the A330.
-
To enable debugging in one script, just restart it by using the LuaDebug control. If you want to be able to turn debug logging on and off in a script without restarting it, add the following code to your lua script: Then, to turn on/off debugging in the script, you can assign a button or key press to the control LuaValue <scriptName> (where <scriptName> is the name of the lua script) with a parameter value of 1 for turning on debug logging, and 0 to turn it off. You can also change the debug logging function or the type of hook to suit your needs - again, see the ipcDebug.lua script for an additional debug logging function, and see the lua documentation on the debug library and the sethook function.
-
I am still not 100% sure in what you are trying to achieve.... If you want lua debug logging active in one script only, I have explained how to do that, If you want to be able to turn debug logging on and off in the script itself, this is not possible as things are. However, if you want to do this, you can add two additional functions to the ipcDebug.lua to add and remove the debug hooks, and then include/require that and use them. You can even use the ipcPARAM parameter to determine if debug logging should be enabled or not when you start the script, if you so wish. So, anything should be possible really. Just take a look at the ipcDebug.lua script, and look at the lua documentation for the debug.sethook function.
-
Whatever you want - this value is just passe to the lua script in the ipcPARAM variable.
-
"Debug mode" just means that the debug hooks have been activated in the script. This is done by either: - setting the Log -> Log Lua Plugins option. Will enable debug mode for all lua scripts started after this option is set - starting the script with the LuaDebug control - including (i.e. require) the ipcDebug.lua in the script. I seem to be saying the same thing again and again. I don't understand what you don't understand... Please see the FSUIPC Lua Plug-ins document.
-
Once a lua script is running in debug mode, you cam only stop the debug logging by killing the script and running it again. Similarly, if a script is running and you want to start debug logging for it. you need to kill it and restart it in debug mode. You can assign a button or key press to both Lua <script> and LuaDebug <scriot>. Starting a lua with such a control will kill the script, if already running, and restart it either without or with debugging, depending on the control used. Other than that, I am not sure what you are asking, If you don't want the cursor.lua script to log lines to the console, don't run it in debug mode and don't set the log option to run all lua scripts in debug mode. If you just want one (or more) scripts ran in debug mode, start those scripts with LuaDebug, or include the ipcDebug.lua script in them, as I have said,.
-
Please read the comments in how to use the trial license, If it is nor working ok after correct installation, you probably need to update your VC++ retistrubutables (instructions included in documentation). Otherwise, please post more info , including logs... J0hn,.
-
How to open Doors via Lua Script in MD11F
John Dowson replied to Airbuspilot's topic in FSUIPC7 MSFS
To use for read or write? To write, you can use the lua function ipc.control with the Offset Byte Set control - from page 33 of the Advanced User guide: x0100zzzz Offset Byte Set (offset = zzzz), hexadecimal As the offset holds the value for (up to) 8 doors, you need to read the current value, change the bit for the door you want to control (using the lua Logic library) and then write the value back. To read, just read the byte value and use the lua logic library to test each bit for the door needed. To get events on change, you can use the event.offsetmask function. However, this assumes that the aircraft is actually using this simvar... It could be, but many aircraft add-ons (and provided) don't actually use this simvar, and use lvars instead. So. before anything, try logging that offset (as an Unsigned Byte in hex) and see how it changes when you open/close the doors. If it changes as expected, then should be ok to use, but also be-aware of the note on this offset: Doors' states depend upon aircraft position (e.g. ramp, gate, or connected to jetway) and don't respond. Further information / Asobo support required. Seehttps://forum.simflight.com/topic/90252-door-offset-not-functifor further info. Sorry, but I don't have the MD11F so cannot look into this further for you. I will update the title of your post - please always include the aircraft if it is an aircraft-specific issue. John -
Are you sure the lua script was running? Can you set Logging = true in the HidDemo.lua script, set Log -> Log Lua Separately in FSUIPC7, and show me both your FSUIPC7.log and HidDemo.log files, as well as the HidScanner log file. For this issue, please set logging for Buttons & Keys and Events and generate a short FSUPC7.log file showing your issue, and attach that as well as your FSUIPC7.ini file. John
- 12 replies
-
- hidscanner
- hiddemo.lua
- (and 8 more)
-
Assignment facilities are only available in a registered/licensed version. If you don't have a license, and want to try these facilities, there is a trial license available in a post oat the top of this forum. If you have a license, you need to register it at the end of the installation process. John
-
The log shows the keys alt+ctl+2 being sent to the FS (both key presses and releases) and also being received back by FSUIPC. Is this key combination assigned in P3D, or in other software? The key combination is only sent to the FS. And it us never a good idea to use the alt key as a modifier, as this has a special meaning in windows for menu operation, which is why it was removed in FSUIPC7.
-
Delete the Window=... entry from the [General] section of your FSUIPC7.ini (when FSUIPC7 is not running) - this is the ini parameter that holds the window position and size.
-
Its a 1-byte or 8-bit address. Bit 1 (counting from 1) holds pump1, bit 2 holds pimp2, etc You need to read as a byte and use the logic library, e.g. n=ipc.readUB(0x3125) pump1 = logic.And(n, 0x1) -- 2^0 pump2 = logic.And(n, 0x2) -- 2^1 pump3 = logic.And(n, 0x4) -- 2^2 pump4 = logic.And(n, 0x8) -- 2^3 Offset 0x3104 only holds pump1, so that should match the state of the first bit in offset 0x3125. But that is not correct should be n=ipc.readUB(0x3104). You need to precede offset values with 0x, or use the string form, i.e. n=ipc.readUB("3104") John
-
The comment on offset 0x0B7C says: Fuel: left main tank level, % * 128 * 65536 So for a full tank, write 100*128*65536 as a an unsigned int. i.e. ipc.writeUD(0x0B7C, 838860800) John
-
It is compatible - no update needed. John
-
Ah, ok.... But there are already various ways to do this: - run the script you want to log with LuaDebug, and run the others without - run without lua logging and add ipc.log statements to the script you want to debug - include the ipcDebug.lua script in the lua file you want to debug. A lua function to control this just doesn't make much sense to me as the current lua log options are global - I think it would confuse people and would eventually result in further support requests, e.g. "why isn't my lua script being logged when I have set Log Lua Plugins?". Better to leave the global options as they are and use something specific (i.e. one of those 3 options mentioned above) for the script you want to debug.
-
For all issues with auto-start, please see the following FAQ entry: I am locking this topic. John
-
@yindengxie Not only is your question not related to the subject of this topic "FSUIPC7 doesn't start with MSFS2020" , it is also a question on P3D and this is the sub-forum for FSUIPC7. Please create a suitably titled post for your issue in the correct forum.
-
As does setting the Log -> Lua Plugins option. Why is the saitek script filling the log if you are logging your luas in separate files? If there is a separate script for polling your Saitek devices, this should be logged in a separate script. You can also start some scripts in debug mode, using the LuaDebug control. There is no ips.runluaDebug function. Otherwise, you could include the ipcDebug.lua in the scripts you want to debug. This is included in the provided lua example scripts (in your documents folder. If you take a look at that, you can see how the lua debug logging works - by setting hooks. You could also use this and add your own functions to both set and clear the hooks, and so enable/disable the debug level logging. I am busy the next few days but I can look into this further next week if needed.