Script Visual Pinball

Get answers to questions about using mGalaxy.
Post Reply
Spyke
Newbie
Newbie
Posts: 26
Joined: Wed Mar 25, 2015 7:11 pm

Hello,

Ineed some help to run the script for exit Visual Pinball.
What I have done until now:
-edit system.xml to run Visual Pinball 8 and 9 and Future Pinball
-add folders in data for each emu - everything works fine and all emus start up well
-cange the script I found here to fit my paths http://www.mgalaxy.com/forum/index.php?topic=404.msg1294#msg1294
-create script with AutoIt
-rename the schript to mGalaxy_Script
-put script in emu folder - but it din´t work, emu didn´t start up anymore

For example VP9:
-my path is C:\Programme\Visual Pinball
-my file is VPinball921
-my script is

Code: Select all

HotKeySet("{ESC}", "Terminate")
$path = "C:\Programme\Visual Pinball\"
$app = "VPinball921.exe"

If $CmdLine[0] == 1 Then
	$PID=Run( $path & $app & " -play -" & '"' & $CmdLine[1] & '"', $path)

while _WinWaitActivePID($PID)
   sleep(500)
wend

    While 1
          Sleep(100)
    WEnd
EndIf

exit 0


Func Terminate()
	WinClose ( "Visual Pinball Player")
	ControlClick("[CLASS:#32770]", "Paused", 293)
	WinClose ("Visual Pinball")
	WinActivate ("mGalaxy")
    Exit 0
 EndFunc

 Func _WinWaitActivePID($iPid)
    While 1
        Local $list = WinList()
        For $i = 1 To $list[0][0]
            If $list[$i][0] <> "" And IsVisible($list[$i][1]) Then
                If WinGetProcess($list[$i][1]) = $iPid AND WinActive($list[$i][1]) Then Return $list[$i][0]
            EndIf
        Next
    WEnd
EndFunc

Func IsVisible($handle)
    If BitAND(WinGetState($handle), 2) Then
        Return 1
    Else
        Return 0
    EndIf

EndFunc
What is wrong? Do I have to add something to Sytem.xml? Is something wrong in script?

Thank you for help.

Marc
User avatar
mgalaxy
Administrator
Administrator
Posts: 1192
Joined: Tue Dec 05, 2006 7:46 pm

Hello,

Some questions before going further:
-edit system.xml to run Visual Pinball 8 and 9 and Future Pinball
Why editing 'systems.xml' file? Everything is already set up, there's a 'Pinball entry in mGalaxy_Runway!
-cange the script I found here to fit my paths http://www.mgalaxy.com/forum/index.php? ... 94#msg1294
Have you tried the (official) script here:
http://www.mgalaxy.com/forum/index.php?topic=440.0
(I don't remind if the script you specify in your link is working or not)

I don't have time to help you further today..but will be back tomorrow to be sure that you get it working!!
Spyke
Newbie
Newbie
Posts: 26
Joined: Wed Mar 25, 2015 7:11 pm

Thanks for you reply.
I will try the other script and tell you if it work.

I modified system.xml because I want to run all emus paralell. So far I figured out, with the original system.xml it's only possible to play only one emu. Or did I understand it wrong?

Marc
Spyke
Newbie
Newbie
Posts: 26
Joined: Wed Mar 25, 2015 7:11 pm

Works well with the new script!
Thank you for helping me out.

Thank you for this frontend it's superb!
I tested several others before, but mGalaxy is the best!

Marc
Post Reply