Jump to content

Recommended Posts

Posted

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

Posted

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.

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...