JoeViking245 Posted March 26, 2020 Share Posted March 26, 2020 Not sure why it's looking for AutoHotkey.ahk. Drag you VPX.ahk onto AutoHotkey.exe and see if there's a beep. Quote Link to comment Share on other sites More sharing options...
ItchyRobot Posted March 26, 2020 Share Posted March 26, 2020 (edited) 10 minutes ago, JoeViking245 said: Not sure why it's looking for AutoHotkey.ahk. Drag you VPX.ahk onto AutoHotkey.exe and see if there's a beep. No beep. But I can here a quick low volume hum then thud ... meaning, I can hear the speaker make a slight sound like it is activated then shuts down. Edited March 26, 2020 by ItchyRobot Quote Link to comment Share on other sites More sharing options...
JoeViking245 Posted March 26, 2020 Share Posted March 26, 2020 Volume's up? Hearing aid batteries fresh? Got the audio piped through the sub woofer on the stereo? lol OK, so the sound idea for some reason isn't going to work. BUT!!!!!!!!!!!!!............ we know (at least we think we do) the script and AHK work. Oh snap! Uh... try changing "100" to "1000" in the 1st SoundBeep line and do the drag and drop thing. Quote Link to comment Share on other sites More sharing options...
ItchyRobot Posted March 26, 2020 Share Posted March 26, 2020 1 minute ago, JoeViking245 said: Volume's up? Hearing aid batteries fresh? Got the audio piped through the sub woofer on the stereo? lol OK, so the sound idea for some reason isn't going to work. BUT!!!!!!!!!!!!!............ we know (at least we think we do) the script and AHK work. Oh snap! Uh... try changing "100" to "1000" in the 1st SoundBeep line and do the drag and drop thing. Bam! I got one long beep... 2 secs or so Quote Link to comment Share on other sites More sharing options...
JoeViking245 Posted March 26, 2020 Share Posted March 26, 2020 Set the 2nd SoundBeep to the same thing, and try AC/DC (or whichever table) again. Quote Link to comment Share on other sites More sharing options...
ItchyRobot Posted March 26, 2020 Share Posted March 26, 2020 6 minutes ago, JoeViking245 said: Set the 2nd SoundBeep to the same thing, and try AC/DC (or whichever table) again. nothing =( #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. SoundBeep,1000,1000 Done = 0 SetTimer, WaitedTooLong, -15000 While (!Done) { WinWait Preparing Table SoundBeep,,1000 Sleep, 9000 Send {s} Exit } WaitedTooLong: Exit Quote Link to comment Share on other sites More sharing options...
ItchyRobot Posted March 26, 2020 Share Posted March 26, 2020 do i need to set the path the autohotkey.exe path somewhere? Or is that assumed since it came with the Launchbox installation? Quote Link to comment Share on other sites More sharing options...
JoeViking245 Posted March 26, 2020 Share Posted March 26, 2020 (edited) LB knows where to look for [it's own copy of] AHK. But based on where you said it was located ../LaunchBox/AutoHotkey/autoHotkey.exe , you're not on the latest beta version. Which shouldn't make any difference. More of a comment than anything. So you heard the beep when you drag-drop the script onto AutoHotkey.exe. But when you start a table that has the "Addition App" [the script] , you don't hear any of the beeps. Not even the 1st one. That's saying.... well... the script is not being ran at all. I think you said you have the Full AutoHotkey program on your "Z" drive. (again, makes no difference as long as LB has its' copy). In the Full version, there should be a sub-folder called "Compiler". In there, run "Ahk2Exe.exe". Point to the script ("Source") file, set the destination (same folder or wherever), then click ">Convert<". Now go to Additional App and point to the new .exe file (instead of the .ahk file). Try the table. If I mis-read and you don't have the Full AHK, never mind. Just press your Start button when you see the popup [PinMame] window. lol Edited March 26, 2020 by JoeViking245 Quote Link to comment Share on other sites More sharing options...
ItchyRobot Posted March 26, 2020 Share Posted March 26, 2020 I don't think the script is being run at all when I open a table. Also, I do not have the full version of autohotkey installed... only what came with Lanchbox. I should be updated to the latest official build of Launchbox, by the way (non-beta). I think I'm just going to click the damn button myself Thanks for joining me in this wild goose chase. ? I least I learned my Autohotkey does not work. Should I report this as a bug? Quote Link to comment Share on other sites More sharing options...
JoeViking245 Posted March 27, 2020 Share Posted March 27, 2020 Just had an epiphany... It might be working on mine because I have Full AHK installed and the when you add an Additional App, there's a reason that it defaults to looking for an executable file... LB doesn't run ahk scripts in this manner. Remove that Additional App from you table(s) and save. Go to "Tools", "Manage Emulators" and double click your Visual Pinball X emulator. Click on the "Running AutoHotkey Script" tab and in the blank area, paste the code #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. SoundBeep,1000,1000 Done = 0 SetTimer, WaitedTooLong, -15000 While (!Done) { WinWait Preparing Table SoundBeep,,1000 Sleep, 3000 Send {s} Exit } WaitedTooLong: Exit Note: I changed the Sleep line back to 3 seconds. Now Save and run a table. Oh, and make sure the volume's up. Quote Link to comment Share on other sites More sharing options...
ItchyRobot Posted March 27, 2020 Share Posted March 27, 2020 @JoeViking245 That worked. I hear two beeps now, two different tones. Though, I have a feeling this will not work since each table loads at different times due to how complex the design is. It will probably have to be individual timings for each table. That could be a lot of work figuring out the perfect timings. Quote Link to comment Share on other sites More sharing options...
JoeViking245 Posted March 27, 2020 Share Posted March 27, 2020 Woo Hoo!!!! So you heard the 2 beeps. Did the popup go away [sooner than usual]? To get it to work differently for different tables, I see 2 options. 1 - Create multiple VPX emulators (as above) with different delay ("Sleep") times. Then find which delay time works best for each table and assign that respective emulator to that table. 2 - Download/install the Full AutoHotkey program, add the script (like our 1st feeble attempts) to each and every table [that uses PinMame] and adjust the delay time accordingly. (Optionally, with the Full AHK installed, compile each script to an .exe) ..Both of which would be a p.i.t.a. depending on how many tables you have. Plan "B" would be to settle for a happy medium, like maybe 4.5 seconds (4500). Quote Link to comment Share on other sites More sharing options...
ItchyRobot Posted March 27, 2020 Share Posted March 27, 2020 (edited) 2 hours ago, JoeViking245 said: Woo Hoo!!!! So you heard the 2 beeps. Did the popup go away [sooner than usual]? I did not the first time... just made two beeps, then the normal pinmame splash screen. Then it worked the second time without me changing anything. So, I think the splash screen timing depends on the PC load... maybe it had things running in the background or something... who knows. Now I just need to play with the times a bit, like you said, to find a happy medium. If that doesn't work, then it's back to, god forbid, pressing the button at the splash screen! ? Edited March 27, 2020 by ItchyRobot 1 Quote Link to comment Share on other sites More sharing options...
JoeViking245 Posted March 27, 2020 Share Posted March 27, 2020 My inner-Geek said our proposed 'solutions' were unacceptable. Place this inside your VPX emulator "Running AutoHotkey Script" tab. Done = 0 SetTimer, WaitedTooLong, -15000 While (!Done) { WinGet, numOpen, count, ahk_exe vpinballx.exe if numOpen = 3 { send, s Exit } } WaitedTooLong: Exit 1 Quote Link to comment Share on other sites More sharing options...
ItchyRobot Posted March 27, 2020 Share Posted March 27, 2020 I like your perseverance. And it paid off !!! I just tried about 10 tables and it worked great for all of them but "The Flintstones". But that one is a known long loader - it must have a bunch of code or graphics compared to the other tables. Thanks for taking so much time figuring this out. Hopefully it is something you will use in your build too. Quote Link to comment Share on other sites More sharing options...
ed20910 Posted March 27, 2020 Share Posted March 27, 2020 @JoeViking245 curious if you have preferred setting for the pause and exit. I have a single button setup for pause and a single for exit on my arcade cab. When i pause, the pause screen shows, but the table is still running. tried the suspend emulator when paused but that didnt seem to work right. Quote Link to comment Share on other sites More sharing options...
JoeViking245 Posted March 27, 2020 Share Posted March 27, 2020 You're Welcome! And it's nice to see 'the fix' can be replicated on someone else's machine. Also, it appears I haven't checked on my tables in the last 6 months as I still only had Flintstones for VP9. The 'updated fix'.... increase the timeout period. Right now it's set to 15 seconds (-15000). Go ahead and set it to.. heck, I don't know... 60 seconds (-60000). Seems that even with this longer loading time, the PinMame banner is still the 3rd iteration of vpinballx.exe. So as soon as it sees it the 3rd time, it'll send the key and exit. Otherwise, in 60 seconds it'll say "I've waited too long. I'm outta here". And definitely!!!!... it will be used in my cab now too! ? Quote Link to comment Share on other sites More sharing options...
JoeViking245 Posted March 27, 2020 Share Posted March 27, 2020 @ed20910 Without looking at mine and 'shooting from the hip'.... is your cab pause button also assigned to pause in VPX? Quote Link to comment Share on other sites More sharing options...
ed20910 Posted March 27, 2020 Share Posted March 27, 2020 honestly, not 100% sure. my gut says no. i think my issue may be the default BB/LB controls. i dont use the combo for those features. Button brings up the pause menu just fine and pauses just about all emulators, but those allow you to redefine the pause key if necessary. Since Esc is the default VPX pause key, i think that is why it isnt working since LB uses that as the default exit, correct? Quote Link to comment Share on other sites More sharing options...
ItchyRobot Posted March 27, 2020 Share Posted March 27, 2020 (edited) @JoeViking245 making it -60000 worked. All is perfect now @ed20910 I use a single button Pause... I was actaully having issues trying to use a 2-button combo for BigBox pause. It was hit and miss when it would work, so I reverted back to a single button and have had no issues since. From what I understand, VPX does not have a true pause. I just wait until I gutter ball, or get a hold with the flipper... then hit pause. Edited March 27, 2020 by ItchyRobot Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.