sound358 Posted September 6, 2011 Share Posted September 6, 2011 What I would like to do is when I click right mouse it will activate the script and when i click right mouse again it deactivates it like a toggle.. Any help would be appreciated HotKeySet("{F6}","_Exit") While 1 $Variable = PixelSearch(1,1,706,338,0xF80000 ) If IsArray($Variable) = True Then MouseMove($Variable [0], $Variable [1], 1 ) MouseClick("Left") EndIf WEnd Func _Exit() Exit EndFunc Link to comment Share on other sites More sharing options...
JohnOne Posted September 6, 2011 Share Posted September 6, 2011 Something like this maybe. #include <Misc.au3> $bOn = False ;set a boolean for the on/off $i = 0 While 1 If _IsPressed("02") Then $bOn = Not $bOn ; Change the state of the on/off switch If $bOn Then $Variable = PixelSearch(1, 1, 706, 338, 0xF80000) If IsArray($Variable) = True Then MouseMove($Variable[0], $Variable[1], 1) MouseClick("Left") EndIf ConsoleWrite("On " & $i & @CRLF);just to show if on or off $i +=1 EndIf Sleep(10) WEnd AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
sound358 Posted September 6, 2011 Author Share Posted September 6, 2011 Thank you much good sir work's like a charm exactly what I was looking for.. 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