@Link102
Let me elaborate on what I'm trying to do. I'm finishing up a sudoku solver, and the way it solves puzzles is by brute force. Some puzzles with multiple solutions (or invalid puzzles) take about an hour to solve. Basically, there is a recursive function that calls itself over and over until the puzzle is solved. There's no syncing, waiting, nor input during this cycle. Think of it as a potentially LONG for-next loop, like from i=0 to 99999999. While it is thinking, I want to give the user an option to move the mouse over to a "stop" button and click it. Obviously, the function would then terminate and a null solution is given. You can move the mouse while it is thinking, but mousex() and mousey() won't update values.
Now, instead of using
if mousex()>x and mousey()>y and mouseclick() then blah
where x and y are the coordinates of the button (it's in the bottom right hand corner of the screen), I used
while mousex()>x and mousey()>y and mouseclick()
blah
endwhile
It's a pretty ghetto fix, and I'd like a better way to do it. For now, though, it seems to work. Thanks KISTech
edit: Scratch that, it still doesn't seem to work.
sync on
print "START"
fastsync
for i=0 to 99999999
cls
while mousex()>400 and mousey()>400
print "IT WORKS!"
fastsync
endwhile
print i
print mousex(),",",mousey()
fastsync
next i
No matter where you move the mouse, it never prints "IT WORKS!" Yes, my screen resolution was higher than 400x400 so it was possible for my mouse to reach those values. Also, if you run the program, the printed mousex() and mousey() still don't change ><