Shakala Posted September 21, 2009 Posted September 21, 2009 Ok well, here is a example of what i am working with and what i want to happen... I have a GUI set up with 3 input boxes and a Begin Button. The user types information into these 3 boxes, and press Begin. The script opens up a web page and types the information into 3 different areas. I have it all set up and working atm. But, i want the script to break apart the word that was previously inputted, and to add some delays between each letter it types (H(delay .25second)e(delay .25seconds) l (delay .25seconds) l (delay .25seconds) 0(delay .25seconds) etc) Here is a coding example of what i want it to do. (this is just an example that might be able to help clarify what im trying to say) $AccountName = "Johnny" ;Some Text (unknown to me on the real script) $AccountPass = "asdf" ;More text (also unknown to me on the real script) Send($AccountName) ;i want it to send J + delay O + delay H + delay N + delay etc etc... Send($AccountPass) ;i want it to send a + delay s + delay d + delay f + delay etc etc... I assume this will need some sort of a forloop, but i am unsure where to start for it to break apart the word. Something i thought of would make a different input box for each letter, and assigning them each to a different variable and doing it that way, but i feel that that is unnecessary. I am looking for this because i am making a script for a browser based game, and i want to make sure 100% everything is delayed as a precaution. i am adding more than i need, but i like to be safe with what i am doing. It is also a way for me to become more familiar with the way gui-s work and also coding in AutoIt If you can help out in any way, that would be amazing. Thanks ~Shakala SIDENOTE: If you need to see my code, let me know. *I am newish to AutoIt so if you do want to see my code, i assure you, it will be messy ^^ Fairwarning
powerpoison Posted September 21, 2009 Posted September 21, 2009 (edited) u can make it like this: mouseclick("left",x,y,1,500) the x y coord of the account input text area $1stl= text area input $2ndl= second text area input $3rdl=.... $4thl=.... Send("$1stl") sleep(250) Send("$2ndl") sleep(250) Send("3rdl") sleep(250) Send("$4thl") sleep(250) same for the psw... u should obviusly make like 8-9 text area with only 1-2 char allowed per text area... maybe there is some smarter, harder, longer way... but i actually know only this and this should also solve ur problem... (if i helped mark as answearer) Edited September 21, 2009 by powerpoison
colafrysen Posted September 21, 2009 Posted September 21, 2009 It sure is $AccountName = "Johnny" ;Some Text (unknown to me on the real script) $AccountPass = "asdf" ;More text (also unknown to me on the real script) $delay = 100 $aAcc = StringSplit($AccountName,"") $aPass = StringSplit($AccountPass,"") For $i=1 To $aAcc[0] Step 1 Send ($aAcc[$i]) Sleep($delay) Next For $i=1 To $aPass[0] Step 1 Send ($aPass[$i]) Sleep($delay) Next [font="Impact"]Use the helpfile, It´s one of the best exlusive features of Autoit.[/font]http://support.microsoft.com/kb/q555375ALIBI Run - a replacement for the windows run promptPC Controller - an application for controlling other PCs[size="1"]Science flies us to the moon. Religion flies us into buildings.[/size][size="1"]http://bit.ly/cAMPZV[/size]
Zedna Posted September 21, 2009 Posted September 21, 2009 (edited) Opt('SendKeyDelay',250) $AccountName = "Johnny" ;Some Text (unknown to me on the real script) $AccountPass = "asdf" ;More text (also unknown to me on the real script) Send($AccountName) ;i want it to send J + delay O + delay H + delay N + delay etc etc... Send($AccountPass) ;i want it to send a + delay s + delay d + delay f + delay etc etc... I think I'm winner here :-) Edited September 21, 2009 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search
colafrysen Posted September 21, 2009 Posted September 21, 2009 Opt('SendKeyDelay',250) $AccountName = "Johnny" ;Some Text (unknown to me on the real script) $AccountPass = "asdf" ;More text (also unknown to me on the real script) Send($AccountName) ;i want it to send J + delay O + delay H + delay N + delay etc etc... Send($AccountPass) ;i want it to send a + delay s + delay d + delay f + delay etc etc... I feel owned Why do I do everything the hard way [font="Impact"]Use the helpfile, It´s one of the best exlusive features of Autoit.[/font]http://support.microsoft.com/kb/q555375ALIBI Run - a replacement for the windows run promptPC Controller - an application for controlling other PCs[size="1"]Science flies us to the moon. Religion flies us into buildings.[/size][size="1"]http://bit.ly/cAMPZV[/size]
Hawkwing Posted September 21, 2009 Posted September 21, 2009 (edited) Or you could simply use Opt("SendKeyDelay", miliseconds). Edit: Apparently Zedna had that idea 2 minutes ago. I need to remember to refresh the page Edited September 21, 2009 by Hawkwing The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again.
Shakala Posted September 21, 2009 Author Posted September 21, 2009 (edited) It sure is $AccountName = "Johnny" ;Some Text (unknown to me on the real script) $AccountPass = "asdf" ;More text (also unknown to me on the real script) $delay = 100 $aAcc = StringSplit($AccountName,"") $aPass = StringSplit($AccountPass,"") For $i=1 To $aAcc[0] Step 1 Send ($aAcc[$i]) Sleep($delay) Next For $i=1 To $aPass[0] Step 1 Send ($aPass[$i]) Sleep($delay) Next Thanks. im going to try The post below yours first (Aka, Zedna's) u can make it like this: mouseclick("left",x,y,1,500) the x y coord of the account input text area $1stl= text area input $2ndl= second text area input $3rdl=.... $4thl=.... Send("$1stl") sleep(250) Send("$2ndl") sleep(250) Send("3rdl") sleep(250) Send("$4thl") sleep(250) same for the psw... u should obviusly make like 8-9 text area with only 1-2 char allowed per text area... maybe there is some smarter, harder, longer way... but i actually know only this and this should also solve ur problem... (if i helped mark as answearer) I was planning on doing that as a last resort sort of thing. Thanks for posting. Opt('SendKeyDelay',250) $AccountName = "Johnny" ;Some Text (unknown to me on the real script) $AccountPass = "asdf" ;More text (also unknown to me on the real script) Send($AccountName) ;i want it to send J + delay O + delay H + delay N + delay etc etc... Send($AccountPass) ;i want it to send a + delay s + delay d + delay f + delay etc etc... hm... lol seems too easy lol. Im going to try it now. Well, Since Zedna's single line of code worked exactly how i needed it to, im giving the gold star to them ^^ Edited September 21, 2009 by Shakala
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