Jump to content

[Question] Slow Down Keystrokes


mvriesen2009
 Share

Recommended Posts

I've been testing my Ducky scripts in a VirtualBox VM with a Windows 7 operating system. It seems that the keystrokes are played too fast for the virtualized hardware, so my scripts rarely run properly. Is there a way to slow down the rate of keystroke playout?

Alternately, is it possible to program the Ducky with the Arduino environment? If so, is there a tutorial that provides the basics?

Thanks!

Mark

Link to comment
Share on other sites

The current version of the encoder does not allow you to slow down the keystrokes, but the online encoder does by setting a string delay.

Keyword: STRINGDELAY N or STRING_DELAY N - Inserts a delay, N Milliseconds between each character in STRING output. Useful when the USB bus cannot keep up with the duck. Start with the smallest value of 1 and incriment the number as needed.

So it is just like the normal DELAY command.

There are no tutorials for actual programming of the firmware at the moment. Once the firmware source is released you will be able to though.

Link to comment
Share on other sites

Do you just enter this once at the top of the file?

e.g

STRINGDELAY 5

STRING SomeText

or do you have to :

STRING S

STRINGDELAY 5

STRING o

STRINGDELAY 5

STRING m

STRINGDELAY 5

STRING e

STRINGDELAY 5

STRING T

STRINGDELAY 5

STRING e

STRINGDELAY 5

STRING x

STRINGDELAY 5

STRING t

Link to comment
Share on other sites

  • 1 month later...

Do you just enter this once at the top of the file?

e.g

STRINGDELAY 5

STRING SomeText

or do you have to :

STRING S

STRINGDELAY 5

STRING o

STRINGDELAY 5

STRING m

STRINGDELAY 5

STRING e

STRINGDELAY 5

STRING T

STRINGDELAY 5

STRING e

STRINGDELAY 5

STRING x

STRINGDELAY 5

STRING t

Was there ever an answer figured out for this?

Link to comment
Share on other sites

Was there ever an answer figured out for this?

Would Default delay work? http://www.usbrubberducky.com/wiki/doku.php?id=duckyscript

DEFAULT_DELAY or DEFAULTDELAY

DEFAULT_DELAY or DEFAULTDELAY is used to define how long (in milliseconds * 10) to wait between each subsequent command. DEFAULT_DELAY must be issued at the beginning of the ducky script and is optional. Not specifying the DEFAULT_DELAY will result in faster execution of ducky scripts. This command is mostly useful when debugging.

Command Parameters DEFAULT_DELAY n * 10 ms DEFAULTDELAY n * 10 ms DEFAULT_DELAY 10 REM delays 100ms between each subsequent command sequence

  • Like 1
Link to comment
Share on other sites

If you use iducke.com you can specify a string delay. http://www.iducke.com/About/Features

My question is the same as above, regarding the STRINGDELAY for slowing down the text input. I have the same problem, my VM bus can't keep up with the duck speed. So would a simple STRINGDELaY n preceding the command e.g

STRINGDELAY 5

STRING SomeText

be sufficient or does a more detailed breakout need to be done, as in

STRING S

STRINGDELAY 5

STRING o

STRINGDELAY 5

STRING m

Thanks for the assist.

Link to comment
Share on other sites

My question is the same as above, regarding the STRINGDELAY for slowing down the text input. I have the same problem, my VM bus can't keep up with the duck speed. So would a simple STRINGDELaY n preceding the command e.g

STRINGDELAY 5

STRING SomeText

be sufficient or does a more detailed breakout need to be done, as in

STRING S

STRINGDELAY 5

STRING o

STRINGDELAY 5

STRING m

Thanks for the assist.

No love here eh? To clarify, I am not trying to add DELAYS to slow down the script execution, just to slow down how fast the duck types the actual keystrokes. It is entering incomplete commands because the VM Bus is unable to keep up.

Link to comment
Share on other sites

No love here eh? To clarify, I am not trying to add DELAYS to slow down the script execution, just to slow down how fast the duck types the actual keystrokes. It is entering incomplete commands because the VM Bus is unable to keep up.

After some experimentation I have found the answer. To insert the delay between STRING character inputs, the proper syntax is

STRING_DELAY N (where N is the time delay)

I found STRING_DELAY 50 to work perfectly, ie.

GUI d

DELAY 500

PRINTSCREEN

DELAY 100

MENU

DELAY 300

STRING V

DELAY 40

STRING D

DELAY 300

GUI r

DELAY 700

STRING_DELAY 50 mspaint

ENTER

DELAY 1200

CTRL v

DELAY 500

CTRL s

DELAY 1000

STRING_DELAY 50 %userprofile%\a.bmp

ENTER

DELAY 500

ALT f

DELAY 400

STRING K

DELAY 100

STRING F

DELAY 1000

ALT F4

DELAY 300

GUI d

Link to comment
Share on other sites

Does "STRING_DELAY 50 %userprofile%\a.bmp" actually work? STRING_DELAY is ment to be a global setting like DEFAULT_DELAY. 50 seems too high of a number, In my testing STRING_DELAY of 1 worked great. Much higher was too slow. Here is an example

http://www.iducke.com/Encoder/IDE/44

In that example, using "STRING_DELAY 1" is exactly the same as if you did

STRING t
DELAY 1
STRING h
DELAY 1 
STRING e 
DELAY 1
STRING q
DELAY 1 
STRING u
DELAY 1 
STRING i
DELAY 1 
STRING c
DELAY 1 
STRING k
DELAY 1 
STRING b
DELAY 1 
STRING r
DELAY 1 
STRING o
DELAY 1 
STRING w
DELAY 1 
STRING n
DELAY 1 
STRING f
DELAY 1 
STRING o
DELAY 1 
STRING x
DELAY 1 
STRING j
DELAY 1 
STRING u
DELAY 1 
STRING m
DELAY 1 
STRING p
DELAY 1 
STRING s 
DELAY 1 
STRING o
DELAY 1 
STRING v
DELAY 1 
STRING e
DELAY 1 
STRING r 
DELAY 1 
STRING t
DELAY 1 
STRING h
DELAY 1 
STRING e 
DELAY 1 
STRING l
DELAY 1 
STRING a
DELAY 1 
STRING z
DELAY 1 
STRING y
DELAY 1 
STRING d
DELAY 1 
STRING o
DELAY 1 
STRING g

Link to comment
Share on other sites

Does "STRING_DELAY 50 %userprofile%\a.bmp" actually work? STRING_DELAY is ment to be a global setting like DEFAULT_DELAY. 50 seems too high of a number, In my testing STRING_DELAY of 1 worked great. Much higher was too slow. Here is an example

http://www.iducke.com/Encoder/IDE/44

In that example, using "STRING_DELAY 1" is exactly the same as if you did

STRING t
DELAY 1
STRING h
DELAY 1 
STRING e 
DELAY 1
STRING q
DELAY 1 
STRING u
DELAY 1 
STRING i
DELAY 1 
STRING c
DELAY 1 
STRING k
DELAY 1 
STRING b
DELAY 1 
STRING r
DELAY 1 
STRING o
DELAY 1 
STRING w
DELAY 1 
STRING n
DELAY 1 
STRING f
DELAY 1 
STRING o
DELAY 1 
STRING x
DELAY 1 
STRING j
DELAY 1 
STRING u
DELAY 1 
STRING m
DELAY 1 
STRING p
DELAY 1 
STRING s 
DELAY 1 
STRING o
DELAY 1 
STRING v
DELAY 1 
STRING e
DELAY 1 
STRING r 
DELAY 1 
STRING t
DELAY 1 
STRING h
DELAY 1 
STRING e 
DELAY 1 
STRING l
DELAY 1 
STRING a
DELAY 1 
STRING z
DELAY 1 
STRING y
DELAY 1 
STRING d
DELAY 1 
STRING o
DELAY 1 
STRING g

STRING_DELAY 50 worked fine for me whereas 1 was still too fast. I worked my way up to 3 and it was still too quick, so I just made the leap to 50 out of frustration and it worked. A lower number would probably work, I just wanted to be able to effectively test the scripts. Once I confirm they work properly, I will work on fine tuning the timing. I imagine it could be a variation in the way our VM's are setup. Theoretically, a normal computer wouldn't need the STRING_DELAY, right? I haven't seen this issue anywhere else in the forums other than referencing VM's.

Link to comment
Share on other sites

  • 9 years later...

Dang near a decade later... But wanted to say a few things that might help someone later clarify the mistakes of this thread.
But my head was hurting just seeing the struggle here... Guys... This was WAY overcomplicated than it had to be. Hopefully this is the last comment that would even need to be said on this thread in regard to keystroke delays. I too once struggled with the keystroke delay, but it's because we commonly overthink the entire process, when we just need to step back and look at what's available and utilize what is already there.

The common problem I see with keystrokes and newcomers writing their first scripts...
The complaint is usually that there is no delay in between keystrokes when using STRING.
For example:

STRING what
 

If you want to add a delay in between the keystrokes it's really quite simple. The comments above were on the right path by breaking it out into multiple lines so I would do something like:


STRING w
STRING h
STRING a
STRING t

ETC...

But you didn't need to add a delay between each line unless you need varying delays that are not consistent... THIS IS OVERKILL and bloated. All you need is to make sure the top of your script has:
DEFAULTDELAY or DEFAULT_DELAY followed by the value you desire. This specific command is the interval that is by default utilized between each command by the rubber ducky itself. A lot of scripts I see a lot of people just using a value of 100 (might be slower than desired, but you can change it to whatever you want/need)
(i.e. DEFAULTDELAY 100)

To explain a little better:
Since you're splitting your string up into multiple "STRING" commands, DEFAULTDELAY becomes the delay of choice between each keystroke BECAUSE you split your string up into MULTIPLE string commands and DEFAULTDELAY is the delay that is utilized by default "BETWEEN EACH COMMAND". So you only need to specify the delay once at the top of the script and you're good.

There is and really was no need to add a "Keystroke Delay" such as was utilized on the old now non-existent iducke encoder that someone else had made. because you can just breakout your string into multiple string commands and use "DEFAULTDELAY" in this manner. The usage is just one time at the top of your script and that saves you from adding 2 and a half dozen "DELAY" lines to your script.

To show how quick the bloat disappears compare ascorbic's example to mine, our scripts do the EXACT same thing with half the scripting:

DEFAULTDELAY 1
STRING t
STRING h
STRING e 
STRING q
STRING u
STRING i
STRING c
STRING k
STRING b
STRING r
STRING o
STRING w
STRING n
STRING f
STRING o
STRING x
STRING j
STRING u
STRING m
STRING p
STRING s 
STRING o
STRING v
STRING e
STRING r 
STRING t
STRING h
STRING e 
STRING l
STRING a
STRING z
STRING y
STRING d
STRING o
STRING g

Because we set our DEFAULTDELAY to 1. By "Default" there is a delay of 1 between each and every duck command. 
This of course changes if you need varying delays that are not equal, but for something such as this... it could be done to save you from bloat.
You could even use this to debloat your main script and add additional delays where needed by using DELAY in a manner like you already are, whilst
also taking advantage of DEFAULTDELAY. where you're delay just becomes DEFAULTDELAY + DELAY.

Sometimes you really just want to keep it simple... and when it comes to things I have to type out... I keep it as simple and as few lines as possible.

:)

Hope this helps many realize that it's easy to get keystroke delays simply by using it this way.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...