Jump to content
Sign in to follow this  
Lugio

Cancel Button doesn´t work

Recommended Posts

Lugio

helly guys,

I got a problem with my script.

I want it to close whenever i press cancel but i must have done something wrong.

$i = InputBox("Passwordcheck","Insert Password","","*")
If $i = "hlMG83csk" Then
    MsgBox(0,"Sucess","Correct Password")
    Exit
ElseIf $i <> "hlMG83csk" Then
    MsgBox(0,"FAIL","Wrong password try again")
ElseIf @error = 1 Then
        Exit
        EndIf
While 1
    $i = InputBox("Passwordcheck","Insert Password","","*")
    If $i = "hlMG83csk" Then
        MsgBox(0,"Sucess","Correct Password")
        Exit
    ElseIf $i <> "hlMG83csk" Then
        MsgBox(0,"FAIL","Wrong password try again")
    ElseIf @error = 1 Then
            Exit
            EndIf
    WEnd

Share this post


Link to post
Share on other sites
JohnOne

$i = InputBox("Passwordcheck", "Insert Password", "", "*")
If $i = "hlMG83csk" Then
    MsgBox(0, "Sucess", "Correct Password")
    Exit
ElseIf @error = 1 Then
    Exit
ElseIf $i <> "hlMG83csk" Then
    MsgBox(0, "FAIL", "Wrong password try again")
EndIf


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites
Lugio

@ Forumer100 i want to get the program to exit whenever I press the cancel button in the inputbox.

The Messagebox works fine.

@ JohnOne your solution doesn´t work, but i don´t know why

Share this post


Link to post
Share on other sites
bogQ

Heare you go,

this is all that your script need

While 1
    $i = InputBox("Passwordcheck","Insert Password","","*")
    If @error = 1 Then Exit
    Select
        Case $i = "hlMG83csk"
            MsgBox(0,"Sucess","Correct Password")
            Exit
        Case Else
            MsgBox(0,"FAIL","Wrong password try again")
    EndSelect
WEnd

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 

Share this post


Link to post
Share on other sites
Lugio

@forumer100 still not getting yours but thats most likely cause I´m a newbie ;D

@bogQ thx it works great finnaly solved that problem^^

Share this post


Link to post
Share on other sites
Exit

@forumer100 still not getting yours but thats most likely cause I´m a newbie ;D

Just curious, what went wrong with my code ? Just let it run as is.

My UDFs, Abbrevs and Snippets
If you like my post, just click the like button :) 

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  

×