Gilrock Posted September 6, 2014 Share Posted September 6, 2014 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 2 Link to comment Share on other sites More sharing options...
gtxjoe Posted September 7, 2014 Share Posted September 7, 2014 I will have to give this a shot! Link to comment Share on other sites More sharing options...
rockyrocket Posted September 7, 2014 Share Posted September 7, 2014 Should be a great time saver - well done!. Link to comment Share on other sites More sharing options...
andyco Posted September 7, 2014 Share Posted September 7, 2014 were have u uploaded it too ? thanks Link to comment Share on other sites More sharing options...
randr Posted September 7, 2014 Share Posted September 7, 2014 Interesting! WillLook at this tonight. Thanks! Link to comment Share on other sites More sharing options...
Gilrock Posted September 8, 2014 Author Share Posted September 8, 2014 were have u uploaded it too ? thanksSorry 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. 1 Link to comment Share on other sites More sharing options...
open6l Posted September 10, 2014 Share Posted September 10, 2014 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 More sharing options...
open6l Posted September 10, 2014 Share Posted September 10, 2014 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? Link to comment Share on other sites More sharing options...
Carny_Priest Posted September 10, 2014 Share Posted September 10, 2014 I have some script that simply brings the highlighted box back to the top and leftmost before going through the usual table selection script. Traveling though, so I can post later unless someone beats me to it. Link to comment Share on other sites More sharing options...
Carny_Priest Posted September 11, 2014 Share Posted September 11, 2014 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 forceRegRead, SteamDirPath, HKCU, Software\Valve\Steam, SteamPathRun, "%SteamDirPath%\Steam.exe" -applaunch 226980,,UseErrorLevelProcess, wait, Pinball FX2.exe Table = %1% ;Variable from PinballX Sleep, 11000Send {Enter Down}, Send {Enter Up}Sleep, 20Send {Enter Down}, Send {Enter Up}Sleep, 600 ;Starting position on launch is Zen-FootballSend {Up Down}, Send {Up Up}Sleep, 20Send {Left Down}, Send {Left Up}Sleep, 20Send {Left Down}, Send {Left Up}Sleep, 20Send {Left Down}, Send {Left Up}Sleep, 20Send {Left Down}, Send {Left Up}Sleep, 20 Gosub, %table% process, WaitClose, Pinball FX2.exeExitApp ;Table Selection ;#1TheWalkingDead:down=0right=0Goto Navigation;#2SW-HS:down=0right=1Goto Navigation;#3SW-D:down=0right=2Goto Navigation;#4SW-ANH:down=0right=3Goto Navigation;#5SW-MOTF:down=0right=4Goto Navigation;#6Zen-SWROTJ:down=0right=5Goto Navigation;#7Zen-SWSA:down=0right=6Goto Navigation;---------------------------------------------------------- ;#8Zen-SWDV:down=1right=0Goto Navigation;#9Zen-SWESB:down=1right=1Goto Navigation;#10Zen-SWCW:down=1right=2Goto Navigation;#11Zen-SWBF:down=1right=3Goto Navigation;#12Zen-Football:down=1right=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, 1000Send {Up Down}, Send {Up Up}Sleep, 20Send {Enter Down}, Send {Enter Up}Return;#13Guardians:down=1right=5Goto Navigation;#14Deadpool:down=1right=6Goto Navigation;---------------------------------------------------------- ;#15Zen-DStrange:down=2right=0Goto Navigation;#16Zen-CaptAmer:down=2right=1Goto Navigation;#17Zen-FFour:down=2right=2Goto Navigation;#18Zen-Civil:down=2right=3Goto Navigation;#19Zen-Avengers:down=2right=4Goto Navigation;#20Zen-FearItself:down=2right=5Goto Navigation;#21Zen-InfinityGauntlet:down=2right=6Goto Navigation;---------------------------------------------------------- ;#22Zen-Hulk:down=3right=0Goto Navigation;#23Zen-Thor:down=3right=1Goto Navigation;#24Zen-MoonKnight:down=3right=2Goto Navigation;#25Zen-GhostRider:down=3right=3Goto Navigation;#26Zen-XMen:down=3right=4Goto Navigation;#27Zen-Blade:down=3right=5Goto Navigation;#28Zen-IronMan:down=3right=6Goto Navigation;---------------------------------------------------------- ;#29Zen-SpiderMan:down=4right=0Goto Navigation;#30Zen-Wolverine:down=4right=1Goto Navigation;#31PlantsVsZombies:down=4right=2Goto Navigation;#32Zen-MSplosion:down=4right=3Goto Navigation;#33Zen-EarthD:down=4right=4Goto Navigation;#34Zen-Mars:down=4right=5Goto Navigation;#35Zen-Excal:down=4right=6Goto Navigation;---------------------------------------------------------- ;#36Zen-Para:down=5right=0Goto Navigation;#37Zen-Epic:down=5right=1Goto Navigation;#38Zen-Secrets:down=5right=2Goto Navigation;#39Zen-Biolab:down=5right=3Goto Navigation;#40Zen-Pasha:down=5right=4Goto Navigation;#41Zen-Rome:down=5right=5Goto Navigation;#42Zen-Shaman:down=5right=6Goto Navigation;---------------------------------------------------------- ;#43Zen-Tesla:down=6right=0Goto Navigation;#43Zen-ElDorado:down=6right=1Goto Navigation;#44Zen-V12:down=6right=2Goto Navigation;#45Zen-Sorc:down=6right=3Goto 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, 1000Send {Enter Down}, Send {Enter Up}Return Return Link to comment Share on other sites More sharing options...
Gilrock Posted September 11, 2014 Author Share Posted September 11, 2014 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. 1 Link to comment Share on other sites More sharing options...
Carny_Priest Posted September 11, 2014 Share Posted September 11, 2014 The array code is still a definite improvement, but users should always expect to have to modify it as Zen introduces new DLC. A few more tables and that entire menu layout may be changed. Link to comment Share on other sites More sharing options...
Carny_Priest Posted September 11, 2014 Share Posted September 11, 2014 Of course, the real solution would be if Zen had the option to launch from the command line. Link to comment Share on other sites More sharing options...
jaharr01 Posted September 24, 2014 Share Posted September 24, 2014 could u post your working ini file so I can get the paths right? Link to comment Share on other sites More sharing options...
time299 Posted October 26, 2014 Share Posted October 26, 2014 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. Link to comment Share on other sites More sharing options...
Recommended Posts