Jump to content

First attempt to code anything - need help with Do Until


 Share

Recommended Posts

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.

Global $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

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

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 - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

It won't take too much time and you will code as efficient as we do B)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...