Jump to content
Sign in to follow this  

String Repeater

Recommended Posts


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.


Share this post

Link to post
Share on other sites

I havent looked at all your script as I cant see a use for it for me.

But I dont think its wise to set a hotkey in a while loop, nor unset one, you're doing both, you just need a hotkey once, and not in a loop.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post

Link to post
Share on other sites

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.

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