Daggett Posted July 14, 2005 Posted July 14, 2005 ok i want this script when i press "save Password" to write the password in the data.inibut for some strange reason it doesn't write the password: [Password] key=after key= it has to set the password i entered in the input. here's my script:#include <file.au3>#include <GUIConstants.au3>opt("GUIOnEventMode",1)opt ("SendKeyDelay", 0);*******************************************************************************func close () Exitendfunchotkeyset ("{esc}", "close")$savedpassword = iniread (@scriptdir & "\Files\data.ini", "Password", "key", "");**********************GUI******************************************************Guicreate ("ROSE Online Command Centre", 400, 500, -1, -1)$Passwordbox = GUICtrlCreateInput ($savedpassword, 30 , 30, 100, 17, $ES_PASSWORD)$zavepassword = GUICtrlCreateButton ("Save Password",30, 47, 80, 18)guictrlsetonevent ($zavepassword, "writepassword")$passworder = GUICtrlRead ($Passwordbox)guisetonevent ($GUI_EVENT_CLOSe, "close")guisetstate (@sw_show);*******************************************************************************func writepassword () _filecreate (@scriptdir & "\data.ini") iniwrite (@scriptdir & "\data.ini", "Password", "key", $passworder)endfuncwhile 1 sleep (100000)wendand it does read the password that's in the input because if you use:run ("notepad.exe")send ($passworder)it does type the password that's enterd in the input.
LxP Posted July 14, 2005 Posted July 14, 2005 (edited) $passworder = GUICtrlRead ($Passwordbox)This line should be moved to your writePassword() method because otherwise the $passworder variable will only ever contain the saved password.If that doesn't solve the problem for you then maybe adding this line to the start of your script will:global $passworder Edited July 14, 2005 by LxP
Daggett Posted July 14, 2005 Author Posted July 14, 2005 thanks it works! so simple and i didn't see it
Mosquitos Posted September 7, 2005 Posted September 7, 2005 #include <file.au3> #include <GUIConstants.au3> opt("GUIOnEventMode",1) opt ("SendKeyDelay", 0) ;******************************************************************************* func close () Exit endfunc hotkeyset ("{esc}", "close") $savedpassword = iniread (@scriptdir & "\data.ini", "Password", "key", "") ;**********************GUI****************************************************** Guicreate ("ROSE Online Command Centre", 400, 500, -1, -1) $Passwordbox = GUICtrlCreateInput ($savedpassword, 30 , 30, 100, 17, $ES_PASSWORD) $savepassword = GUICtrlCreateButton ("Save Password",30, 47, 80, 18) guictrlsetonevent ($savepassword, "writepassword") guisetonevent ($GUI_EVENT_CLOSe, "close") guisetstate (@sw_show) ;******************************************************************************* func writepassword () $passworder = GUICtrlRead ($Passwordbox) _filecreate (@scriptdir & "\data.ini") iniwrite (@scriptdir & "\data.ini", "Password", "key", $passworder) endfunc while 1 sleep (100000) wend I wanna include a $accountbox. $Passwordbox = GUICtrlCreateInput ($savedpassword, 30 , 30, 100, 17, ... $accountbox = GUICtrlCreateInput($savedaccount, 30, 60, 100, 17,... How do i save the account into the data.ini file please? Sapiente vince, rex, noli vincere ferro!
Valuater Posted September 7, 2005 Posted September 7, 2005 maybe like this... Func writepassword () If Not FileExists(@scriptdir & "\data.ini") Then _filecreate (@scriptdir & "\data.ini") EndIf $passworder = GUICtrlRead ($Passwordbox) iniwrite (@scriptdir & "\data.ini", "Password", "key", $passworder) $Accounter = GUICtrlRead ($accountbox ) iniwrite (@scriptdir & "\data.ini", "Account", "key", $Accounter) Endfunc 6)
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