Sign in to follow this  
Followers 0
OldQuestions

Incremental letters

6 posts in this topic

Hi, I'm trying to use letters like a number system because I cannot use numbers in what I am doing.

I need to get from aaaa to zzzz, no numbers, no upper case.

Heres my junktacular code that does not work. Using autoit 2, 3 is installed...

CODE
Run("Notepad.exe", "", @SW_MAXIMIZE)

WinActivate("Untitled - Notepad", "")

sleep(500)

$key="aaaa";// case does not matter in character names, if exists will say no matter case.

Send(string($key));//send first

sleep ( 500 )

;increase key here...

$pins=StringLen ( $key ) ;//get length of current key

;;MsgBox(0, "Test", "String Length is " +string($pins));4

;Get All Pins

Global $pin[$pins];//Create pins array

;//Set pins array

For $i = 0 to $pins-1

$pin[$i]=StringMid($key, $i+1, 1)

;MsgBox(0, "Pin"+string($i)+"is", string($pin[$i]))

Next

;==start loop==

sleep (200)

Do

Send("{Enter}")

;$testvar="a"

;$testvar=Chr( Asc($testvar)+1);//increase current pin

;MsgBox(0, "increase test", string($testvar))

;Tumble Pins Here; Note: Do in same loop later for faster results? no, cant order.

For $i = $pins-1 to 0 Step -1

;;;if pin=z, make a, and increase pin+1 by 1. else increase by 1.

If $pin[$i] NOT ="z" Then

$pin[$i]=Chr( Asc($pin[$i])+1);//increase current pin

;MsgBox(0, "increase test", string($pin[$i]))

Else

$pin[$i]="a"

If $i>0 Then

$pin[$i-1]=Chr( Asc(string($pin[$i-1]))+1 );//increase next pin

EndIf

EndIf

Next

;Recompile Key here...

For $i = 0 to $pins-1

Send(string($pin[$i]));

Next

;$key="zzzz";//end script.

Until $key="zzzz";//absolut end of trying.

sleep (200)

;==end loop==

Made the variable names for simplicity, I just need a little help.

If you're really curious I'm trying to create incremental character names in a computer game, the whole code there was made to find a way to do it.

Thank you for your help.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

like this i haven't coded in awhile and am a little bored, it will send aaaa then bbbb then cccc, cuz once again and still noobs do not specify exactly what they want. How do you want it to increase. Like aaab, aaac, be specific.

forgot my snippet of code

For $i = 97 To 122
    Send(Chr($i)Chr($i)Chr($i)Chr($i))
Next
Edited by Catindog

Share this post


Link to post
Share on other sites

like this i haven't coded in awhile and am a little bored, it will send aaaa then bbbb then cccc, cuz once again and still noobs do not specify exactly what they want. How do you want it to increase. Like aaab, aaac, be specific.

forgot my snippet of code

For $i = 97 To 122
    Send(Chr($i)Chr($i)Chr($i)Chr($i))
Next
oÝ÷ Ûú®¢×¶§Ø^˧¶Ê&zØb    bëaÆ®¶­s`¤f÷"b33c¶ÒFò#` f÷"b33c¶"ÒFò#` f÷"b33c¶2ÒFò#` b33c·FVæÖRÒ6"b33c¶²cBfײ6"b33c¶"²cBfײ6"b33c¶2²cB ×6t&÷ÂgV÷C´æÖRgV÷C²Âb33c·FVæÖR æWB æWB¤æWB

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

I think they want something like this....

For $a = 1 To 26
    For $b = 1 To 26
        For $c = 1 To 26
            $thename = Chr($a + 64) & Chr($b + 64) & Chr($c + 64)
            MsgBox(0, "Name", $thename)
        Next 
    Next 
Next
Hey thats pretty nice, thanks.

Share this post


Link to post
Share on other sites

Hey thats pretty nice, thanks.

He's glad he could help.

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

He's glad he could help.

Indeed.

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
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
Sign in to follow this  
Followers 0