Jump to content

Recommended Posts

Posted

This was my first AutoIT script, which started out as a .VBS script. This script makes it possible to generate large amounts of repeating text while incrementing a variable inside the text. For example:

ClassObj[1].Variable[1] = NewValue
ClassObj[1].Variable[2] = NewValue2
ClassObj[1].Variable[3] = NewValue3

ClassObj[2].Variable[1] = NewValue
ClassObj[2].Variable[2] = NewValue2
ClassObj[2].Variable[3] = NewValue3

ClassObj[3].Variable[1] = NewValue
ClassObj[3].Variable[2] = NewValue2
ClassObj[3].Variable[3] = NewValue3

ClassObj[4].Variable[1] = NewValue
ClassObj[4].Variable[2] = NewValue2
ClassObj[4].Variable[3] = NewValue3

ClassObj[5].Variable[1] = NewValue
ClassObj[5].Variable[2] = NewValue2
ClassObj[5].Variable[3] = NewValue3

The above by entering this in the string box:

ClassObj[$01].Variable[1] = NewValue
ClassObj[$01].Variable[2] = NewValue2
ClassObj[$01].Variable[3] = NewValue3

The $01 is a variable placeholder and I told it to start at 1 and increment 1 each time. It literally types out the text you enter in the window you select for the specified repetitions. It also supports all the {BUTTON} strings that Send() supports (since it's using Send()). It's saved me hours of programming and I thought I should share with the rest of the class. Demo included in the program, just press "Run Demo" on the main screen. ;)

PS - be VERY careful with this if you are pressing keyboard buttons (especially ALT-TAB or something). I did include a failsafe if something happens - hit Escape.

StringRepeater.au3

Posted

It's not constantly setting and unsetting the hotkey in each loop, it only sets the hotkey right before running the output loop and then unsets after finishing that loop. That's the only time I want the Escape key to call the stop function.

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
  • Recently Browsing   0 members

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