TK_Incorperate Posted October 17, 2005 Share Posted October 17, 2005 Ok i've just tried searching the help file to add a password to a program im making..... and i've come up with this right here....... $pass = InputBox("Passwrd", "Please enter a valid password.", "fruitloop", "*M") now in this, i was hoping fruitloop (that wasnt really it, is just an example) would be the password, and in order to run this script.... you'd need to use this, and i also put this to make sure if someone cancled the script would terminate If @error = 1 Then Exit EndIf now this didnt work... so i have 2 questions here.... 1) How do i make the password work? i mean for this the password worked yes, but it automaticaly put the password in the input box AND! if you deleted the password, or if you put any other input it would still start the script 2) Is there any way i can make a list of passwords (sat a list of 5 maybe 10 passwords) that if any of them are used it will work? Example for question 2: Making it so ANY of the passwords in the password list can be used, but NOT having to enter all of them, ONLY one Password list: Fruitloop Miniwheat Cheerio Cornflake Sugarhoop Link to comment Share on other sites More sharing options...
svennie Posted October 17, 2005 Share Posted October 17, 2005 Ok i've just tried searching the help file to add a password to a program im making..... and i've come up with this right here.......$pass = InputBox("Passwrd", "Please enter a valid password.", "fruitloop", "*M") now in this, i was hoping fruitloop (that wasnt really it, is just an example) would be the password, and in order to run this script.... you'd need to use this, and i also put this to make sure if someone cancled the script would terminateIf @error = 1 Then Exit EndIfnow this didnt work... so i have 2 questions here....1) How do i make the password work? i mean for this the password worked yes, but it automaticaly put the password in the input box AND! if you deleted the password, or if you put any other input it would still start the script2) Is there any way i can make a list of passwords (sat a list of 5 maybe 10 passwords) that if any of them are used it will work? Example for question 2:Making it so ANY of the passwords in the password list can be used, but NOT having to enter all of them, ONLY onePassword list:FruitloopMiniwheatCheerioCornflakeSugarhoopThis will work:$Password=InputBox("Caption","Your password:","","*") If @error Then Exit If $Password="Fruitloop" or $Password="Miniwheat" or $Password="Cheerio" Then ;password right Else ;password unright EndIfFill in your whole password list. Sorry for my English, I'm Dutch... =DMedia UDFINet Adv UDF Link to comment Share on other sites More sharing options...
TK_Incorperate Posted October 17, 2005 Author Share Posted October 17, 2005 thank you very appreceated, it sucks being new at this cuz im usualy good at stuff.... and im horrible at this haha but its fun Link to comment Share on other sites More sharing options...
TK_Incorperate Posted October 17, 2005 Author Share Posted October 17, 2005 ok... critical problem, it's STILL allowing it to use anything in input.... meaning it doesnt require a password, so... i can put in saudfhsi and it'll still accept it... is there any way to make it so it will ONLY accept those passwords?? Link to comment Share on other sites More sharing options...
buzz44 Posted October 17, 2005 Share Posted October 17, 2005 Post your code. qq Link to comment Share on other sites More sharing options...
TK_Incorperate Posted October 17, 2005 Author Share Posted October 17, 2005 (edited) well here's what my code looks like somewhat.... $Password=InputBox("Caption","Your password:","","*") If @error Then Exit If $Password="Fruitloop" or $Password="Miniwheat" or $Password="Cheerio" Then ;password right Else ;password unright EndIf Send("{ALT}+{TAB}") Sleep(4000) HotKeySet("d", "Terminate") While 1 TrayTip("Title Here", "Content Here", 10) Send(Put Button Here) Sleep(Put Sleep Time Here) WEnd Func Terminate() Exit 0 EndFunc all of it works fine except for the password..... Edit: and i know the "Put Button Here, Title Here, ect." dont work, i just put that in cuz i rounded this up just as a quick lil thing Edited October 17, 2005 by TK_Incorperate Link to comment Share on other sites More sharing options...
buzz44 Posted October 17, 2005 Share Posted October 17, 2005 (edited) ;password right ;password unright You were supposed to edit out those comments an put your code lol, try this... $Password=InputBox("Caption","Your password:","","*") If @error Then Exit If $Password = "Fruitloop" Or $Password = "Miniwheat" Or $Password = "Cheerio" Then MsgBox(0, "Test", "The password entered was correct") MsgBox(0, "Do something", "Do something when password is right") Else MsgBox(0, "Test", "The password entered was incorrect") MsgBox(0, "Do something", "Do something when password is wrong") EndIf Send("{ALT}+{TAB}") Sleep(4000) HotKeySet("d", "Terminate") While 1 TrayTip("Title Here", "Content Here", 10) Send(Put Button Here) Sleep(Put Sleep Time Here) WEnd Func Terminate() Exit EndFunc Edited October 17, 2005 by Burrup qq Link to comment Share on other sites More sharing options...
TK_Incorperate Posted October 17, 2005 Author Share Posted October 17, 2005 all that does is makes a window pop up.... with that i can STILL enter any password and it'll work, i want ONLY!! the passwords I CHOSE to work, how can i do this? both the ways you have said with making the boxes pop up, and the way he said without, both of them allow the script to keep running.... Link to comment Share on other sites More sharing options...
buzz44 Posted October 17, 2005 Share Posted October 17, 2005 (edited) Perhaps your not understanding. I used the msgbox's as an example. Change the msgbox's to what you want your script to do depending on whether the password was correct or incorrect. Its not that hard... If $Password = "Fruitloop" Or $Password = "Miniwheat" Or $Password = "Cheerio" Then MsgBox(0, "Test", "The password entered was correct") MsgBox(0, "Do something", "Do something when password is right") Else ; THE PASSWORD WAS WRONG Exit EndIf Edited October 17, 2005 by Burrup qq Link to comment Share on other sites More sharing options...
TK_Incorperate Posted October 17, 2005 Author Share Posted October 17, 2005 thanks works great... lol sorry for being a little slow on that one, i thought the "EndIf" was mant to stop the script if the password wasnt right, but thanks this works perfectly Link to comment Share on other sites More sharing options...
buzz44 Posted October 17, 2005 Share Posted October 17, 2005 (edited) Np . Alternatively you could do it this way... $Password=InputBox("Caption", "Your password:", "", "*") If @error Then Exit If $Password = "Fruitloop" Or $Password = "Miniwheat" Or $Password = "Cheerio" Then Send("{ALT}+{TAB}") Sleep(4000) HotKeySet("d", "Terminate") While 1 TrayTip("Title Here", "Content Here", 10) Send(Put Button Here) Sleep(Put Sleep Time Here) WEnd EndIf Func Terminate() Exit EndFunc That way the code is contained inside the loop and no "Else" is used. Because there is no code after the EndIf that isn't located outside a function, it will exit. If Blah ;Stuff EndIf Exit Is the same as... If Blah ;Stuff EndIf If there is no more code following. Edited October 17, 2005 by Burrup qq Link to comment Share on other sites More sharing options...
Garanator Posted October 17, 2005 Share Posted October 17, 2005 Is there a way to make a passworded program only work once?Like you enter the pass and then the program runs but if u want to run it again it won;t let u? Link to comment Share on other sites More sharing options...
Skruge Posted October 17, 2005 Share Posted October 17, 2005 Is there a way to make a passworded program only work once?Like you enter the pass and then the program runs but if u want to run it again it won;t let u?Yes, but you should start a new topic for this, and be more specific. Run once per user? per password? per system? It can all be done using various methods. [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font] Link to comment Share on other sites More sharing options...
gamerman2360 Posted October 17, 2005 Share Posted October 17, 2005 (edited) FYI for anyone making a pass. Make sure it's not a pass to anything else. It can be found out by looking at the script or even in the compiled .exe version it can be decompiled and found out. Even the decompileing pass isnt safe. So watch out. If you want to make it just a little harder try encoding the pass. _StringEncryption() is an included func in the string.au3 in the includes. Edit: Lol, even that isn't entirly safe... Edited October 17, 2005 by gamerman2360 Link to comment Share on other sites More sharing options...
/dev/null Posted October 17, 2005 Share Posted October 17, 2005 _StringEncryption() is an included func in the string.au3 in the includes.Edit: Lol, even that isn't entirly safe...It's by no means more secure than storing any password directly in the script. Instead of your "real" password, you'll put the encryption password in clear into the script. So it's just one function more to call for a "hacker". Really, forget about "securing" passwords with _StringEncrypt in your scripts! It might give you a feeling of security while there is absolutely no security at all.CheersKurt __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
gamerman2360 Posted October 17, 2005 Share Posted October 17, 2005 Ya, true. Just know nothing in autoit is absolutely safe. 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