Jump to content

InputBox


Info
 Share

Recommended Posts

I need some help again :)

I want it to stop showing the InputBox once the correct pass is entered.

So I did something like this:

If FileExists ( "C:\Lol.txt") = True Then
MsgBox ( 64, "Yay!", ":DDDD")
Else
$Serial = "AutoIt"
$Input = InputBox(@scriptname, "Insert code:")
If $Input = $serial Then
     FileWrite ( "C:\Lol.txt")
     MsgBox(0, "Hey!", "Correct!")
     Exit
Else
     MsgBox(0, "Wrong!", "Wrong!")
EndIf
Endif

And it does an error when I run it, why?

Edited by Info
Link to comment
Share on other sites

If FileExists("C:\Lol.txt") = True Then
    MsgBox(64, "Yay!", ":DDDD")
Else
    $Serial = "AutoIt"
    $Input = InputBox(@ScriptName, "Insert code:")
    If $Input = $Serial Then
        $File = FileOpen("C:\Lol.txt", 2)
        FileWrite($File, "C:\Lol.txt")
        MsgBox(0, "Hey!", "Correct!")
        FileClose($File)
        Exit
    Else
        MsgBox(0, "Wrong!", "Wrong!")
    EndIf
EndIf

Fixed file write!

Edited by JamesB
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
 Share

  • Recently Browsing   0 members

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