Autohotkey 自动热键-尝试发送阵列的特定位置
我正在尝试发送数组的特定部分 我的代码尝试键入指定次数的字符串 如果有人知道更好的方法,我愿意接受Autohotkey 自动热键-尝试发送阵列的特定位置,autohotkey,Autohotkey,我正在尝试发送数组的特定部分 我的代码尝试键入指定次数的字符串 如果有人知道更好的方法,我愿意接受 #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. ; #Warn ; Enable warnings to assist with detecting common errors. SendMode Input ; Recommended for new script
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
i = 0 ; Used for a loop
InputBox, x, String, Please enter your string
InputBox, y, No. of times, Please enter the no. of times you want to run the string
k = `n ;used to concatenate strings
z = %x%%k% ;concatenating the input with new lines
F10::
while (i < y) { ;While the loop has run less than the required number of times
i++ ;increment the number of times the loop has run
l = 0 ;used to run a loop a certain number of times
a = StrSplit(%s%) ;Splits the string created earlier
send %a% ;For debug
g = 0 ;used as a value for cycling through arrays
while (l < StrLen(s)) {
h = a[g] ;creates a variable for a specified position in the string
g++
Random, rand, 10, 100 ;creates a variable to wait a random amount of time
r = %rand% ;assigns a random value to a variable for debug
FileAppend, Loop - %h% `n, C:\Users\charl\Desktop\Code\AutoHotkey\Debug.txt ;all file usage is for debug
FileAppend Rand - %r% `n `n, C:\Users\charl\Desktop\Code\AutoHotkey\Debug.txt
send %h% ;sends a character of the original string
Sleep %r% ;sleeps a random amount of time
}
}
#NoEnv;推荐用于性能和与未来自动热键版本的兼容性。
; #警告;启用警告以帮助检测常见错误。
发送模式输入;由于其优越的速度和可靠性,建议用于新脚本。
SetWorkingDir%A_ScriptDir%;确保起始目录一致。
i=0;用于循环
输入框,x,字符串,请输入您的字符串
输入框,y,次数,请输入要运行字符串的次数
k=`n;用于连接字符串
z=%x%%k%;用新行连接输入
F10::
while(i
很抱歉,代码太乱,很难理解用于此特定功能的代码是:
InputBox, str, String, Please enter your string
InputBox, amt, No. of times, Please enter the no. of times you want to run the string
Return
F10::
Loop, %amt% {
For k,v in StrSplit(str) {
ToolTip, now %A_Index%
Random, rand, 10, 100 ;creates a variable to wait a random amount of time
;FileAppend %v%`n`n, %A_WorkingDir%\Debug.txt
Send, % v "`n"
Sleep, % rand ;sleeps a random amount of time
}
}