Invi Posted August 15, 2008 Share Posted August 15, 2008 I have been creating my own password generator, but I have had a problem. I have next code: #include <GUIConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Safe Password Generator [By Invisible_Hack]", 355, 72, 193, 125) GUISetBkColor(0xC0C0C0) $Label1 = GUICtrlCreateLabel("Pass Generada", 8, 24, 71, 18) GUICtrlSetFont(-1, 10, 400, 2, "MV Boli") GUICtrlSetBkColor(-1, 0x00FF00) $Blanco = GUICtrlCreateInput("", 96, 24, 121, 21) $Generar = GUICtrlCreateButton("Generar", 240, 24, 81, 25) GUICtrlSetFont(-1, 8, 400, 0, "Segoe Script") GUICtrlSetBkColor(-1, 0x3399FF) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Generar $Read_Char = GUICtrlRead($Blanco) Random($Read_Char) GUICtrlSetData($Blanco, Random($Read_Char) & @CRLF, "|") EndSwitch WEnd But when i click on the button, it doesnt generate random passwords, it appear one zero in the textbox each time i make clic on the button... Why? I would be very gratefull if someone of you could give me a little help ^^ Link to comment Share on other sites More sharing options...
dbzfanatic Posted August 15, 2008 Share Posted August 15, 2008 You're just reading the data in the text field (empty) to a variable and writing that variable's value to the text field. You aren't really doing anything. Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote] Link to comment Share on other sites More sharing options...
monoceres Posted August 15, 2008 Share Posted August 15, 2008 Hi! To generate a random char you need to use the number you get out of Random() in the Chr() function (it gives the corresponding char int the ascii table). Example: MsgBox(0,"Random char A-Z",Chr(Random(65,90,1))) Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
Szhlopp Posted August 15, 2008 Share Posted August 15, 2008 I have been creating my own password generator, but I have had a problem. I have next code: #include <GUIConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Safe Password Generator [By Invisible_Hack]", 355, 72, 193, 125) GUISetBkColor(0xC0C0C0) $Label1 = GUICtrlCreateLabel("Pass Generada", 8, 24, 71, 18) GUICtrlSetFont(-1, 10, 400, 2, "MV Boli") GUICtrlSetBkColor(-1, 0x00FF00) $Blanco = GUICtrlCreateInput("", 96, 24, 121, 21) $Generar = GUICtrlCreateButton("Generar", 240, 24, 81, 25) GUICtrlSetFont(-1, 8, 400, 0, "Segoe Script") GUICtrlSetBkColor(-1, 0x3399FF) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Generar $Read_Char = GUICtrlRead($Blanco) Random($Read_Char) GUICtrlSetData($Blanco, Random($Read_Char) & @CRLF, "|") EndSwitch WEnd But when i click on the button, it doesnt generate random passwords, it appear one zero in the textbox each time i make clic on the button... Why? I would be very gratefull if someone of you could give me a little help ^^ Here you go=D #include <GUIConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Safe Password Generator [By Invisible_Hack]", 355, 72, 193, 125) GUISetBkColor(0xC0C0C0) $Label1 = GUICtrlCreateLabel("Pass Generada", 8, 24, 71, 18) GUICtrlSetFont(-1, 10, 400, 2, "MV Boli") GUICtrlSetBkColor(-1, 0x00FF00) $Blanco = GUICtrlCreateInput("", 96, 24, 121, 21) $Generar = GUICtrlCreateButton("Generar", 240, 24, 81, 25) GUICtrlSetFont(-1, 8, 400, 0, "Segoe Script") GUICtrlSetBkColor(-1, 0x3399FF) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Generar ;$Read_Char = GUICtrlRead($Blanco) $pass = "" For $I = 1 to 10 $pass &= Random(0, 9, 1) Next GUICtrlSetData($Blanco, $pass) EndSwitch WEnd RegEx/RegExRep Tester!Nerd Olympics - Community App!Login UDFMemory UDF - "Game.exe+753EC" - CE pointer to AU3Password Manager W/ SourceDataFiler - Include files in your au3!--- Was I helpful? Click the little green '+' Link to comment Share on other sites More sharing options...
dbzfanatic Posted August 15, 2008 Share Posted August 15, 2008 (edited) Using monoceres' suggestion: #include <GUIConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Safe Password Generator [By Invisible_Hack]", 355, 72, 193, 125) GUISetBkColor(0xC0C0C0) $Label1 = GUICtrlCreateLabel("Pass Generada", 8, 24, 71, 18) GUICtrlSetFont(-1, 10, 400, 2, "MV Boli") GUICtrlSetBkColor(-1, 0x00FF00) $Blanco = GUICtrlCreateInput("", 96, 24, 121, 21) $Generar = GUICtrlCreateButton("Generar", 240, 24, 81, 25) GUICtrlSetFont(-1, 8, 400, 0, "Segoe Script") GUICtrlSetBkColor(-1, 0x3399FF) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### Dim $Read_Char $i = 1 While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Generar GUICtrlSetData($Blanco,"") $Read_Char = "" For $i = 1 to 9 $Read_Char = $Read_Char & Chr(Random(40,122,1)) Next GUICtrlSetData($Blanco, $Read_Char) EndSwitch WEnd Edit: Forgot to clear $Read_Char when Generate (translated) is pressed. Edited August 15, 2008 by dbzfanatic Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote] 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