Jump to content

Recommended Posts

Posted

I took a look at the help file, but still did'nt understand how to EXIT or MsgBox if the serial was correct or incorrect in the InputBox...

Thanks.

Posted (edited)

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
Posted (edited)

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

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
×
×
  • Create New...