MySqlThrashMetal Posted July 17, 2017 Posted July 17, 2017 dim $x = Random(0, @DesktopWidth, 0) dim $y = Random(0, @DesktopHeight, 0) HotKeySet("{ESC}", "Exit") While 1 $y = Random(0, @DesktopHeight, 0) $x = Random(0, @DesktopWidth, 0) Sleep(500) MouseMove($x,$y,10) WEnd Hello ! HotKeySet doesn't work. In this case, the program musts stop but he doesn't stop.
InunoTaishou Posted July 17, 2017 Posted July 17, 2017 Can't use "Exit" as a function in HotKeySet. Also, Dim is depreciated and not used much anymore. Try looking at Global and Local for declarations Global $x = Random(0, @DesktopWidth, 0) Global $y = Random(0, @DesktopHeight, 0) HotKeySet("{ESC}", Close) While 1 $y = Random(0, @DesktopHeight, 0) $x = Random(0, @DesktopWidth, 0) Sleep(500) MouseMove($x, $y, 10) WEnd Func Close() Exit EndFunc You can also forego the variables all together and just use the Random in the MouseMove function (Plus you used DesktopWidth for Y and DesktopHeight for X, backwards :P) HotKeySet("{ESC}", Close) While 1 Sleep(500) MouseMove(Random(0, @DesktopWidth, 0), Random(0, @DesktopHeight, 0), 10) WEnd Func Close() Exit EndFunc
MySqlThrashMetal Posted July 17, 2017 Author Posted July 17, 2017 Hello ! Thank you very much for your help and tips !
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now