Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2016
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.96 KB | None | 0 0
  1. mId = 635812370612911763
  2. MCRC = 6A306DFE
  3. iCRC = 424631F4
  4. MEmu = Pinball Arcade
  5. MEmuV = v1.43.8
  6. MURL = http://www.pinballarcade.com/
  7. MAuthor = djvj,Metalzoic
  8. MVersion = 2.0.7
  9. MSystem = "Pinball Arcade","Pinball"
  10. ;----------------------------------------------------------------------------
  11. ; Notes:
  12. ; Initial setup:
  13. ; Manually run Pinball Arcade.
  14. ; If you own all the tables and they can all be found in the My Tables section in-game, simply enter My Tables from the main Pinball Arcade menu, browse to the first table (alphabetically) and exit Pinball Arcade.
  15. ; The module comes default with all the available tables (as of 10/23/2015) alphabetically sorted in the module setting My_Tables.
  16. ; It will parse this setting and assume you own all the tables. If you do not own all the tables, recreate this setting in the RocketLauncherUI module settings with only the tables you do own, and separate each one with a |
  17. ; If you do not own all the tables you also need to change the All_Tables module setting in RocketLauncherUI to "false" for the module to navigate the menu properly.
  18. ; The My_Tables names must match the names from your database.
  19. ;
  20. ; If launching as a Steam game:
  21. ; When setting this up in RocketLauncherUI under the global emulators tab, make sure to select it as a Virtual Emulator. Also no rom extensions, executable, or rom paths need to be defined.
  22. ; Under the Pinball Arcade system settings in RocketLauncherUI set Skip Checks to "Rom and Emu" when using this module as roms do not exist.
  23. ; The executable must be named PinballArcade.exe to work properly. Rename it if it does not match that exactly.
  24. ;
  25. ; If not launching through Steam:
  26. ; Add this as any other standard emulator and define the PinballArcade.exe as your executable, but still select Virtual Emulator as you do not need rom extensions or rom paths to be defined.
  27. ; Under the Pinball Arcade system settings in RocketLauncherUI set Skip Checks to "Rom and Emu" when using this module as roms do not exist.
  28. ; The executable must be named PinballArcade.exe to work properly. Rename it if it does not match that exactly.
  29. ;
  30. ; To use the DX11 version of Pinball Arcade you must select the DX11 option in the module settings.
  31. ; For the Steam version you must also rename the actual Steam DX11 exe file. Go to Programs (x86)/Steam/Steamapps/Common/PinballArcade and rename PinballArcade.exe to PinballArcadeDX9.exe (or whatever you want) to make a backup.
  32. ; Then rename PinballArcade11.exe to just PinballArcade.exe. Changing the name does not cause issues with updating, but you'll have to do this renaming step every time they update the game with a new version.
  33. ; If you are using a non-Steam version then you may or may not need to rename the exe and certain module setting may or may not work (such as no-nag), however your exe must be named PinballArcade.exe for it to work.
  34. ;
  35. ; This module requires BlockInput.exe to exist in your Module Extensions folder. It is used to prevent users from messing up the table selection routine.
  36. ; If BlockInput is not actually blocking input, it's due to not having admin credentials, which you will need to set this exe to run as admin.
  37. ; However, this also means RocketLauncher needs to be set to run as admin as well, keep this in mind.
  38. ;
  39. ; If you want bezel support set to the game be played in windowed mode
  40. ;
  41. ; How to run vertical games on a standard monitor:
  42. ; There are 3 methods supported by this module to rotate your desktop. Windows shortcuts, display.exe and irotate.exe. If one method does not work on your computer, try another.
  43. ;
  44. ; If the key sends are not working, make sure your RocketLauncher is set to run as administrator.
  45. ;
  46. ; Pinball Arcade stores some settings in your registry @ HKEY_CURRENT_USER\Software\PinballArcade\PinballArcade
  47. ;----------------------------------------------------------------------------
  48. StartModule()
  49.  
  50. settingsFile := modulePath . "\" . moduleName . ".ini"
  51. rotateMethod := IniReadCheck(settingsFile, "settings", "Rotate_Method", rotateMethod,,1) ; Shortcut, Display, iRotate
  52. rotateDisplay := IniReadCheck(settingsFile, "settings", "Rotate_Display", 0,,1) ; 0, 90, 180, 270
  53. moduleDebugging := IniReadCheck(settingsFile, "settings", "Module_Debugging", "false",,1)
  54. selectKey := IniReadCheck(settingsFile, "settings", "Select_Key", navSelectKey,,1)
  55.  
  56. If (RotateDisplay > 0) {
  57. Res := (A_ScreenWidth>A_ScreenWidth) ? A_ScreenWidth : A_ScreenWidth
  58. Gui 1: Color, 000000
  59. Gui 1: -Caption +ToolWindow
  60. Gui 1: Show, x0 y0 W%Res% H%Res%, BlackScreen ; experimental to hide entire desktop and windows
  61. Rotate(rotateMethod, rotateDisplay)
  62. }
  63.  
  64. BezelGUI()
  65. FadeInStart()
  66.  
  67. fullscreen := IniReadCheck(settingsFile, "settings", "Fullscreen", "true",,1) ; 0, Shortcut, Display, iRotate
  68. startGame := IniReadCheck(settingsFile, "settings", "Start_Game","true",,1)
  69. pinballVersion := IniReadCheck(settingsFile, "settings", "Pinball_Version", "DX11",,1)
  70. allTables := IniReadCheck(settingsFile, "settings", "All_Tables","true",,1)
  71. sleepLogo := IniReadCheck(settingsFile, "Settings", "Sleep_Until_Logo",7000,,1)
  72. sleepBaseTime := IniReadCheck(settingsFile, "Settings", "Sleep_Base_Time",1,,1)
  73. lastMyTable := "Addams Family, The (Bally)" ; Mytables always starts on The Addams Family
  74. myTables := IniReadCheck(settingsFile, "Settings", "My_Tables","Addams Family, The (Bally)|Attack from Mars (Bally)|Big Shot (Gottlieb)|Black Hole (Gottlieb)|Black Knight (Williams)|Black Knight 2000 (Williams)|Black Rose (Bally)|Bram Stoker's Dracula (Williams)|Bride of Pin-Bot (Williams)|Cactus Canyon (Bally)|Centaur (Bally)|Central Park (Gottlieb)|Champion Pub, The (Bally)|Cirqus Voltaire (Bally)|Class of 1812 (Gottlieb)|Creature from the Black Lagoon (Bally)|Cue Ball Wizard (Gottlieb)|Cyclone (Williams)|Diner (Williams)|Dr. Dude & His Excellent Ray (Bally)|Earthshaker (Williams)|El Dorado - City Of Gold (Gottlieb)|Elvira and the Party Monsters (Bally)|F-14 Tomcat (Williams)|Firepower (Williams)|Fish Tales (Williams)|Flight 2000 (Stern)|FunHouse (Williams)|Genie (Gottlieb)|Getaway, The - High Speed II (Williams)|Goin' Nuts (Gottlieb)|Gorgar (Williams)|Harley-Davidson, 3rd Edition (Stern)|Haunted House (Gottlieb)|High Roller Casino (Stern)|High Speed (Williams)|Jack-Bot (Williams)|Junk Yard (Williams)|Lights... Camera... Action! (Gottlieb)|Mary Shelley's Frankenstein (Sega)|Medieval Madness (Williams)|Monster Bash (Williams)|No Good Gofers (Williams)|Party Zone (Bally)|Phantom of the Opera, The (Data East)|Pin-Bot (Williams)|Red & Ted's Roadshow (Williams)|Ripley's Believe It or Not! (Stern)|Safe Cracker (Bally)|Scared Stiff (Bally)|Space Shuttle (Williams)|Star Trek - The Next Generation (Williams)|Starship Troopers (Sega)|Tales of the Arabian Nights (Williams)|Taxi (Williams)|Tee'd Off (Gottlieb)|Terminator 2 - Judgment Day (Williams)|Theatre of Magic (Bally)|Twilight Zone (Bally)|Victory (Gottlieb)|Whirlwind (Williams)|White Water (Williams)|WHO Dunnit (Bally)|Xenon (Bally)",,1) ; | v1.37.8 separated list of the tables user owns
  75.  
  76. pinballTitleClass := "Pinball Arcade ahk_class " . (If pinballVersion = "DX11" ? "GameWindowClass" : "Pinball Arcade")
  77.  
  78. BezelStart()
  79.  
  80. ; get user's save path
  81. paUserPath := RegRead("HKCU", "Software\PinballArcade\PinballArcade", "SavePath", "Auto")
  82. pinballArcadeDat := CheckFile(paUserPath . "settings.dat")
  83.  
  84. ; Update fullscreen setting
  85. res := BinRead(pinballArcadeDat,pinballArcadeDatData,1,8) ; read current fullscreen setting
  86. Bin2Hex(hexData,pinballArcadeDatData,res)
  87. If (fullscreen = "true" && hexData != "02") {
  88. Hex2Bin(binData,"02")
  89. res := BinWrite(pinballArcadeDat,binData,1,8)
  90. } Else If (fullscreen != "true" && hexData != "00") {
  91. Hex2Bin(binData,"00")
  92. res := BinWrite(pinballArcadeDat,binData,1,8)
  93. }
  94.  
  95. ; Convert myTables into a real array
  96. myTablesArray := []
  97. Loop, Parse, myTables, |
  98. {
  99. myTablesArray[A_Index] := A_Loopfield
  100. If (romName = A_Loopfield) {
  101. thisTablePos := A_Index ; store the position (in the array) this table was found
  102. thisTableArray := "myTablesArray" ; save the array this table was found in
  103. lastTable := lastMyTable ; store the last table loaded for the same array as this table
  104. Log("Module - Found """ . romName . """ at position " . thisTablePos . " in MyTables")
  105. }
  106. }
  107.  
  108. CheckFile(moduleExtensionsPath . "\BlockInput.exe")
  109.  
  110. If !thisTableArray
  111. ScriptError("This table """ . romName . """ was not found in My Tables folder. Please check its name that it matches what the module recognizes.")
  112. Log("Module - Table """ . romName . """ was found in array """ . thisTableArray . """ at position " . thisTablePos)
  113. Log("Module - Last Table of array """ . thisTableArray . """ left off at """ . lastTable . """ which was found at position " . lastTablePos)
  114.  
  115. ; Calculate the shortest distance to this table from the lastTable
  116. max := %thisTableArray%.MaxIndex()
  117. a := 1
  118. b := thisTablePos
  119. If (a > b) {
  120. moveDown := a - b
  121. moveUp := (max - a) + b
  122. } Else If (b > a) {
  123. moveDown := b - a
  124. moveUp := (max - b) + a
  125. } Else { ; a=b
  126. moveDown := 0
  127. moveUp := 0
  128. }
  129. moveDirection := If moveUp < moveDown ? "moveUp" : "moveDown"
  130. Log("Module - The array """ . thisTableArray . """ has " . max . " tables in it and shortest distance to this table is " . %moveDirection% . " in direction " . moveDirection)
  131.  
  132. hideEmuObj := Object(pinballTitleClass,1) ; Hide_Emu will hide these windows. 0 = will never unhide, 1 = will unhide later
  133. HideEmuStart()
  134.  
  135. If executable {
  136. Log("Module - Running Pinball Arcade as a stand alone game and not through Steam as an executable was defined.")
  137. Run(executable . " skipwhatsnew", emuPath)
  138. } Else {
  139. If !steamPath
  140. GetSteamPath()
  141. Log("Module - Running Pinball Arcade through Steam.")
  142. Steam(238260,,"skipwhatsnew")
  143. }
  144.  
  145. WinWait(pinballTitleClass)
  146. WinWaitActive(pinballTitleClass)
  147.  
  148. BezelDraw()
  149. Run("BlockInput.exe 30", moduleExtensionsPath) ; start the tool that blocks all input so user cannot interrupt the launch process for 30 seconds
  150. If moduleDebugging = true
  151. Tooltip, waiting %sleepLogo% seconds for logo
  152. SetKeyDelay(80*sleepBaseTime)
  153. Sleep % sleepLogo ; sleep till Pinball FX2 logo appears
  154.  
  155. If moduleDebugging = true
  156. Tooltip, sending %selectKey% to get to the main menu
  157. Send, {%selectKey% Down}{%selectKey% Up} ; Presses select to enter Main Menu
  158. If (allTables = "false") {
  159. Send, 300{Down Down}{Down Up} ; Moves selection cursor down to My Tables if all tables aren't owned
  160. }
  161. Send, 300{%selectKey% Down}{%selectKey% Up} ; Selects My Tables folder
  162.  
  163. If moduleDebugging = true
  164. Tooltip, entering MyTable folder
  165. Sleep % 2000*sleepBaseTime ; wait for folder to load
  166.  
  167. If moduleDebugging = true
  168. Tooltip, navigating to %romName%
  169. SetKeyDelay(80*sleepBaseTime)
  170. If (moveDirection = "moveUp") {
  171. Loop % %moveDirection%
  172. { If moduleDebugging = true
  173. Tooltip % "Index: " . A_Index . " | Game: " . %thisTableArray%[A_Index]
  174. Send, {Up Down}{Up Up}
  175. Sleep % 100*sleepBaseTime
  176. }
  177. } Else { ; moveDown
  178. Loop % %moveDirection%
  179. { If moduleDebugging = true
  180. Tooltip % "Index: " . A_Index . " | Game: " . %thisTableArray%[A_Index]
  181. Send, {Down Down}{Down Up}
  182. Sleep % 100*sleepBaseTime
  183. }
  184. }
  185. Send, {%selectKey% Down}{%selectKey% Up} ; select game
  186. Sleep % 500*sleepBaseTime
  187.  
  188. If moduleDebugging = true
  189. Tooltip, waiting for game to load
  190. Send, {%selectKey% Down}{%selectKey% Up}80{%selectKey% Down}{%selectKey% Up} ; select game
  191. If (startGame = "true") {
  192. Sleep % 4800*sleepBaseTime ; waiting for table to load
  193. Send, {%selectKey% Down}{%selectKey% Up}80{%selectKey% Down}{%selectKey% Up} ; start game
  194. }
  195. If moduleDebugging = true
  196. Tooltip, Finished
  197.  
  198. Process("Close", "BlockInput.exe") ; end script that blocks all input
  199.  
  200. HideEmuEnd()
  201. FadeInExit()
  202. Process("WaitClose", "PinballArcade.exe")
  203. BezelExit()
  204. FadeOutExit()
  205.  
  206. If (RotateDisplay > 0) {
  207. Gui 1: Show
  208. Rotate(rotateMethod, 0)
  209. Sleep % 200*sleepBaseTime
  210. Gui 1: Destroy
  211. }
  212.  
  213. ExitModule()
  214.  
  215.  
  216. HaltEmu:
  217. disableSuspendEmu := true
  218. Send, {ESC down}{ESC up}
  219. Return
  220. RestoreEmu:
  221. Send, {ESC down}{ESC up}
  222. Return
  223.  
  224. CloseProcess:
  225. FadeOutStart()
  226. WinClose(pinballTitleClass)
  227. Return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement