sarkar112 Posted April 23, 2005 Share Posted April 23, 2005 (edited) This is an example of a simple login script. I'm pretty sure it has a few bugs. But, dont flame me if its bad, because, I'm a newb. Hopefully, someone will fix this script and make a desent script out of it. Global $username Global $password Global $muahahaha = InputBox( "username", "What is your username?", "", "") Global $passwd = InputBox("password", "Enter your password.", "", "*") ; ---------------------------------------------------------------------------- ; ; AutoIt Version: 3.1.0 ; Author: Sarkar112 <sarkar112@gmail.com/sarkar112@walla.com> ; ; Script Function: ; To Learn From (A simple login example, Creates an inputbox that asks for ;username and password, If username and password is correct creates msgbox, if;incorrect, exits script) ; ---------------------------------------------------------------------------- _Login($muahahaha,$passwd) Func _Login ($username,$password) If $username = "username" Then If $password = "secret" Then MsgBox ( 1, "Correct", "Click OK to exit this script") Else MsgBox ( 1, "wrong", "Click OK to Exit this script") EndIf EndIf EndFunc BTW: Can someone edit this and please make it bug-free. DO NOT FLAME ME! EDIT: I forgot the inputbox =_= EDIT2: Alot of errors fixed. EDIT3: Script tested and two/three bugs fixed. Edited April 24, 2005 by sarkar112 Link to comment Share on other sites More sharing options...
herewasplato Posted April 23, 2005 Share Posted April 23, 2005 Lar..... Did you make the flame and subsequent comment go away? You are so kind. :-) I was composing a reply to sarkar112, but could not decide if the original post was serious, so I went off to read all of sarkar112's other posts to "know my audience" and when I came back - well... things were different. .....thanks..... [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
buzz44 Posted April 23, 2005 Share Posted April 23, 2005 I think it is quite obvious that this is not a serious post/example. qq Link to comment Share on other sites More sharing options...
layer Posted April 24, 2005 Share Posted April 24, 2005 I think it is quite obvious that this is not a serious post/example.<{POST_SNAPBACK}>He stated he was a noob, so why go beatin' on him? FootbaG Link to comment Share on other sites More sharing options...
sarkar112 Posted April 24, 2005 Author Share Posted April 24, 2005 soo many edits in a day Link to comment Share on other sites More sharing options...
herewasplato Posted April 24, 2005 Share Posted April 24, 2005 (edited) So you *were* serious. Does the code below do what you had in mind? ; -------------------------------------------------- ; ; Script Function: ; To Learn From A simple login example, ; Creates an inputbox that asks for ; username and password. ; If username and password is correct ; creates msgbox; ; if, incorrect, exits script. ; ; -------------------------------------------------- $username = InputBox( "username", "What is your username?", "", "") $password = InputBox("password", "Enter your password.", "", "*") _Login() Func _Login() If $username <> "username" Then Exit If $password <> "secret" Then Exit MsgBox(1, "Correct", "Click OK to exit this script") EndFunc Edited April 24, 2005 by herewasplato [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
sarkar112 Posted April 25, 2005 Author Share Posted April 25, 2005 So you *were* serious.Does the code below do what you had in mind?; -------------------------------------------------- ; ; Script Function: ; To Learn From A simple login example, ; Creates an inputbox that asks for ; username and password. ; If username and password is correct ; creates msgbox; ; if, incorrect, exits script. ; ; -------------------------------------------------- $username = InputBox( "username", "What is your username?", "", "") $password = InputBox("password", "Enter your password.", "", "*") _Login() Func _Login() If $username <> "username" Then Exit If $password <> "secret" Then Exit MsgBox(1, "Correct", "Click OK to exit this script") EndFunc<{POST_SNAPBACK}>I think... Its pretty much the same thing but shorter and easyer to understand. Link to comment Share on other sites More sharing options...
herewasplato Posted April 25, 2005 Share Posted April 25, 2005 I think... Its pretty much the same thing but shorter and easyer to understand.<{POST_SNAPBACK}>Your description said, "if, incorrect, exits script" so I removed thisMsgBox ( 1, "wrong", "Click OK to Exit this script")Is that what you intended or did you want a msgbox and then exit?I did not change the flag of the msgbox from 1 to 0... perhaps you should change that. If you are not going to do anything with the cancel button, then I would not show it to the user.Hope you had fun... [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now