Jump to content

I think this is possible


Recommended Posts

Hi everybody,

I'm new to scripting, and my friend and I were wondering how to go about doing this.

So we know it is possible to do this, but we can't figure out where to start.

Say I have notepad open and I want to fill it with combinations of letters such as

a

b

c

d

...

z

and then

aa

ab

ac

...

az

ba

bb

bc

...

bz

and so on, where every time it hits z, the column just before goes to the next letter. I'd like to be able to do that up to 7 times, so up to zzzzzzz.

If it were numbers I'd just make a while loop and print the $loopcount but when it comes to letters, I am kind of stumped on how to do that.

Any advice on where to start?

Thanks!

-Jake

Link to comment
Share on other sites

Not sure if i understood what you meant, but you said you could do it if it were numbers. you could just make numbers to letters? so that 1 would be "A" and 2 would be "B" etc?

[u]Only by Attempting the Impossible You Can Earn the Remarkable[/u]
Link to comment
Share on other sites

Not sure if i understood what you meant, but you said you could do it if it were numbers. you could just make numbers to letters? so that 1 would be "A" and 2 would be "B" etc?

If it were numbers, I think it would be something like

$loopcount=0
while $loopcount <=1000000
Send(" " & $loopcount)
$loopcount = $loopcount +1
wend

that is what I meant.

Link to comment
Share on other sites

lol 20 minutes on the forum and already a makeshift brute force in the making ;)

I'm pretty sure this would be the worst brute force ever, hehe. I thought about that after posting it, and was hoping nobody would think that was what I was up to.

I assure you my intentions are pure, this is purely a mechanics of coding thing.

Link to comment
Share on other sites

I got it to work!

This is probably really sloppy, and I'm sure it is dumb, but I was able to do it up to 3 letters, which is good enough for us

WinWaitActive("Untitled - Notepad","")
Opt("SendKeyDelay", 0)


$text = ""
$a=65
$b=65
$c=65



    while $b<=90

            while $a <=90
                $text = Chr($a)
                Send("" & $text & "{enter}")
                $a=$a+1
            WEnd
        $a=65

        while $a <=90
            $text = Chr($b) & Chr($a)
            Send("" & $text & "{enter}")
            $a=$a+1
        WEnd
    $b=$b+1

    WEnd


$a=65
$b=65
while $c<=90
    $b=65
    while $b <=90
            $a=65
        while $a <=90
            $text = Chr($c) & Chr($b) & Chr($a)
            Send("" & $text & "{enter}")
            $a=$a+1
        WEnd
                $b=$b+1
    WEnd
$c=$c+1
WEnd
Link to comment
Share on other sites

Here's a 'nudge' in another direction..

For $i = 1 To 3
    ConsoleWrite(Chr(Random(65, 90, 1)) & @LF)
Next

Just replace the ConsoleWrite with Send to get to work with Notepad..

he wanted generate permutations in order... randomizing the output would kind of defeat the purpose...

***edit***

and a for loop where you never increment the iterator never exits - i'm dumb was thinking of a while loop, lol

Edited by cameronsdad
Link to comment
Share on other sites

I get this when I ran that code

>Running:(3.3.4.0):C:\Program Files\AutoIt3\autoit3.exe "C:\Users\Public\randomsendchar.au3"

A

E

U

+>22:33:09 AutoIT3.exe ended.rc:0

+>22:33:10 AutoIt3Wrapper Finished

>Exit code: 0 Time: 1.320

This code 'generates permutations in order'..

For $i = Random(65, 88, 1) To $i + 2
    ConsoleWrite(Chr($i) & @LF)
Next
Edited by somdcomputerguy

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

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...