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

Improved Pinball FX2 Script


Gilrock

Recommended Posts

I uploaded a script I've been working on to make it easier to deal with tables moving around in the Pinball FX2 menu. Basically you can just type in the names you use for your tables in the array lists at the top of the file and the script will search for the selected table and based on the position it finds it in the array it knows how far to move the cursor down and over to select the table. I didn't have all the tables purchased so you may need to populate a few of the tables I labelled as "locked". The script is really short so I can show you the contents here:

	#SingleInstance force	SetTitleMatchMode 2	DetectHiddenWindows On	SetWorkingDir %A_ScriptDir% 	Table = %1%	;Variable from PinballX		WinWait, ahk_class PxWindowClass	WinActivate, ahk_class PxWindowClass	WinWaitActive, ahk_class PxWindowClass                 array1 := ["Zen_WalkingDead",  "Zen_sWESB",      "Zen_SWCW",      "Zen_SWBF",       "Zen_CaptAmer",  "Zen_FFour",      "Zen_Civil"]        array2 := ["Zen_Avengers",     "Zen_FearItself", "Zen_Gauntlet",  "Zen_Hulk",       "Zen_Thor",      "Zen_MoonKnight", "Zen_GhostRider"]	array3 := ["Zen_XMen",         "Zen_Blade",      "Zen_IronMan",   "Zen_Spiderman",  "Zen_Wolverine", "Zen_Plants",     "Zen_SplosionMan"]	array4 := ["Zen_EarthDefense", "Zen_Mars",       "Zen_Excalibur", "Zen_Paranormal", "Zen_EpicQuest", "Zen_Secrets",    "Zen_Biolab"]	array5 := ["Zen_Pasha",        "Zen_Rome",       "Zen_Shaman",    "Zen_Tesla",      "Zen_ElDorado",  "Zen_V12",        "locked"]	array6 := ["locked",           "locked",         "locked",        "locked",         "locked",        "locked",         "locked"]	array7 := ["locked",           "locked",         "locked",        "Zen_Sorc",       "locked",        "locked",         "locked"]	row_index := 0	col_index := 0	table_found := 0	selected_table = %table%	current_table = "locked"	Loop, 7	{          main_loop = %A_Index%	  Loop, 7	  {            current_table = % array%main_loop%[A_Index]	    if( "X" current_table = "X" selected_table )	    {	      col_index := A_Index - 1	      row_index := main_loop - 1              table_found = 1	      ;MsgBox, Found table: %current_table%  Selected: %selected_table% row: %row_index%  col: %col_index% 	      break	    }	  }	  if( table_found = 1 )	    break	}	if( table_found == 1 )	{	  ; Move past main menus	  Sleep, 11000	  Send {Enter Down}, Send {Enter Up}	  Sleep, 20	  Send {Enter Down}, Send {Enter Up}	  Sleep, 500	  ; Move down the number of rows	  Loop, %row_index%	  {	    Send {Down Down}, Send {Down Up}	    Sleep, 20	  }	  ; Move over the number of columns	  Loop, %col_index%	  {	    Send {Right Down}, Send {Right Up}	    Sleep, 20	  }	  ; Select the table	  Send {Enter Down}, Send {Enter Up}	}    	Process, WaitClose, Pinball FX2.exe	ExitApp
  • Like 2
Link to comment
Share on other sites

were have u uploaded it too ? thanks

Sorry I was offline most of the weekend. Its uploaded to the FTP client area for this forum. You should have details about your FTP login credentials under your profile. There is a PinballX subdirectory and then under that is a Scripts directory and look for the directory with "Gilrock" in the name.

You could just copy paste the text from the first post into the file PinballFX2.ahk but make sure you create a backup of your original file first in case you want to go backwards.

I've noticed from the other scripts in the FTP area that there are a lot of different naming conventions so keep in mind you may need to rename the games to match the names you have in your database file which will be the game name showing up in Game Manager for PinballFX2.

  • Like 1
Link to comment
Share on other sites

Gilrock - what is your default table when you first start Pinball FX2? The layout is quite different based on which tables one has purchased (would have been nice if they kept the positions the same and just greyed out the boxes for those you don't have instead of bunching all the purchased ones first).

Link to comment
Share on other sites

Not the improved script but the same idea applies. Just returns the highlighted item back to row 1 and column 1 before running through the table match. If Zen fixes it again so that the menu starts up at the top leftmost table then it is really easy to remove this additional code

#NoEnv
#SingleInstance force
RegRead, SteamDirPath, HKCU, Software\Valve\Steam, SteamPath
Run, "%SteamDirPath%\Steam.exe" -applaunch 226980,,UseErrorLevel
Process, wait, Pinball FX2.exe
Table = %1% ;Variable from PinballX
Sleep, 11000
Send {Enter Down}, Send {Enter Up}
Sleep, 20
Send {Enter Down}, Send {Enter Up}
Sleep, 600
;Starting position on launch is Zen-Football
Send {Up Down}, Send {Up Up}
Sleep, 20
Send {Left Down}, Send {Left Up}
Sleep, 20
Send {Left Down}, Send {Left Up}
Sleep, 20
Send {Left Down}, Send {Left Up}
Sleep, 20
Send {Left Down}, Send {Left Up}
Sleep, 20
Gosub, %table%
process, WaitClose, Pinball FX2.exe
ExitApp
;Table Selection
;#1
TheWalkingDead:
down=0
right=0
Goto Navigation
;#2
SW-HS:
down=0
right=1
Goto Navigation
;#3
SW-D:
down=0
right=2
Goto Navigation
;#4
SW-ANH:
down=0
right=3
Goto Navigation
;#5
SW-MOTF:
down=0
right=4
Goto Navigation
;#6
Zen-SWROTJ:
down=0
right=5
Goto Navigation
;#7
Zen-SWSA:
down=0
right=6
Goto Navigation
;----------------------------------------------------------
;#8
Zen-SWDV:
down=1
right=0
Goto Navigation
;#9
Zen-SWESB:
down=1
right=1
Goto Navigation
;#10
Zen-SWCW:
down=1
right=2
Goto Navigation
;#11
Zen-SWBF:
down=1
right=3
Goto Navigation
;#12
Zen-Football:
down=1
right=4
loop, %Down%
{
Send {Down Down}, Send {Down Up}
Sleep, 20
}
loop, %Right%
{
Send {Right Down}, Send {Right Up}
Sleep, 20
}
Send {Enter Down}, Send {Enter Up}
Sleep, 1000
Send {Up Down}, Send {Up Up}
Sleep, 20
Send {Enter Down}, Send {Enter Up}
Return
;#13
Guardians:
down=1
right=5
Goto Navigation
;#14
Deadpool:
down=1
right=6
Goto Navigation
;----------------------------------------------------------
;#15
Zen-DStrange:
down=2
right=0
Goto Navigation
;#16
Zen-CaptAmer:
down=2
right=1
Goto Navigation
;#17
Zen-FFour:
down=2
right=2
Goto Navigation
;#18
Zen-Civil:
down=2
right=3
Goto Navigation
;#19
Zen-Avengers:
down=2
right=4
Goto Navigation
;#20
Zen-FearItself:
down=2
right=5
Goto Navigation
;#21
Zen-InfinityGauntlet:
down=2
right=6
Goto Navigation
;----------------------------------------------------------
;#22
Zen-Hulk:
down=3
right=0
Goto Navigation
;#23
Zen-Thor:
down=3
right=1
Goto Navigation
;#24
Zen-MoonKnight:
down=3
right=2
Goto Navigation
;#25
Zen-GhostRider:
down=3
right=3
Goto Navigation
;#26
Zen-XMen:
down=3
right=4
Goto Navigation
;#27
Zen-Blade:
down=3
right=5
Goto Navigation
;#28
Zen-IronMan:
down=3
right=6
Goto Navigation
;----------------------------------------------------------
;#29
Zen-SpiderMan:
down=4
right=0
Goto Navigation
;#30
Zen-Wolverine:
down=4
right=1
Goto Navigation
;#31
PlantsVsZombies:
down=4
right=2
Goto Navigation
;#32
Zen-MSplosion:
down=4
right=3
Goto Navigation
;#33
Zen-EarthD:
down=4
right=4
Goto Navigation
;#34
Zen-Mars:
down=4
right=5
Goto Navigation
;#35
Zen-Excal:
down=4
right=6
Goto Navigation
;----------------------------------------------------------
;#36
Zen-Para:
down=5
right=0
Goto Navigation
;#37
Zen-Epic:
down=5
right=1
Goto Navigation
;#38
Zen-Secrets:
down=5
right=2
Goto Navigation
;#39
Zen-Biolab:
down=5
right=3
Goto Navigation
;#40
Zen-Pasha:
down=5
right=4
Goto Navigation
;#41
Zen-Rome:
down=5
right=5
Goto Navigation
;#42
Zen-Shaman:
down=5
right=6
Goto Navigation
;----------------------------------------------------------
;#43
Zen-Tesla:
down=6
right=0
Goto Navigation
;#43
Zen-ElDorado:
down=6
right=1
Goto Navigation
;#44
Zen-V12:
down=6
right=2
Goto Navigation
;#45
Zen-Sorc:
down=6
right=3
Goto Navigation
Navigation:
;Sleep, 11000
;Send {Enter Down}, Send {Enter Up}
;Sleep, 20
;Send {Enter Down}, Send {Enter Up}
;Sleep, 600
loop, %Down%
{
Send {Down Down}, Send {Down Up}
Sleep, 20
}
loop, %Right%
{
Send {Right Down}, Send {Right Up}
Sleep, 20
}
Send {Enter Down}, Send {Enter Up}
Sleep, 1000
Send {Enter Down}, Send {Enter Up}
Return
Return

Link to comment
Share on other sites

Been testing out the new script - since PFX2 defaults (on my setup at least) on the football table at position Row 2, Column 5 it throws all the selections out of whack. How do you tell it to offset a number of columns/rows?

Mine always defaults to the top left table which is WalkingDead for me. I thought it defaulted to the first table (Row 1, Column 1) for everyone. It sounds like maybe it's defaulting to the last table you purchased. If your cursor isn't on the top left box then my script won't work without a small change. I think adding code to bring the cursor to the top left block would still be a lot better than all the scripts I've seen that have a list of keystroke commands for every table. You could just add a few lines to the script to move the cursor based on where your default table is and then modify those few commands whenever the default changes.

Thinking about it a little more I could modify the script to have a default_column and default_row variable and then each user could modify just those two constants. I'll make that change and post/upload the modified script.

I think the bottom line is we all will need to make small tweaks to the script unless PFX2 changes how the table positions and default selection work. I was just trying to minimize the work needed to modify the script each time the selection menu changes.

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

Posting here just so people looking for a newer solution to running Pinball FX2 will have more options.

NukeLauncher is a Pinball FX2 Launcher made by me and is well documented. It addresses all of the issues mentioned here as well as many others.

Here is a link to the forum page.

http://www.gameex.info/forums/topic/15201-app-nukelauncher-is-now-available-to-all-pinball-fx2-launcher/
or directly from the http://www.nukelauncher.com page.

Pinball_FX2.gif

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...