Jump to content
Sign in to follow this  

Making a script that launches one of two others

Recommended Posts

hey everyone i am just starting with autoit it comes with my new job at an internet cafe, we are making a script to launch battlefield 2142, with one it launches our licensing program that allows our customers to use one of our house accounts and the other that runs just battlefield 2142. it launches a gui that lets you choose one of the two scripts. since i am very new to this scripting dont be to harsh if i really botched this

GuiCreate("Battlefield 2142", 350, 125,(@DesktopWidth-380)/2, (@DesktopHeight-400)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)

$radio1 = GUICtrlCreateRadio ("Liquid Matrix Account", 10, 10, 150, 20 )
GUICtrlSetState ($radio1,$GUI_CHECKED)
$radio2 = GUICtrlCreateRadio ("Personal Account (must have purchased game)", 10, 40, 350, 20)

$Button_1 = GuiCtrlCreateButton("ok", 125, 75, 90, 30)

GUISetState(); Command respondsible for setting Gui in a visible or usable state. Very important

; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()
    Case $msg = $GUI_EVENT_CLOSE
        $answer1=MsgBox(4, "Warning", "Close without addons loaded?")
        If $answer1 = 6 Then
    Case $msg = $Button_1
        $answer2 = MsgBox(4, "Notice", "Start 2142?")
        if $answer2 = 7 then ContinueLoop
        If $answer2 = 6 Then
            IF GUICtrlRead ($radio1) = $GUI_CHECKED Then
                Run ("BF2142LM.exe","z:\batch\autoit")
            If GUICtrlRead ($radio2) = $GUI_CHECKED Then
                Run("BF2142LMPersonal.exe", "z:\batch\autoit")

Any help would be very helpful

Share this post

Link to post
Share on other sites

Any help would be very helpful

You could use an #include <Autoit.au3> file instead of the run... That is if both your other files are autoit also...

But if that doesn't work, I'm not really sure what you want... The run command should be working if you got the directory correct.

EDIT: Put 'run' instead of 'fun'...

Edited by Piano_Man

My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...