Jump to content

Input and Variables


Recommended Posts

Alright. I need a input box to ask the user what the name of the Folder at which they hold the files for Diablo II; because this is where the program will enter the D2War Files so they can play on our server.

I don't know how to enter the variable into the DirCopy lines so that it enters w/e the name they enter.

Heres the Script.

$D2F = InputBox( "Important", "What is your D2War folder named?")

While 1
    $nMsg = GUIGetMsg()
        Case $nMsg = $GUI_EVENT_CLOSE
        Case $nMsg = $Install
                DirCopy( @scriptdir &"\Components\d2war_files_v1.1", @programfilesdir &"\"&$D2F"", 1)
                If Not @Error Then
                    MsgBox( 0, "Successful", "The D2War files were successfully entered into your D2War folder.")
        Case $nMsg = $ReadMe
                ShellExecute(@ScriptDir &"\Components\ReadMe.txt")
            Case $nMsg = $MapHack
                $MsgBox = MsgBox( 4, "Warning", "This will close D2War Installer V1.02... Are you sure?")
                If $MsgBox = 6 Then
                        ShellExecute(@ScriptDir &"\Components\MapHack.exe")
                If $MsgBox = 7 Then
                    MsgBox( 1, "Ok", "Ok, operation canceled.")

Please help if you can , thank you none the less.

Link to comment
Share on other sites

If I was you, I would do something like this:

$Dir = FileSelectFolder("Select Diablo II Folder.", "C:\")

Some people might not have thier Diablo II folder set for C:\Program Files. They could have it installed in a diffrent location. The FileSelectFolder will display a Folder Browsing Dialog for them to select the folder instead of relying on them typing it correctly.

For the copy command try this:

$Dir = FileSelectFolder("Select Diablo II Folder.", "C:\")
DirCopy( @scriptdir &"\Components\d2war_files_v1.1", $Dir & "\", 1)

[sub]Quantum mechanics: The dreams stuff is made of[/sub]

Link to comment
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

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...