Jump to content

All my products and services are free. All my costs are met by donations I receive from my users. If you enjoy using any of my products, please donate to support me. Thank you for your support. Tom Speirs

Patreon

Auto exit old B2S backglass


Darkmeteor

Recommended Posts

Just like a lot of people, I still have about 10% of my VP tables running these old B2S executables backglass because that's the only option right now. So I looked how it's done in fplaunch and made an autohotkey that will work with PinballX.

Basically what it will do is look at the table filename, and if it's named "sometableB2S.vpt" it will try to close a running backglass. The table HAS to be named like that (finishing with "B2S.vpt") as it's exactly what the script will look for before trying to close a B2S. Really, it's just like fplaunch, so anyone who was using this feature from fplaunch will already have all his tables with the right names !

It's a pretty simple autohotkey script, and it needs to be launched after the table exit with [TABLEFILE] as parameter, here's the content of the script :

If 0 > 0{	StringRight, ending, 1, 7	if (ending = "B2S.vpt")		{			WinKill, Form1		}}

I've added the ahk file as well as the compiled exe on my dropbox here : https://www.dropbox.com/sh/fg2ovlmtf08u6mi/viPoi3snby

  • Like 1
Link to comment
Share on other sites

Next time you setup a B2S table add the following at the bottom of a tables script.

Sub Table1_Exit():Controller.Stop:End Sub

(Table1 being the name of the table in visual pinball)

I don't expect you to go through and do every table but mine have been setup like this since the start of directb2s and controller.stop closes the b2s.

Link to comment
Share on other sites

I have at least two tables that are using the b2s exe's instead of direct and I never had a problem with them not closing when launched from pinballx. If I launch direct from vp they can remain open, though. Circus Voltaire is one of them. I think my version of Gridiron is the old exe as well.

  • Like 1
Link to comment
Share on other sites

Ok, I get what's going on now. :rolleyes:

Didn't realize at first since it was one of the first things I changed to avoid exactly what you're going through.

The easy solution is to use the ESC key as the b2s.exe's require, and also is the default for pinballX. Bind your exit/end button on your cabinet to ESC. In the vpinball Preferences>Keys menu, check the box "Disable ESC Key" to keep the little menu from popping up when trying to close out a table and mucking things up from within pinballX. When you are using vpinball directly (in the editor), you would press Q to bring up the exit menu and just hit ESC to close the b2s. This generally is not a problem since if you're running tables from vpinball itself, you should have a keyboard nearby.

The alternative is to change the close/exit button for pinballX and the b2s exe's to match. Easily done for pinballX, but I don't know if you can do it for the b2s files, but your script takes care of it.

Link to comment
Share on other sites

Next time you setup a B2S table add the following at the bottom of a tables script.

Sub Table1_Exit():Controller.Stop:End Sub

(Table1 being the name of the table in visual pinball)

I don't expect you to go through and do every table but mine have been setup like this since the start of directb2s and controller.stop closes the b2s.

Tried to put this at the end of my vpt table script but it doesn't work, old B2S backglasses still refuse to quit.

Link to comment
Share on other sites

  • 5 years later...
  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...