Autoit to Spam leftclick in game by holding rightclick.

#Include <Misc.au3>
#include <AutoItConstants.au3>

Func MouseDownUp()
   $MyRandom = Random ( 1, 25, 0 )
   Sleep(1 * $MyRandom)
   MouseDown($MOUSE_CLICK_LEFT) ; Set the left mouse button state as down.
   $MyRandom = Random ( 1, 25, 0 )
   Sleep(1 * $MyRandom)
   MouseUp($MOUSE_CLICK_LEFT) ; Set the left mouse button state as up.
   Return
EndFunc

While 1
   While _IsPressed (01)
	  ;$Pos = MouseGetpos ()
	  ;Mouseclick ("Left", $Pos[0], $Pos[1], 1, 0)
	  ConsoleWrite("click")
	  $MyRandom = Random ( 1, 50, 0 )
	  Sleep(1 * $MyRandom)
	  MouseUp($MOUSE_CLICK_LEFT) ; Set the left mouse button state as up.

	  While _IsPressed (02)
	  MouseDownUp()
	  wend
   Wend
Wend

Popular Posts

Leave a Reply

Your email address will not be published. Required fields are marked *