Jump to content
The simFlight Network Forums

looking for LUA script that set future pause in MSFS


Stevan

Recommended Posts

 I can't find it anywhere. I'm hoping that someone has it. The script name is SetPauseMSFS&P3D.lua or  PauseMSFS_TOD.lua

 

The SetPauseMSFS&P3D.lua script attached below makes use of the FSUIPC Lua event and wnd libraries (as suggested by John Dowson) and can be used to pause MSFS or P3Dv4.5/v5.1 from 1 minute to days after the script is run. When run, the script asks for a pause time and if none if provided within two minutes the script closes with a brief message. If a pause time is entered, for example 260 minutes until a Top of Descent, the user would see

image.png.70d7b4fa6f5e1eead8d34f49efca651c.png

Then after hitting the Enter key the display would change to

image.png.a8b2eff3bf5ae4c494f9756a325b12c1.png

This display will change once per minute as the time to pause counts down towards zero.

If the user decides to cancel the pending (future) pause with the Enter key, the display briefly changes to

image.png.663360d257147ae6669ecbd9bfefea8b.png

 

When the pause time is reached, the sim pauses and looks just like a pause had been initiated with the ESC key.  To cancel a paused sim you just need to click on Resume.

This script uses the wnd (Window ) library for display, so you can move the display window with the arrow keys and use the ctrl + arrow keys to resize the window. The window must have the focus to do this. The new window display position will be stored in your FSUIPC .ini file. As an alternative to using the arrow keys you can directly edit the window position and size coordinates in the FSUIPC7.ini file. Look for the entry under [ExtWindow].  It seems best to do this when FSUIPC7 is not running. You may also have to edit the window size and position in the lua file.

 

 

Link to comment
Share on other sites

8 hours ago, Stevan said:

 I can't find it anywhere. I'm hoping that someone has it. The script name is SetPauseMSFS&P3D.lua or  PauseMSFS_TOD.lua

Please see here: 

 

The script can be downloaded from there - you seemed to have pasted/copied the text from that topic, so I don't understand why you cannot see the script there that you can download....

John

Link to comment
Share on other sites

Thanks John,

Sorry and thanks , when I was on the site I clicked on the file, it would not download. This may be because I was not logged in at the time. I read the docs on LUA implementation, but I can't seem to see it in the button selection drop down box for commands. I have it listed in the FSUIPC7.ini 

[Auto]
1=SetPauseMSFS&P3D

I want to assign it to my ~ button. 

 

I'm in the middle of a 50-hour flight, do I need to stop FSUIPC7 and restart it to see the LUA?

What I'm I missing?

Steve

Link to comment
Share on other sites

1 minute ago, Stevan said:

Sorry and thanks , when I was on the site I clicked on the file, it would not download. This may be because I was not logged in at the time.

Yes, you need to be logged in to download files.

2 minutes ago, Stevan said:

I read the docs on LUA implementation, but I can't seem to see it in the button selection drop down box for commands.

If it is not listed in the assignments drop-down, then it is either not in the correct place or does not have the correct extension.

4 minutes ago, Stevan said:

I have it listed in the FSUIPC7.ini 

[Auto]
1=SetPauseMSFS&P3D

Why did you add it to be auto-started? You do now want to do this - and that is also incorrect (should be "1=Lua SetPauseMSFS&P3D"). Just remove it.

When FSUIPC is started, it scans the installation folder (by default, can change by using LuaPath ini parameter) and adds them to the [LuaFiles] section. All lua files listed there will be available for assignment. Do not manually add the file to that section, as this is maintained by FSUIPC.

Link to comment
Share on other sites

2 hours ago, Stevan said:

Added 1=Lua SetPauseMSFS&P3D to General section

Why? That makes no sense - remove that.

2 hours ago, Stevan said:

.Restarted FSUIPC7 it adds it to the LUAFiles section

As I said, any lua file found in the correct place will be added to that section.

2 hours ago, Stevan said:

Try to assign button to SetPauseMSFS&P3D but it does not show up in the drop down list

It will be under 'Lua SetPauseMSFS&P3D' (as well as LuaDebug, LuaKill, etc) - look there...

John

Link to comment
Share on other sites

1 hour ago, Stevan said:

Thanks I see it now, I was looking for it under the S commands. 

You don't seem to be at all familiar with how lua plugins work. I suggest you read the provided documentation - the FSUIPC Lua Plugins document to start with.

Please read the documentation BEFORE asking for support. I provide extensive documentation, and really would like users to consult the documentation before asking for help. This would save everyone time, and give me more time to improve/extend the functionality of FSUIPC, as well as improving the documentation. Currently I am spending almost all  of my time on support questions that are easily answered if people had read, or at least consulted, the documentation before posting for help... Not only ia this incredibly boring and frustrating for me, but it also stops me from improving the functionality provided as I just have no time left after covering support.

John

 

Link to comment
Share on other sites

You're right this is the first time dealing with LUA scripts. I did look at your plugin document in your Adv guide. It clearly states that the script should reside where the FSUIPC.ini file is and don't add anything to the [LuaFiles] section. But I missed or did not see anything as to what the new command selection should look like "Lua SetPauseMSFS&P3D", so I was looking for the "SetPauseMSFS&P3D" and I did the example like "1=Lua SetPauseMSFS&P3D" that went under Auto section. Thats why I added it, but I did not know that I did not need it.

I only see one page dealing with Lua plugins (pg-39).  Is there somewhere else it's list under?

Sorry for taking up your time on matter like this.

Steve 

Link to comment
Share on other sites

13 hours ago, Stevan said:

I did look at your plugin document in your Adv guide.

There is a separate document entitled FSUIPC Lua Plugins

13 hours ago, Stevan said:

But I missed or did not see anything as to what the new command selection should look like "Lua SetPauseMSFS&P3D",

From the aforementioned document:

Quote

When there are Lua files in the installation folder, FSUIPC adds a number of new controls for assignment in all of the usual places – Buttons & Switches, Key Presses, and Axis Assignments. The controls added for each Lua program are:

Lua <name>                       to run the named program
LuaDebug <name>            to run the program in debug mode (more below)
                                           This is actually superseded by the Trace Lua option in FSUIPC4’s Logging Tab
LuaKill <name>                  to forcibly terminate the named program, if it is running
LuaSet <name>                  to set a flag (0-255 according to parameter) specifically for the named program to test
LuaClear <name>               to clear a flag (0-255 according to parameter) specifically for the named program to test
LuaToggle <name>            to toggle a flag (0-255 according to parameter) specifically for the named program to test
LuaValue <name>              to set the ipcPARAM variable to the given parameter, or the axis value when so assigned

...

John

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.