I am enjoying learning AHK, but I need help with this. I have a file of tens of thousands of coordinates (like 182:786) and I want to start it reading at random location every time I run it, to test mouse clicking. I have managed to write a script that reads the coordinates and clicks on screen accordingly, but I can't figure out how to tell it to start at a random location in the file and not at the beginning.
Here is what I've got so far:
Code: Select all
Loop, Read, test.csv
{
LineNumber = %A_Index%
Loop, parse, A_LoopReadLine, CSV
{
StringSplit, colon, A_LoopField, :, %A_Tab%%A_Space%
MyArray_%A_Index%_1 := colon1
MyArray_%A_Index%_2 := colon2
msgbox % "X is " MyArray_%A_Index%_1 " and Y is " MyArray_%A_Index%_2
MouseClick, left, MyArray_%A_Index%_1, MyArray_%A_Index%_2
Random, rand, 1000, 5000
Sleep, rand
}
}