Jump to content
Sign in to follow this  
sound358

Need Some help with a Script

Recommended Posts

sound358

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

Share this post


Link to post
Share on other sites
JohnOne

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.

Share this post


Link to post
Share on other sites
sound358

Thank you much good sir work's like a charm

exactly what I was looking for.. :mellow:

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.