Send Copied Text of Clipboard with Random Delay

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Barbarossa
Posts: 2
Joined: 11 Jul 2018, 04:57

Send Copied Text of Clipboard with Random Delay

11 Jul 2018, 05:04

Hello im pretty much lost right now guys.

I am trying to send a Text of the Clipboard with Random Key Strokes just like you would write it on your own.

What I´ve done so far:

Code: Select all

^b::
send % sendAtRandom %clipboard%

sendAtRandom(string) {

	Loop, parse, string
	{
		Send % A_LoopField
		Random, t, 100, 400
		Sleep, %t%
		
		}

}
and the other test which is without Clipboard but working:

Code: Select all

^b::
Variable1 = %clipboard%
send % sendAtRandom("I want to send this string with random delays")

sendAtRandom(string) {

	Loop, parse, string
	{
		Send % A_LoopField
		Random, t, 50, 300
		Sleep, %t%
		
		}

}
Any Option to Combine these to? :D
User avatar
Xtra
Posts: 2750
Joined: 02 Oct 2015, 12:15

Re: Send Copied Text of Clipboard with Random Delay

11 Jul 2018, 12:24

Code: Select all

^b::
    clipboard := "I want to send this string with random delays"
    ClipWait, 1
    sendAtRandom(clipboard)
    ; Or
    Variable1 := clipboard
    sendAtRandom(Variable1)
return

sendAtRandom(string) {
	Loop, parse, string
	{
		Send % A_LoopField
		Random, t, 50, 300
		Sleep, t
    }
}
HTH
Barbarossa
Posts: 2
Joined: 11 Jul 2018, 04:57

Re: Send Copied Text of Clipboard with Random Delay

17 Jul 2018, 06:19

Xtra wrote:

Code: Select all

^b::
    clipboard := "I want to send this string with random delays"
    ClipWait, 1
    sendAtRandom(clipboard)
    ; Or
    Variable1 := clipboard
    sendAtRandom(Variable1)
return

sendAtRandom(string) {
	Loop, parse, string
	{
		Send % A_LoopField
		Random, t, 50, 300
		Sleep, t
    }
}
HTH
Thanks for your help but this one is just typing "I want to send this string with random delays" instead of pasting the Text of the Clipboard.

Maybe i didn´t clarify what I want to have made:

If I copy ctrl-c a Text like "autohotkey.com" and I dont want to paste it like it would with ctrl-v, I want to hit ctrl-b to paste "autohotkey.com" but with random delays after each letter.
^b::
clipboard := "I want to send this string with random delays" gives the script a fixed sentence again, is there a way to replace clipboard := with like %clipboard% or something?

Thanks for your help guys !
User avatar
Xtra
Posts: 2750
Joined: 02 Oct 2015, 12:15

Re: Send Copied Text of Clipboard with Random Delay

17 Jul 2018, 11:55

...with random delays after each letter.
Thats what it does maybe you need more delay?

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: filipemb, jaka1 and 172 guests