Mouse Keeps Getting Stuck Frozen if I add more lines in the loop
Posted: 09 Dec 2022, 11:42
Hello, sometimes the following script will make my mouse stop working. Left click still works but unable to move the mouse and this makes the script stop moving the mouse. I can't seem to figure out why. Sometimes the mouse gets stop on the top left corner of the screen as well.
Code: Select all
TH:
WinGetPos, wx, wy, ww, wh, ProgramName -
if (ok:=FindText(X, Y, wx, wy, wx+ww, wy+wh, 0.000001, 0.000001, TextFindsPuzzle,,0)){
Loop{
if (ok:=FindText(X, Y, wx, wy, wx+ww, wy+wh, 0.000001, 0.000001, TextPuzzleSolve)){
Random, i, 1, % ok.MaxIndex()
Random, xx, -5, 5
Random, yy, -5, 5
sleep_click(ok[i].x+xx, ok[i].y+yy)
}
if (ok:=FindText(X, Y, wx, wy, wx+ww, wy+wh, 0.000001, 0.000001, TextPuzzlePiece1)){
Random, i, 1, % ok.MaxIndex()
Random, xx, -5, 5
Random, yy, -5, 5
sleep_click(ok[i].x+xx, ok[i].y+yy)
}
if (ok:=FindText(X, Y, wx, wy, wx+ww, wy+wh, 0.000001, 0.000001, TextFindsPuzzle)){
Random, i, 1, % ok.MaxIndex()
Random, xx, -5, 5
Random, yy, -5, 5
sleep_click(ok[i].x+xx, ok[i].y+yy)
}
if (ok:=FindText(X, Y, wx, wy, wx+ww, wy+wh, 0.000001, 0.000001, TextPuzzleInactive)){
if (ok:=FindText(X, Y, wx, wy, wx+ww, wy+wh, 0.000001, 0.000001, TextLeavePuzzle)){
Random, xx, -3, 3
Random, yy, -3, 3
sleep_click(ok[1].x+xx, ok[1].y+yy)
sleep, rand_range(2000, 5000)
}
}
}
}
return