Penisaurus Posted February 24, 2010 Posted February 24, 2010 Hello, I'm still a complete beginner with AutoIt, so I'm not sure if this could be done using a simple command or not.Lets say I have a very simple script, to log into a website. (I'm still unfamiliar with the Mouse commands, so I use a simple Tab/Enter combo.)Here is my script:$Username = "" $Password = "" ShellExecute("http://www.myspace.com") Sleep(5000) Send("{TAB}") Send($Username) ; Username goes here Send("{TAB}") Send($Password) ; Password goes here Send("{ENTER}") Exit ; End ScriptNow, my question is, if compiled and sent to someone, they probably wouldn't know how to edit/decompile it,So how would you let them edit the settings?Lets say from a file in the folder along with the compiled script named settings.txt:Username="" Password=""How could you, in the script, make it import those specified settings?This might be more work than it's worth, but it's something I've been questioning.
hot202 Posted February 24, 2010 Posted February 24, 2010 (edited) With Iniread. or maybe input boxes? Inputbox $Input2 = GUICtrlCreateInput("User Name", 72, 145, 185, 21) $Input1 = GUICtrlCreateInput("Password", 72, 120, 185, 21, $ES_PASSWORD) $Username = GUICtrlRead($Input1) $Password = GUICtrlRead($Input2) ShellExecute("http://www.myspace.com") Sleep(5000) Send("{TAB}") Send($Username) ; Username goes here Send("{TAB}") Send($Password) ; Password goes here Send("{ENTER}") Exit IniRead If Not FileExists(@ScriptDir & "/SettingsIni.ini") Then IniWrite(@ScriptDir & "/SettingsIni.ini", "UserName/Password", "Username","") IniWrite(@ScriptDir & "/SettingsIni.ini", "UserName/Password", "Password","") EndIf $Username = IniRead(@ScriptDir & "/SettingsIni.ini", "UserName/Password", "Username","") $Password = IniRead(@ScriptDir & "/SettingsIni.ini", "UserName/Password", "Password","") ShellExecute("http://www.myspace.com") Sleep(5000) Send("{TAB}") Send($Username) ; Username goes here Send("{TAB}") Send($Password) ; Password goes here Send("{ENTER}") Exit Edited February 24, 2010 by hot202
Penisaurus Posted February 24, 2010 Author Posted February 24, 2010 Ah, thank you!The IniRead works great for me. :]Still confused on the Input part, but the Ini works well.
hot202 Posted February 24, 2010 Posted February 24, 2010 with the inputboxes you need to make a gui its in the help file look for GuiCreate
hot202 Posted February 24, 2010 Posted February 24, 2010 You can even look up Ie.au3 you wont have to send tab to go to the password and username.
FinalVersion Posted February 24, 2010 Posted February 24, 2010 Ie functions would defiantly be better, also someone posted a Firefox UDF. [center][+] Steam GUI [+][+] Clipboard Tool [+][+] System :: Uptime [+][+] StarCraft II Mouse Trap [+][/center]
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