narayanjr Posted November 9, 2007 Share Posted November 9, 2007 Once i start Attack() i cant stop it. Everytime i press + again it just sends the key like normal, the program is not catching it as a hotkey and im pretty sure its because shift is still down. Ive tried moving when Shift is pushed and where it is let up and moving the sleep around but everytime i try it shift always seems to be stuck down so i cant call the function again to stop it Any ideas? HotKeySet("{NUMPADADD}", "Attack") Global $Attack While 1 Sleep(10000) WEnd Func Attack() $Attack = NOT $Attack ToolTip('Attacking...',0,0) While $Attack Send("{LSHIFT DOWN}") MouseClick("Left") Send("{LSHIFT UP}") Sleep(500) WEnd ToolTip("") EndFunc Link to comment Share on other sites More sharing options...
lordicast Posted November 9, 2007 Share Posted November 9, 2007 Sounds like a headache you could always do the lazy and run 2 instance of your program before exit like HotKeySet("{NUMPADADD}", "Attack") HotKeySet("{esc}","halt") Global $Attack While 1 Sleep(10000) WEnd Func Attack() $Attack = NOT $Attack ToolTip('Attacking...',0,0) While $Attack Send("{LSHIFT DOWN}") MouseClick("Left") Send("{LSHIFT UP}") Sleep(500) WEnd ToolTip("") EndFunc Func halt() Run("yourprogram.exe") Exit EndFunc [Cheeky]Comment[/Cheeky] Link to comment Share on other sites More sharing options...
narayanjr Posted November 10, 2007 Author Share Posted November 10, 2007 (edited) the halt() function doesnt work because shift is being pushed down also so when you hit esc it doesnt see it as a hotkey and it doesnt exit ive tried this but it never seems like LSHIFT Up is ever done any other ideas? ive also tried using different keys for hotkey but cant get any to work #include <Misc.au3> $dll = DllOpen("user32.dll") While 1 Do Sleep(100) Until _IsPressed("63", $dll) Sleep(250) Do Send("{LSHIFT DOWN}") MouseClick("Left") Send("{LSHIFT UP}") Sleep(500) Until _IsPressed("63", $dll) Sleep(250) WEnd Edited November 10, 2007 by narayanjr Link to comment Share on other sites More sharing options...
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