noobcoder Posted September 2, 2012 Share Posted September 2, 2012 Hello, To put it simple I'm trying to figure out a way to loop through the alphabet so I can try different key combination. I created a key and now I'm trying to figure out how to have it loop through the global part.. for example, on the first try it does $1 second try $2 etc. I high light and explain the part of the code I need help with below. expandcollapse popupGlobal $1 = "a" Global $2 = "b" Global $3 = "c" Global $4 = "a" Global $5 = "d" Global $6 = "e" Global $7 = "f" Global $8 = "g" Global $9 = "h" Global $10 = "i" Global $11 = "j" Global $12 = "k" Global $13 = "l" Global $14 = "m" Global $15 = "n" Global $16 = "o" Global $17 = "p" Global $18 = "q" Global $19 = "r" Global $20 = "s" Global $21 = "t" Global $22 = "u" Global $23 = "v" Global $24 = "w" Global $25 = "x" Global $26 = "y" Global $27 = "z" Local $message = 0 Do Sleep(5000) Send("{BS}") Sleep(150) Send("{BS}") Sleep(150) Send("{q}") Sleep(150) Send(<<< hmm) ; This is where I need help. I know I can not put just $message or else it will just give me 1, 2 3 etc right? Not $1, $2 which would translate to a, b etc which is what I need. I was thinking something like Send($ & $message) but of course that syntax does not work. sleep(150) Send("{ENTER}") Sleep(400) Send("{ENTER}") Sleep(400) $message = $message + 1 until $message = 27 Link to comment Share on other sites More sharing options...
stormbreaker Posted September 2, 2012 Share Posted September 2, 2012 Something like this could get ya started: $ALPHABET = 'abcdefghijklmnopqrstuvwxyz' $ARRAY = StringSplit($ALPHABET, "") For $i = 1 to $ARRAY[0] Send('' & $ARRAY[$i]) Next ---------------------------------------- :bye: Hey there, was I helpful? ---------------------------------------- My Current OS: Win8 PRO (64-bit); Current AutoIt Version: v3.3.8.1 Link to comment Share on other sites More sharing options...
water Posted September 2, 2012 Share Posted September 2, 2012 Welcome to AutoIt and the forum,A good place to start learning AutoIt is the Wiki.Have a look at the Getting started and the Tutorials sections.You need something like:Global $sAlphabet = "abcdefghijklmnopqrstuvwxyz" $aAlphabet = StringSplit($sAlphabet, "") For $iIndex = 1 to $aAlphabet[0] ConsoleWrite($aAlphabet[$iIndex] & @LF) Next My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
noobcoder Posted September 2, 2012 Author Share Posted September 2, 2012 Ahh thanks for the replys! This should set me in the right path, I feel really, really inefficient after seeing your two example codes.. so much code on my end and all over the place for so little. Link to comment Share on other sites More sharing options...
water Posted September 2, 2012 Share Posted September 2, 2012 It won't take too much time and you will code as efficient as we do My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
JohnOne Posted September 2, 2012 Share Posted September 2, 2012 For $i = 97 To 122 Send(Chr($i)) Next AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. 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