Jump to content

Recommended Posts

Guest 2n193r
Posted (edited)

I want it so that when ever the use was to hold a key down it woudl constantly do a left mouse click. I wanted this to work in any program. ex. A computer game.

My idea

$k = RegRead("HKEY_CURRENT_USER\Control Panel\Mouse", "SwapMouseButtons")


While;missing code
   If $k = 1 Then
      MouseClick("left")
   Else
      MouseClick("right")
   Sleep(33)
EndIf
Wend
haha, this looks like a programming test. Errr, i want Java, but i cant do it. any help would be very much appreciate. Edited by 2n193r
Posted

$k = RegRead("HKEY_CURRENT_USER\Control Panel\Mouse", "SwapMouseButtons")


While 1
   If $k = 1 Then
      MouseClick("left")
   Else
      MouseClick("right")
   Sleep(33)
EndIf
Wend

CheersNobby

Guest 2n193r
Posted

i dont want it to click all the time, just when.. lets see mouse3(middle mouse button is pushed)

Posted

This will do what you want

#include <GuiConstants.au3>

Global $Paused
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{ESC}", "Terminate")

call("TogglePause")

While 1
    MouseClick("left")
    sleep(20)
WEnd

Func TogglePause()
$Paused = NOT $Paused
While $Paused
sleep(100)
ToolTip('Script is "Paused"',0,0)
WEnd
ToolTip("")
EndFunc

Func Terminate()
Exit 0
EndFunc

just press "Pause" (you do not need to hold it down)

the script will send continuous mouse clicks

press"Pause" again and it will stop

press "Esc" and the script will terminate

Hope that helps...

8)

NEWHeader1.png

Guest 2n193r
Posted (edited)

ok, i got it working last night. Here is what i got. I will prob make a GUI so some one can change the delay and key.

$k = RegRead("HKEY_CURRENT_USER\Control Panel\Mouse", "SwapMouseButtons")
While 1
    If _IsPressed('04') Then
        If $k = 1 Then
            MouseClick("right")
        Else
            MouseClick("left")
        EndIf
    EndIf
   Sleep(1)
Wend
Exit

;Credit for _IsPressed() at:
;http://www.autoitscript.com/forum/index.php?showtopic=5760
Func _IsPressed($hexKey)
  Local $aR, $bO
 
  $hexKey = '0x' & $hexKey
  $aR = DllCall("user32", "int", "GetAsyncKeyState", "int", $hexKey)
  If Not @error And BitAND($aR[0], 0x8000) = 0x8000 Then
     $bO = 1
  Else
     $bO = 0
  EndIf
 
  Return $bO
EndFunc
Oops, i think i jusy made hack for a computer game, delete time. Owell :) Edited by 2n193r

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
×
×
  • Create New...