Jump to content

Incremental letters


Recommended Posts

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.

Link to comment
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
Edited by Catindog
Link to comment
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
Link to comment
Share on other sites

  • Moderators

Hey thats pretty nice, thanks.

He's glad he could help.

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.

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