Jump to content
Sign in to follow this  
Info

InputBox

Recommended Posts

Info

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.

Share this post


Link to post
Share on other sites
James

$Serial = "AutoIt"
$Input = InputBox(@scriptname, "Insert code:")
Do 
If $Input = $serial Then
     MsgBox(0, "Hey!", "Correct!")
     Exit
Else
     MsgBox(0, "Wrong!", "Wrong!")
EndIf
Until $Input = $Serial

Edited by JamesB

Share this post


Link to post
Share on other sites
Info

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

Share this post


Link to post
Share on other sites
Info

So how do I make it?

Share this post


Link to post
Share on other sites
James

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

Share this post


Link to post
Share on other sites
Info

Not working, still opening the InputBox every time I run it. =/

Share this post


Link to post
Share on other sites
Info

Oh, you edited it :)

It's working now, thanks :)

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  

×