Code: Select all
#persistent
Loop
{
random, X, -10, 10
random, Y, -10, 10
MouseMove, X, Y, 5, R
}
^Esc::run taskkill /IM MouseMove.exe
In order to do this, I need to have a script check the color under the mouse. It would be cool to have two different modes: one where hitting a black pixel forces restart, and one where hitting a black pixel reverts the cursor to its position prior to hitting the wall.
Here's what I have so far, and it doesn't work:
Code: Select all
#persistent
Loop
{
MouseGetPos, Xpos1, Ypos1
PixelGetColor, Colour, Xpos1, Ypos1
Sleep, 75
If Colour=0x00FF00
; if green
run taskkill /IM MouseMaze.exe
return
If Colour=0x000000
; if black
PixelSearch, Px, Py, 0, 0, 1920, 1080, 0xFF0000, 3, Fast RGB
MouseMove, Px, Py, 1
return
; If Colour=0xFFFFFF <- I don't think I need anything for "if white"
; return
return
}
^Esc::
run taskkill /IM MouseMaze.exe ,, hide
run taskkill /IM MouseMove.exe ,, hide
run taskkill /IM AutoHotKey.exe ,, hide