omiden Posted June 7, 2010 Posted June 7, 2010 (edited) Please read my last post below! How would I add a toggle on/off key to this code, so when u hit like f3 its on then f4 off? Also is there a keynumber for scrollwheel? #include <Misc.au3> $dll = DllOpen("user32.dll") $ExitKey = '1B'; ESC While 1 Sleep(10) If _IsPressed("01", $dll) Then MouseMove(215, 485, 50) If _IsPressed($ExitKey, $dll) Then ExitLoop WEnd DllClose($dll) Edited June 7, 2010 by omiden
omiden Posted June 7, 2010 Author Posted June 7, 2010 Look at HotKeySet() in the helpfile.Thank you I will search
omiden Posted June 7, 2010 Author Posted June 7, 2010 Ok I read up on it and this is what I got but I get a error. #include <Misc.au3> $dll = DllOpen("user32.dll") $ExitKey = '75'; ESC HotKeySet ( "BD" [, "On"] ) HotKeySet ( "BB" [, "Off"] ) Func On() While 1 Sleep(10) If _IsPressed("01", $dll) Then MouseMove(640, 518, 100) If _IsPressed($ExitKey, $dll) Then ExitLoop WEnd DllClose($dll) EndFunc Func Off() While 1 Sleep(10) If _IsPressed("01", $dll) Then MouseMove(0, 0, 0) If _IsPressed($ExitKey, $dll) Then ExitLoop WEnd DllClose($dll) EndFunc Errors >"C:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Users\***\Desktop\recoil.au3" C:\Users\***\Desktop\recoil.au3 (5) : ==> Error parsing function call.: HotKeySet ( "BD" [, "On"] ) HotKeySet ( "BD" ^ ERROR >Exit code: 1 Time: 0.212
XxShadowxX Posted June 8, 2010 Posted June 8, 2010 The brackets stand for optional arguments, they should not be in your actual script. Those two lines should look like: HotKeySet ( "BD" , "On") HotKeySet ( "BB" , "Off")
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