the point is to send random line from .txt each time the script called "pressing f1"
Code: Select all
F2::Reload
F1::
SetWorkingDir %A_ScriptDir%\Data\Text
Write = 5
Loop, 10
{
txt := "To.txt"
FileRead, coSubleng, %txt%
FileDelete, %txt%
Sort coSubleng, random U
FileAppend, %coSubleng%, %txt%
List = %txt%
i=0
i++
FileReadline,Line,%List%,%i%
SetKeyDelay, %Write%, 0,
{
Sleep,80
Send, %Line%{Enter}
Sleep,10
}
}
return
because i don't seems to find a way to make it work, tried adding multiple different speed here and there, and didn't work.